Giter VIP home page Giter VIP logo

Comments (7)

lukehoban avatar lukehoban commented on July 22, 2024

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.

newhook avatar newhook commented on July 22, 2024

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.

lukehoban avatar lukehoban commented on July 22, 2024

Thanks @newhook. That sounds great.

BTW - Definitely also open to PRs for this if you are interested.

from vscode-go.

newhook avatar newhook commented on July 22, 2024

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.

newhook avatar newhook commented on July 22, 2024

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.

lukehoban avatar lukehoban commented on July 22, 2024

@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.

lukehoban avatar lukehoban commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.