mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 12:34:39 +00:00
|
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Add a lint warning for unknown math variables[^1], powered by Tinymist's existing reference analysis. This allows users to see all such undefined variables at once if they have the linter enabled, instead of just the first error from the compiler. The autofix from #2062 is also applicable to these warnings. Example:  (The first error is pre-existing and emitted by the Typst compiler; the second warning is new from this PR and emitted by us.) Implementation notes: - The generated diagnostic tries to closely match the corresponding Typst compiler error, with one deliberate change: to differentiate the Tinymist warning and the compiler error, we use the message `potentially unknown variable: ...` instead of `unknown variable: ...`. I am not the biggest fan of this choice, but I think it is very important that users don't blame the Typst compiler for warnings that we generate; changing the message so that it isn't an exact clone is the best way I thought of for now. - We avoid duplicating a warning if the compiler has already generated an error for a given identifier by computing a set of `KnownLintIssues` from the compiler diagnostics and threading this information through the lint routines. [^1]: If users like this warning, we can extend it later to apply to undefined variables outside of math as well. --------- Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
tinymist-analysis
Typst Static Analyzers for Tinymist.