The Svelte VSCode extension monitors changes to JS/TS files so that it can manually notify the Svelte language server of those changes. This makes Svelte Typescript support update in real-time for changes in non-Svelte files.
This PR is a copy from the VSCode extension, with a minor change to check the filename instead of using the document.languageId field which coc.nvim doesn't provide.
The Svelte VSCode extension monitors changes to JS/TS files so that it can manually notify the Svelte language server of those changes. This makes Svelte Typescript support update in real-time for changes in non-Svelte files.
This PR is a copy from the VSCode extension, with a minor change to check the filename instead of using the
document.languageId
field which coc.nvim doesn't provide.The bulk of the original code is here for comparison: https://github.com/sveltejs/language-tools/blob/a0b01ff7a58e6bedf0bb087b0023d3b6ea7cd0eb/packages/svelte-vscode/src/extension.ts#L275