atom-languageclient icon indicating copy to clipboard operation
atom-languageclient copied to clipboard

Hook to server termination

Open laughedelic opened this issue 6 years ago • 4 comments
trafficstars

There are methods like preInitialization and postInitialization, but I don't see any way to hook to the shutdown routine and perform some cleanup actions. I see exitCleanup method, but it's private.

laughedelic avatar Dec 02 '18 20:12 laughedelic

@laughedelic Would this be when the server is intentionally closed, or if it crashes and is restarted as well?

Aerijo avatar Mar 06 '19 09:03 Aerijo

@Aerijo when it's intentionally closed (which also covers restart).

My use case was that I create a status bar element to show some info from the server and when the server terminates I want to remove this element to avoid showing an outdated state. Otherwise it just gets stuck there.

laughedelic avatar Mar 06 '19 13:03 laughedelic

In ide-rust I used:

postInitialization(server) {
  ...
  server.process.on('exit', () => { ... })
}

alexheretic avatar Jun 30 '19 08:06 alexheretic

Development of atom-languageclient has officially moved to https://github.com/atom-ide-community/atom-languageclient 🎉

If this is still an issue please consider opening an issue on that repo.

UziTech avatar Oct 19 '20 19:10 UziTech