From bdf3dcdfb935c498e718f32b11e7f65822640433 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Tue, 24 Aug 2021 08:27:41 -0400 Subject: fix: unsilent autocmd to print warning (#1171) --- lua/lspconfig/configs.lua | 6 ++++-- lua/lspconfig/util.lua | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'lua') 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 ) ) -- cgit v1.2.3-70-g09d2