aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-09-14 10:55:32 +0200
committerGitHub <noreply@github.com>2022-09-14 16:55:32 +0800
commit6947a178741acef867872c367fec7f1ee55f09eb (patch)
treef48f4f112b344ba21dac40d4e88c7c728de87f4d /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.tar
nvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.tar.gz
nvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.tar.bz2
nvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.tar.lz
nvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.tar.xz
nvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.tar.zst
nvim-lspconfig-6947a178741acef867872c367fec7f1ee55f09eb.zip
fix(lspinfo): nil-check config.get_root_dir (#2137)
This is currently causing an error when opening the :LspInfo window while having a server configuration that doesn't provide a root_dir. awk_ls is an example of such a config (it only supports single file mode).
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/ui/lspinfo.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/lspconfig/ui/lspinfo.lua b/lua/lspconfig/ui/lspinfo.lua
index 4ab5e236..2ece965c 100644
--- a/lua/lspconfig/ui/lspinfo.lua
+++ b/lua/lspconfig/ui/lspinfo.lua
@@ -55,7 +55,7 @@ local function make_config_info(config, bufnr)
local buffer_dir = api.nvim_buf_call(bufnr, function()
return vim.fn.expand '%:p:h'
end)
- local root_dir = config.get_root_dir(buffer_dir)
+ local root_dir = config.get_root_dir and config.get_root_dir(buffer_dir)
if root_dir then
config_info.root_dir = root_dir
else