Comments (7)
The suggestion in the README is to turn on Auto Save
in Visual Studio Code, which saves your code as you type. It's a generally nice feature once you get used to it, but especially nice with the vscode-go extension as you then get on-the-fly error reporting.
I hadn't see goflymake
before - but that looks like it might make it possible to do this without relying on build-on-save + auto-save. If that works well, I'd be open to moving error checking away from the 'on-save' hook and to an on-th-fly model that works even with auto-save turned off.
from vscode-go.
Basically what my sublime plugin does is run flymake when the file changes, and then not for a minimum of 5s (to balance responsiveness of the editor with getting error messages when typing). It works quite well. if you have questions or need help with the impl let me know.
from vscode-go.
Thanks @newhook. That sounds great.
BTW - Definitely also open to PRs for this if you are interested.
from vscode-go.
I've been working on this and have it basically working :) However, one thing i ran into with the latest master is that if have:
foo_test.go
and then type
package foo_test
this ends up creating a bunch of files
f.test
fo.test
foo.test
and so forth. Is this a known issue?
from vscode-go.
One other thought: With support for flymake it isn't necessary or even desirable to use auto-save any longer. In fact, I would recommend against it. This means that its easy then to support gofmt (or goimport or whatever) on save - #14
from vscode-go.
@newhook I haven't seen the first issue you mention. Could you open another issue to track this with details on how to repro it. From a quick test of what you mention I didn't see those files being generated.
On the second point I completely agree. I think doing both of these features together could make sense.
Feel free to open up a WIP PR when you have something working here.
from vscode-go.
Per gitter discussion, we'll go ahead and close this for now, since we're not ready to move over to a model where Go tools that need global understanding can operate on in-memory state yet.
We'll likely want to revisit this in the future.
from vscode-go.
Related Issues (20)
- go.formatFlags not working with gofmt -s (simplify) HOT 5
- 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.