Feature request: override editor.insertSpaces/tabSize for Go files #384
Comments
I'm weary of actively overriding the VSCode and user-defined settings as part of this extension. You should be able to add this to a workspacesettings for each project already today - right? I'm actually not even sure it's possible for If you want to try out an implementation of this and open a PR, happy to review that. |
Adding to workspace settings doesn't help: the point is that the Go files need different settings from the other files within the same workspace. Ah, well, thanks for considering. |
Ahh - yes - workspace settings won't work. I think the ability to have different tab settings per file extension is something that VSCode should really support directly. I'm not sure how else this could be supported robustly. |
Perhaps you could suggest how to drive that recommendation? I'm new to the community and don't know the ropes yet. Or perhaps it's one you'd be willing to push yourself, having much more credibility in the community than a stranger like me? |
The TextEditorOptions does have a tabsize property. On active editor change, we could change the tabsize if the file in the active editor is a go file. |
Closing this issue, as the feature is being tracked in VS Code microsoft/vscode#1587 and should be shipped in the next release or the one after that |
Go source files are supposed to use tab characters (of size 8) for indentation. Most other languages indent with spaces (either 2 or 4), including those that tend to be used in the same project as Go code (such as Markdown documentation). The best solution to this would be language-specific indentation settings, but the vscode community has little interest in that; they see this as a Go-specific problem since Go is the outlier here. So it seems the only solution is to ask for the Go plugin to handle it: override the default editor settings to force tab-based indentation while editing .go files.
The text was updated successfully, but these errors were encountered: