Skip to content

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

Merged
johnsoncodehk merged 1 commit intomasterfrom
extra-script
Feb 4, 2024
Merged

feat(typescript): re-support extra virtual scripts for LSP and Kit#132
johnsoncodehk merged 1 commit intomasterfrom
extra-script

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
@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.

1 participant