diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim_lsp/configs.lua | 8 | ||||
| -rw-r--r-- | lua/nvim_lsp/rust_analyzer.lua | 1 | ||||
| -rw-r--r-- | lua/nvim_lsp/util.lua | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/lua/nvim_lsp/configs.lua b/lua/nvim_lsp/configs.lua index 477eb6a3..b2105b75 100644 --- a/lua/nvim_lsp/configs.lua +++ b/lua/nvim_lsp/configs.lua @@ -26,7 +26,7 @@ function configs.__newindex(t, config_name, config_def) local default_config = tbl_extend("keep", config_def.default_config, { log_level = lsp.protocol.MessageType.Warning; - settings = {}; + settings = vim.empty_dict(); init_options = vim.empty_dict(); callbacks = {}; }) @@ -95,7 +95,7 @@ function configs.__newindex(t, config_name, config_def) end local make_config = function(_root_dir) - local new_config = vim.tbl_extend("keep", {}, config) + local new_config = vim.tbl_extend("keep", vim.empty_dict(), config) -- Deepcopy anything that is >1 level nested. new_config.settings = vim.deepcopy(new_config.settings) util.tbl_deep_extend(new_config.settings, default_config.settings) @@ -153,8 +153,8 @@ function configs.__newindex(t, config_name, config_def) end local manager = util.server_per_root_dir_manager(function(_root_dir) - return make_config(_root_dir) - end) + return make_config(_root_dir) + end) function manager.try_add() local root_dir = get_root_dir(api.nvim_buf_get_name(0), api.nvim_get_current_buf()) diff --git a/lua/nvim_lsp/rust_analyzer.lua b/lua/nvim_lsp/rust_analyzer.lua index 33e600b7..ff730d9e 100644 --- a/lua/nvim_lsp/rust_analyzer.lua +++ b/lua/nvim_lsp/rust_analyzer.lua @@ -8,7 +8,6 @@ configs.rust_analyzer = { filetypes = {"rust"}; root_dir = util.root_pattern("Cargo.toml"); log_level = lsp.protocol.MessageType.Warning; - settings = {}; }; docs = { package_json = "https://github.com/rust-analyzer/rust-analyzer/raw/master/editors/code/package.json"; diff --git a/lua/nvim_lsp/util.lua b/lua/nvim_lsp/util.lua index 02061976..433bcab2 100644 --- a/lua/nvim_lsp/util.lua +++ b/lua/nvim_lsp/util.lua @@ -45,7 +45,7 @@ function M.tbl_deep_extend(dst, ...) validate { arg = { t, 't' } } for k, v in pairs(t) do if type(v) == 'table' and not vim.tbl_islist(v) then - dst[k] = M.tbl_deep_extend(dst[k] or {}, v) + dst[k] = M.tbl_deep_extend(dst[k] or vim.empty_dict(), v) else dst[k] = v end |
