Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate glint-expect-error (and other directives) for tsc and TS Plugin using Vue's approach #799

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

machty
Copy link
Contributor

@machty machty commented Feb 17, 2025

Support for @glint-expect-error was previously provided by monkeypatching the typescript-semantic Language Service plugin provided by Volar, but unfortunately:

  1. This approach isn't used by TS Plugin mode
  2. This approach isn't used by runTsc which our glint type-checking binary uses.

The solution is to move more of the expect-error (and other directive) logic into our mapping code so that when we call toVolarMappings, we can make use of the shouldReport callback to keep track of diagnostics raised within the glint-expect-error directive's area of effect. It is complicated and possibly brittle but at least it's in line with Vue, and any upstream breaking changes should be much easier to follow.

TODO

  • terminate area-of-effect for mustache statements
  • identify other terminate points and implement
  • reinstate / test glint-ignore
  • reinstate / test glint-nocheck
  • reinstate support for directives within <Element ...> body only applying to next attribute/modifier

Closes #796

@machty machty changed the title Experiments with Vue-ified glint-expect-error and similar directives Reinstate glint-expect-error for tsc and TS Plugin using Vue's approach Feb 19, 2025
@machty machty changed the title Reinstate glint-expect-error for tsc and TS Plugin using Vue's approach Reinstate glint-expect-error (and other directives) for tsc and TS Plugin using Vue's approach Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Unused glint-expect-error" diagnostics sometimes span more source code text than they should
1 participant