atom / atom-languageclient

Language Server Protocol support for Atom (the basis of Atom-IDE)
https://ide.atom.io/
MIT License
388 stars 78 forks source link

Hook to server termination #248

Open laughedelic opened 5 years ago

laughedelic commented 5 years ago

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.

Aerijo commented 5 years ago

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

laughedelic commented 5 years ago

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

alexheretic commented 5 years ago

In ide-rust I used:

postInitialization(server) {
  ...
  server.process.on('exit', () => { ... })
}
UziTech commented 3 years ago

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.