Comments (5)
Thanks for the report. The language server now does this though a source.FixAll
code action, so you will need to add the following to the your "[go]"
settings block:
"[go]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
},
from vscode-go.
Thanks! That snippet solves the "on save" use case for me. However, if I use the editor "Format Document" command the -s
flag is still not applied.
from vscode-go.
You can run the simplifications manually by opening the Command Palette (Ctrl + Shift + P) and selecting "Source Action". I believe this will be added to the right click menu in the next VS Code release.
from vscode-go.
This issue is effectively solved for me with the fixAll
action on save, I just wanted to share that finding. If you don't consider it a bug that the formatFlags
option doesn't apply to the "Format Document" command then feel free to close this issue 🙂
from vscode-go.
Ok - thanks! The reason it no longer works as part of formatting is that it's now been split out as a code action, as defined in the LSP specification, which is intentional. Closing as result.
from vscode-go.
Related Issues (20)
- Couldn't start client gopls HOT 5
- Unable to run Go in VS Code - command not found HOT 4
- Adding a module using `go get` from outside vscode is not recognized until go.mod is reopened HOT 5
- Can not use VS code for GO: Installing github.com/go-delve/delve/cmd/dlv FAILED HOT 5
- Disable real-time syntax error highlighting with gopls HOT 1
- Problem in mouse hover tooltip HOT 3
- Automatically Infer Path Mapping for Remote Debugging
- // .*DO NOT EDIT.?$ HOT 6
- Extension issue HOT 1
- 0.14.2 broken on macos HOT 3
- Extension Repository Migration Plan HOT 1
- Region comments not working when extension is enabled HOT 3
- Debugging uses wrong working directory HOT 4
- Background of covered and not covered code cannot be removed after running package test HOT 9
- Extension Migration Plan HOT 4
- numeric constants containing underscore are not colored correctly HOT 1
- Gopls does not support versions of go <=1.12 HOT 2
- Unable to set breakpoint when using gutter and clear Code coverage HOT 3
- Updated to 0.14.3 or the nightly and entirely stopped working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-go.