diff options
| author | Jason Cheatham <jason@jasoncheatham.com> | 2021-10-09 13:41:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-09 10:41:01 -0700 |
| commit | e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6 (patch) | |
| tree | 1a63d0325a34660f96adb71269f14481f7de61ed /lua | |
| parent | fix(checkhealth): rename check_health to check (#1296) (diff) | |
| download | nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.tar nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.tar.gz nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.tar.bz2 nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.tar.lz nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.tar.xz nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.tar.zst nvim-lspconfig-e609a702eaf2d6bfb1e0fe8c44a5bf84436fb5a6.zip | |
fix(denols): update handlers to support 0.5.1 signature (#1233)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/denols.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lua/lspconfig/denols.lua b/lua/lspconfig/denols.lua index d8645c42..d16f3b3c 100644 --- a/lua/lspconfig/denols.lua +++ b/lua/lspconfig/denols.lua @@ -65,7 +65,7 @@ local function virtual_text_document(uri) virtual_text_document_handler(uri, result) end -local function denols_handler(err, method, result) +local function denols_handler(err, result, ctx) if not result or vim.tbl_isempty(result) then return nil end @@ -79,7 +79,13 @@ local function denols_handler(err, method, result) end end - lsp.handlers[method](err, method, result) + -- TODO remove this conditional when the handler is no longer being wrapped + -- with util.compat_handler (just use the else clause) + if vim.fn.has 'nvim-0.5.1' then + lsp.handlers[ctx.method](err, result, ctx) + else + lsp.handlers[ctx.method](err, ctx.method, result) + end end local function denols_definition() @@ -117,8 +123,8 @@ configs[server_name] = { unstable = false, }, handlers = { - ['textDocument/definition'] = denols_handler, - ['textDocument/references'] = denols_handler, + ['textDocument/definition'] = util.compat_handler(denols_handler), + ['textDocument/references'] = util.compat_handler(denols_handler), }, }, commands = { |
