aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-08-24 08:27:41 -0400
committerGitHub <noreply@github.com>2021-08-24 08:27:41 -0400
commitbdf3dcdfb935c498e718f32b11e7f65822640433 (patch)
treecfdf8a893f341f6e6ac72b1196c815e258a58288 /lua
parent[docgen] Update README.md (diff)
downloadnvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.tar
nvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.tar.gz
nvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.tar.bz2
nvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.tar.lz
nvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.tar.xz
nvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.tar.zst
nvim-lspconfig-bdf3dcdfb935c498e718f32b11e7f65822640433.zip
fix: unsilent autocmd to print warning (#1171)
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/configs.lua6
-rw-r--r--lua/lspconfig/util.lua5
2 files changed, 5 insertions, 6 deletions
diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua
index 07f940f9..cdd92424 100644
--- a/lua/lspconfig/configs.lua
+++ b/lua/lspconfig/configs.lua
@@ -61,7 +61,9 @@ function configs.__newindex(t, config_name, config_def)
trigger = 'BufReadPost *'
end
if not (config.autostart == false) then
- api.nvim_command(string.format("autocmd %s lua require'lspconfig'[%q].manager.try_add()", trigger, config.name))
+ api.nvim_command(
+ string.format("autocmd %s unsilent lua require'lspconfig'[%q].manager.try_add()", trigger, config.name)
+ )
end
local get_root_dir = config.root_dir
@@ -74,7 +76,7 @@ function configs.__newindex(t, config_name, config_def)
end
api.nvim_command(
string.format(
- "autocmd %s lua require'lspconfig'[%q].manager.try_add_wrapper()",
+ "autocmd %s unsilent lua require'lspconfig'[%q].manager.try_add_wrapper()",
'BufReadPost ' .. root_dir .. '/*',
config.name
)
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 8d60dc12..335e0781 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -230,13 +230,10 @@ function M.server_per_root_dir_manager(_make_config)
if new_config.enabled == false then
return
end
- --TODO:mjlbach -- these prints only show up with nvim_error_writeln()
if not new_config.cmd then
print(
string.format(
- 'Error, cmd not defined for [%q].'
- .. 'You must manually define a cmd for the default config for this server.'
- .. 'See server documentation.',
+ 'Error: cmd not defined for %q. You must manually set cmd in the setup{} call according to CONFIG.md.',
new_config.name
)
)