Skip to content

Commit

Permalink
Do not stop LSP clients on session switch
Browse files Browse the repository at this point in the history
It doesn't work with some LSP servers and machines, see #52.
  • Loading branch information
Shatur committed Sep 21, 2022
1 parent 3f5781b commit 17097e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ require('session_manager').setup({
},
autosave_only_in_session = false, -- Always autosaves session. If true, only autosaves after a session is active.
max_path_length = 80, -- Shorten the display path if length exceeds this threshold. Use 0 if don't want to shorten the path at all.
stop_lsp_on_session_load = true, -- Stop LSP servers after loading a session.
})
```

Expand Down
1 change: 0 additions & 1 deletion lua/session_manager/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ config.defaults = {
},
autosave_only_in_session = false,
max_path_length = 80,
stop_lsp_on_session_load = true,
}

setmetatable(config, { __index = config.defaults })
Expand Down
4 changes: 0 additions & 4 deletions lua/session_manager/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ function utils.load_session(filename, discard_current)

-- Scedule buffers cleanup to avoid callback issues and source the session.
vim.schedule(function()
-- Stop all LSP clients first.
if config.stop_lsp_on_session_load then
vim.lsp.stop_client(vim.lsp.get_active_clients())
end
-- Delete all buffers first except the current one to avoid entering buffers scheduled for deletion.
local current_buffer = vim.api.nvim_get_current_buf()
for _, buffer in ipairs(vim.api.nvim_list_bufs()) do
Expand Down

0 comments on commit 17097e0

Please sign in to comment.