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

Opening VSCode window on a .gts in TS Plugin mode might not have diagnostics until changed/kicked #792

Open
machty opened this issue Jan 22, 2025 · 0 comments
Labels
v2 Specific to alpha/v2

Comments

@machty
Copy link
Contributor

machty commented Jan 22, 2025

Opening VSCode window on a .gts in TS Plugin mode might not have diagnostics until changed/kicked

  1. Debug Extension (TS Plugin Only)
  2. Open src/glimmer.gts
  3. Close all other windows. Start over; launch debug session, glimmer.gts will open, and depending on race conditions you might not get diagnostics until/unless you edit the file or click some tab in VSCode that for "reasons" will trigger diagnostics.

Root cause: our use of createAsyncLanguageServicePlugin to initialize our TS Plugin (which we need so that we can dynamically await import('@glint/core') ESM module from our CJS code) introduces some async that causes the TS Plugin to finish initializing after the first geterr (request diagnostics) command is sent to tsserver.

Other Volar tooling

  1. Vue - unable to repro
  2. MDX - unable to repro
  • That said if I introduce a 2s timeout in the middle of MDX's async setup fn, it yields the same behavior as Glint; MDX plugin won't finish initializing until after first geterr within tsserver.

I'm not sure why Glint is so comparably slow, but sounds like some perf work is needed and/or we should see if there's a way to trigger a re-diagnostics calculation after TS Plugins finish loaded.

@machty machty added the v2 Specific to alpha/v2 label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Specific to alpha/v2
Projects
None yet
Development

No branches or pull requests

1 participant