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

feat(typescript): re-support extra virtual scripts for LSP and Kit #132

Merged
merged 1 commit into from Feb 4, 2024

Conversation

johnsoncodehk
Copy link
Member

Due to an upstream limitation, tsserver will throw when encountering a file name that does not exist in the file system, so Volar 2.0.0 no longer supports generating multiple virtual TS files from a single source file.

Since this breaks Astro's module syntax, generating multiple virtual TS files will now be supported again.

This only works for @volar/language-server and @volar/kit, but not for TS plugins executed in tsserver. This means that Astro is currently unable to migrate to the TS plugin.

Changes

  • LanguagePlugin.typescript add a new getExtraScripts() API for returning extra scripts
  • LanguageContext.typescript add a new getExtraScript() method

@johnsoncodehk johnsoncodehk changed the title feat(typescript): support extra virtual scripts in LSP feat(typescript): support extra virtual scripts for LSP and Kit Feb 4, 2024
@johnsoncodehk johnsoncodehk changed the title feat(typescript): support extra virtual scripts for LSP and Kit feat(typescript): re-support extra virtual scripts for LSP and Kit Feb 4, 2024
@johnsoncodehk johnsoncodehk merged commit 2fb4bb4 into master Feb 4, 2024
6 checks passed
@johnsoncodehk johnsoncodehk deleted the extra-script branch February 4, 2024 19:15
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.

None yet

1 participant