Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Feature request: override editor.insertSpaces/tabSize for Go files #384

Closed
rothskeller opened this issue Jul 10, 2016 · 6 comments
Closed

Comments

@rothskeller
Copy link

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.

@lukehoban
Copy link
Contributor

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 vscode-go to force different settings that whatVS Code defines. But even if it was, I'm not sure it would be possible to let manually configured user settings override this.

If you want to try out an implementation of this and open a PR, happy to review that.

@rothskeller
Copy link
Author

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.

@lukehoban
Copy link
Contributor

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.

@rothskeller
Copy link
Author

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?

@ramya-rao-a
Copy link
Contributor

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.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jan 12, 2017

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

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants