Closed silverwind closed 1 year ago
Not aware of a setting for that.
Your options are to create a feature request in https://github.com/microsoft/TypeScript/issues or use LSP-eslint with specific rule that correct that on save.
Ok, assuming typescript gains this option, do you need to add support here or is that automatic?
I pick up all new typescript options whenever typescript adds new ones so more or less "automatic". No need for an issue for tracking.
Okay, closing here then.
Actually I think there is already an option for this: typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
or the javascript equivalent.
If it doesn't work after setting this one then try formatting the document first (LSP: Format file) and then try completions again. If it works then then it's something that should be fixed in the server.
Tested this myself and noticed that depending on how the import is completed, it either follows or doesn't follow the setting:
https://user-images.githubusercontent.com/153197/192781891-75440cef-0463-4b23-86bd-cd609fdcfb90.mov
I've reproduced it in VSCode also so I would suggest just reporting it as a bug in TypeScript.
If you report mentioning the issue being reproducible in VSCode then it has much higher chance of being looked at. It's enough to set "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false
to reproduce there.
I can reproduce in ST as well, import foo<tab>
, looks to just ignore the insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
option.
Yes, I know it reproduces but since both TypeScript and VSCode are made by Microsoft it's easier for them to look at reports that report against VSCode.
I looked into this again. Behaviour is the same in VSCode, so it's definitely not a bug in LSP, but in vscode or its typescript extension.
Reported it at https://github.com/microsoft/TypeScript/issues/57834.
Is there an option to change space around variables in a autocompleted
import
statement? e.g.into
I tried disabling space-related settings but none seem to have any effect on import statements.