-
Notifications
You must be signed in to change notification settings - Fork 770
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
No support for "editor.formatOnSaveMode":
"modifications"
and "modificationsIfAvailable"
#3174
Comments
"editor.formatOnSaveMode": "modifications"
broken anywhere & "editor.formatOnSaveMode": "modificationsIfAvailable"
relies on modification anyway
VS Code Go doesn't support formatOnSaveMode: "modifications". Formatting uses the same logic as gofmt, which operates on whole files at a time. Marking this as a feature request, but it is realistically unlikely to be implemented any time soon, given that so much relies on preserving gofmt'edness for the entire file. |
Understandable. There sure would be a way to make it so Moreover, there is a way in the VSCode API to make extensions enforce external settings defaults, and would be great to use it for [go]: {
"editor.formatOnSaveMode": "modifications"
} Until |
@Malix-off I'm not sure. CC @hyangah, who may know. |
With Go, It should possible to differentiate from By the way, my initial issue was more to address a bug report about References |
"editor.formatOnSaveMode":
"modifications"
or "modificationsIfAvailable"
"editor.formatOnSaveMode":
"modifications"
or "modificationsIfAvailable"
"editor.formatOnSaveMode":
"modifications"
and "modificationsIfAvailable"
Poke @findleyr This issue is not a feature request but a bug report See #3174 (comment) |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.https://github.com/Malix-off/vscode-issues-203463/blob/4c506f5c9fedbd12d0295455675a63c1f45f1591/.vscode/settings.json#L8-L17
Describe the bug
"editor.formatOnSaveMode": "modifications"
is broken anywhere &"editor.formatOnSaveMode": "modificationsIfAvailable"
relies on modification anywaySteps to reproduce the behavior:
I provided a dev container config
"editor.formatOnSaveMode": "file"
"editor.formatOnSaveMode": "modifications"
"editor.formatOnSaveMode": "modificationsIfAvailable"
"modifications"
, thus doesn't work)The text was updated successfully, but these errors were encountered: