Giter VIP home page Giter VIP logo

Comments (9)

lukehoban avatar lukehoban commented on July 22, 2024

Yes - we should be invoking gocode close when the extension is deactivated to try and stop the gocode deamon.

from vscode-go.

egamma avatar egamma commented on July 22, 2024

just a heads-up, in 0.10.1 a deactivate() function for cleaning-up isn't supported yet.

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

Thanks @egamma - is there an issue already tracking this that we can link here?

I think that means we can't really fix this for now. Will keep this active waiting for the deactivate call to be added in Code.

from vscode-go.

egamma avatar egamma commented on July 22, 2024

you could listen on the 'exit' event of the extension host process.

process.on('exit', function(code) {

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

@egamma Unfortunately it doesn't look like that will work - shutting down gocode requires shelling out to gocode close and I'm not seeing that run inside the 'exit' handler. The node.js docs say that you cannot do async work in this handler, which is likely the reason this isn't working?

There is no way to prevent the exiting of the event loop at this point, and once all exit listeners have finished running the process will exit. Therefore you must only perform synchronous operations in this handler.

from vscode-go.

egamma avatar egamma commented on July 22, 2024

never tried this, but could spawning another process that runs gocode close work? There is a sync function to spawn a process: childProcess.execSync.

from vscode-go.

lukehoban avatar lukehoban commented on July 22, 2024

I tried that, and it doesn't seem to work either. I also tried just doing a fs.writeFileSync and even that's not working.

from vscode-go.

ramya-rao-a avatar ramya-rao-a commented on July 22, 2024

@lukehoban Correct me if I am wrong, but since gocode is a daemon, if it was already running (say the user was using it independent of VS Code), then VS Code wouldn't start a new process. In this case, closing it when the editor closes wouldnt be the right thing to do.

from vscode-go.

ramya-rao-a avatar ramya-rao-a commented on July 22, 2024

Closing this issue as a "won't fix" because of #26 (comment)

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.