Skip to content

Commit ea352dd

Browse files
committed
fix: do not check if sessions is pending after resolving it
1 parent f6162c8 commit ea352dd

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

lua/powershell/lsp.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ M.initialize_or_attach = function(buf)
236236
local config = require("powershell.config").config
237237
local root_dir = config.root_dir(buf)
238238

239+
local session_details = all_session_details[root_dir]
240+
if session_details then
241+
local lsp_config = get_lsp_config(buf, session_details)
242+
if not lsp_config then return end
243+
local client = vim.lsp.start(lsp_config, { bufnr = buf })
244+
util.clients_id[buf] = client
245+
return
246+
end
247+
239248
if not is_pending[root_dir] then
240249
is_pending[root_dir] = true
241250
else
@@ -253,15 +262,6 @@ M.initialize_or_attach = function(buf)
253262
return
254263
end
255264

256-
local session_details = all_session_details[root_dir]
257-
if session_details then
258-
local lsp_config = get_lsp_config(buf, session_details)
259-
if not lsp_config then return end
260-
local client = vim.lsp.start(lsp_config, { bufnr = buf })
261-
util.clients_id[buf] = client
262-
return
263-
end
264-
265265
local client_id = util.clients_id[buf]
266266
assert(not client_id)
267267
local term_buf = api.nvim_create_buf(false, false)

0 commit comments

Comments
 (0)