diff options
| author | Iron_E <code.iron.e@gmail.com> | 2020-11-13 14:15:44 -0500 |
|---|---|---|
| committer | Iron_E <code.iron.e@gmail.com> | 2020-11-15 02:21:45 -0500 |
| commit | 584746a62a38b9a220f5e6e5bd5330abd6f75d9c (patch) | |
| tree | 56e8ed64b84fa47ef2bcc5d1c33dd3da192ef628 /lua/lspconfig/configs.lua | |
| parent | Use handlers instead of callbacks (diff) | |
| download | nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.tar nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.tar.gz nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.tar.bz2 nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.tar.lz nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.tar.xz nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.tar.zst nvim-lspconfig-584746a62a38b9a220f5e6e5bd5330abd6f75d9c.zip | |
Change the rest of the callback usages
Diffstat (limited to 'lua/lspconfig/configs.lua')
| -rw-r--r-- | lua/lspconfig/configs.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua index 16ef9949..364f9195 100644 --- a/lua/lspconfig/configs.lua +++ b/lua/lspconfig/configs.lua @@ -33,26 +33,26 @@ function configs.__newindex(t, config_name, config_def) -- The config here is the one which will be instantiated for the new server, -- which is why this is a function, so that it can refer to the settings -- object on the server. - local function add_callbacks(config) - config.callbacks["window/logMessage"] = function(err, method, params, client_id) + local function add_handlers(config) + config.handlers["window/logMessage"] = function(err, method, params, client_id) if params and params.type <= config.log_level then -- TODO(ashkan) remove this after things have settled. - assert(lsp.callbacks, "Update to Nvim HEAD. This is an incompatible interface.") - assert(lsp.callbacks["window/logMessage"], "Callback for window/logMessage notification is not defined") - lsp.callbacks["window/logMessage"](err, method, params, client_id) + assert(lsp.handlers, "Update to Nvim HEAD. This is an incompatible interface.") + assert(lsp.handlers["window/logMessage"], "Callback for window/logMessage notification is not defined") + lsp.handlers["window/logMessage"](err, method, params, client_id) end end - config.callbacks["window/showMessage"] = function(err, method, params, client_id) + config.handlers["window/showMessage"] = function(err, method, params, client_id) if params and params.type <= config.message_level then -- TODO(ashkan) remove this after things have settled. - assert(lsp.callbacks and lsp.callbacks[method], "Update to Nvim HEAD. This is an incompatible interface.") - assert(lsp.callbacks["window/showMessage"], "Callback for window/showMessage notification is not defined") - lsp.callbacks["window/showMessage"](err, method, params, client_id) + assert(lsp.handlers and lsp.handlers[method], "Update to Nvim HEAD. This is an incompatible interface.") + assert(lsp.handlers["window/showMessage"], "Callback for window/showMessage notification is not defined") + lsp.handlers["window/showMessage"](err, method, params, client_id) end end - config.callbacks["workspace/configuration"] = function(err, method, params, client_id) + config.handlers["workspace/configuration"] = function(err, method, params, client_id) if err then error(tostring(err)) end if not params.items then return {} @@ -124,7 +124,7 @@ function configs.__newindex(t, config_name, config_def) } }) - add_callbacks(new_config) + add_handlers(new_config) if config_def.on_new_config then pcall(config_def.on_new_config, new_config, _root_dir) end |
