Skip to content

Commit

Permalink
fix: attach to buffer when manually launching in single file mode (ne…
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlbach authored Dec 23, 2021
1 parent abb3706 commit 428f785
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/lspconfig/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ function configs.__newindex(t, config_name, config_def)
return
end
local pseudo_root = util.path.dirname(util.path.sanitize(bufname))
M.manager.add(pseudo_root, true)
local client_id = M.manager.add(pseudo_root, true)
vim.lsp.buf_attach_client(vim.api.nvim_get_current_buf(), client_id)
else
vim.notify(
string.format('[lspconfig] Autostart for %s failed: matching root directory not detected.', config_name)
Expand Down

0 comments on commit 428f785

Please sign in to comment.