Typescript plugin and errant behavior
See original GitHub issueI guess my first question is about the nature of the Typscript plugin: it seems like the parser should be valid for Javascript as well? If so, is there a way to label this plugin functionality so that its more clear that this plugin is intended to be used for handling LSP features in JS and TS syntaxes? This would be more applicable to the Settings schema for vs-code
, I think, which uses strictly references to TypeScript
.
Though, it may be labeled as a TypeScript
plugin because it relies on the TypeScript and Javascript Language Features
plugin built into vs-code
? I disabled that plugin just to verify some behavior I was getting and it didn’t seem to affect the functionality of the svelte
TypeScript plugin
so I don’t think that’s the case but I could be wrong?
Lastly, when the TypeScript plugin
is enabled, saving a .svelte
file with a <script>
tag overrides my configuration to not use semicolons. The svelte-formatter
is configured as my default formatter and will even correctly remove the semi-colons that get written when run after the file is saved 😕 When I disable the TypeScript plugin
I obviously lose syntax highlighting and other LSP features of the code in the <script>
tag but statement-ending semicolons are no longer written in during file saving.
The formatter also removes an extra empty line that is added with the semicolons on file-save.
A picture example is given below of the behaviors: the top is after a file-save, the bottom is when running a format after the top picture.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
I’m closing this as I reviewed some of my settings. Something in my User Settings was causing this little glitch to occur.
I am not fully certain what it was but it was either a global
editor.formatOnSave
setting being incorrect syntax (I just removed the setting completely) or for some reason I had the default formatter fortypescript
files set todenoland
’s formatter (😅)At any rate, its been fixed on my side through some settings adjustments.
Appreciate the support and verification!
I can’t reproduce this given your code snippet, nothing is formatter on save for me. Could you disable the other extensions and try again?