aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2021-01-18 19:33:10 +0100
committerGitHub <noreply@github.com>2021-01-18 19:33:10 +0100
commit3f63100d5bc3bcaddccef4e5f95af9ea5cff1cc3 (patch)
tree25d275035f01286e6c191c95d8ce8856b12b1d88 /runtime/lua/vim/lsp.lua
parent51936126d3281231ec8f971ebefd82a95f8dc0e6 (diff)
downloadrneovim-3f63100d5bc3bcaddccef4e5f95af9ea5cff1cc3.tar.gz
rneovim-3f63100d5bc3bcaddccef4e5f95af9ea5cff1cc3.tar.bz2
rneovim-3f63100d5bc3bcaddccef4e5f95af9ea5cff1cc3.zip
LSP: Fix nil settings handling in workspace/configuration (#13708)
The `workspace/configuration` handler could fail with the following error if `config.settings` is nil: runtime/lua/vim/lsp/util.lua:1432: attempt to index local 'settings' (a nil value)" This ensures that `config.settings` is always initialized to an empty table.
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 9e05eeae89..27fc4a2ab5 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -229,6 +229,7 @@ local function validate_client_config(config)
before_init = { config.before_init, "f", true };
offset_encoding = { config.offset_encoding, "s", true };
flags = { config.flags, "t", true };
+ settings = { config.settings, "t", true };
}
-- TODO(remove-callbacks)
@@ -458,6 +459,7 @@ function lsp.start_client(config)
local cmd, cmd_args, offset_encoding = cleaned_config.cmd, cleaned_config.cmd_args, cleaned_config.offset_encoding
config.flags = config.flags or {}
+ config.settings = config.settings or {}
local client_id = next_client_id()