Draft
Conversation
Contributor
|
wow this is wild |
4 tasks
Contributor
|
What's the performance of this setup compared to the current one? |
- Resolved conflicts by keeping Volar architecture changes - Updated node engine requirement to >= 18.0.0 - Kept Volar-based implementations for language-server, svelte-check, svelte-vscode, and typescript-plugin
- Add svelteService.ts with Svelte template completions and hover support
- Block tag completions ({#if}, {#each}, {#await}, {#key}, {#snippet})
- Continuation tags ({:else}, {:then}, {:catch})
- Closing tags ({/if}, {/each}, etc.)
- Special tags ({@html}, {@debug}, {@const}, {@render}, {@Attach})
- Event modifier completions (preventDefault, stopPropagation, etc.)
- @component documentation completion
- Hover information for Svelte tags
- Update index.ts to include Svelte service plugin
- Add @volar/language-service dependency
- Fix ESM compatibility in svelte-check bin
- Remove conflicting files from upstream merge that don't fit Volar architecture
- Update tsconfig.json to include all packages in build
- Keep original workflow files (no workflow changes)
|
Port the battle-tested hack from Vue Language Tools that patches the built-in TypeScript extension to recognize .svelte files. This enables: - Auto imports from .svelte files in .ts/.js files - Go to definition from .ts/.js to .svelte files - Better TypeScript plugin integration - Proper language mode recognition for Svelte files The hack intercepts fs.readFileSync to modify the TypeScript extension's JavaScript code at load time, adding 'svelte' to the list of supported languages in several key places: - jsTsLanguageModes - isSupportedLanguageMode - isTypeScriptDocument - Plugin sorting for compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the initial implementation of integrating Volar with svelte2tsx. We have revamped
svelte-language-server,svelte-check(based-onastro-check),svelte-vscode,typescript-svelte-pluginusing the Volar toolkit.The existing svelte-specific features in the repository still need to be implemented by maintainers based on the Volar ServicePlugin API. (We have coordinated with the maintainers of svelte language tools, so if you have any questions, feel free to reach out to us on Discord!)
For debugging, you can now use Volar Labs for more visualization features: