-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] LSPs do not stop when switching session to another project #208
Comments
After enabling this plugin, I've noticed that LSPs also do not start after a session is loaded. I've tried using the post_restore_cmds to run |
@adaviloper that would be something with your configuration specifically. In my config the lsp starts normally after the session is loaded. |
I get the same behavior FYI. Not sure how to track it down really. |
Hmm. Setting this seems to fix it:
|
@rmagatti we could do something like the following in local clients = vim.lsp.get_clients()
if #clients > 0 then vim.lsp.stop_client(clients) end the only downside is that do you think it's worth the trouble? |
It might be worthwhile having something like this behind a default Something that comes to mind is that not everyone uses vim builtin lsp, which means this config would benefit from being a |
Fix: #208 stop LSs when restoring session
If you want to stop previous language servers when restoring another session add |
Is your feature request related to a problem? Please describe.
When switching from a lua project to a typescript project for example, then running
LspInfo
we can see bothtsserver
andlua_ls
active. This isn't really a session concern theoretically, maybe I can implement this feature with the hooks feature, but since LSPs are built-into Neovim, it may make sense to have some support within auto-session.I worry how much this crosses into "project management" or "specific plugin" territory, but still worth considering.
Describe the solution you'd like
That LSPs for the previously loaded session gets shut down just like buffers from a previously loaded sessions do when switching sessions.
Describe alternatives you've considered
Using pre and or post hooks to explicitly call to shutdown lsp servers before a next load of a session happens.
Additional context
N/A
The text was updated successfully, but these errors were encountered: