aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorHirokazu Hata <h.hata.ai.t@gmail.com>2020-03-23 12:06:03 +0900
committerHirokazu Hata <h.hata.ai.t@gmail.com>2020-03-24 09:55:48 +0900
commit6e21704786f0c5cf44074c902f5472fc4caa7a1f (patch)
tree7fb6247d62c107ed00196cad85b78c10274a29a4 /lua
parentMerge pull request #176 from lithammer/bashls-root-dir (diff)
downloadnvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.tar
nvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.tar.gz
nvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.tar.bz2
nvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.tar.lz
nvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.tar.xz
nvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.tar.zst
nvim-lspconfig-6e21704786f0c5cf44074c902f5472fc4caa7a1f.zip
if root_dir is not directry, we don't execute lsp.start_client
fix: #161. If the buffer is not actual file like the special buffer for the plugin, it doesn't have root_dir and we should not execute lsp.start_client for that buffer.
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim_lsp/configs.lua1
-rw-r--r--lua/nvim_lsp/util.lua1
2 files changed, 1 insertions, 1 deletions
diff --git a/lua/nvim_lsp/configs.lua b/lua/nvim_lsp/configs.lua
index 1ee1a744..e1145147 100644
--- a/lua/nvim_lsp/configs.lua
+++ b/lua/nvim_lsp/configs.lua
@@ -162,7 +162,6 @@ function configs.__newindex(t, config_name, config_def)
function manager.try_add()
local root_dir = get_root_dir(api.nvim_buf_get_name(0), api.nvim_get_current_buf())
- if not root_dir then return end
local id = manager.add(root_dir)
if id then
lsp.buf_attach_client(0, id)
diff --git a/lua/nvim_lsp/util.lua b/lua/nvim_lsp/util.lua
index 33eff0c9..ab084ea4 100644
--- a/lua/nvim_lsp/util.lua
+++ b/lua/nvim_lsp/util.lua
@@ -231,6 +231,7 @@ function M.server_per_root_dir_manager(_make_config)
function manager.add(root_dir)
if not root_dir then return end
+ if not M.path.is_dir(root_dir) then return end
-- Check if we have a client alredy or start and store it.
local client_id = clients[root_dir]