-
Notifications
You must be signed in to change notification settings - Fork 28.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Indent Support not working for select in Go #77379
Comments
Since the indentation rules for Go are in VS Code, moved this issue from vscode-go to vscode. |
This is due to the limited architecture (regex based indentation rules and only support limited code styles), we may want to consider using formatters if they exist for indenation adjustment (if interested, we can discuss in #19847). For this particular issue, if the indentation rules are leading to more trouble than having no auto indent, you can set |
Auto indent moves case statements to the same level as the select when saving. Example:
Running VSCode v 1.36.1
The language-configuration.json file for go shows:
...
"indentationRules": { "increaseIndentPattern": "^.*(\\bcase\\b.*:|\\bdefault\\b:|(\\b(func|if|else|switch|select|for|struct)\\b.*)?{[^}\"'
]*|\([^)"']*)$", "decreaseIndentPattern": "^\\s*(\\bcase\\b.*:|\\bdefault\\b:|}[)}]*[),]?|\\)[,]?)$" },
...
The text was updated successfully, but these errors were encountered: