From c807b00f6c9f05fbaeffe4eecfa4d3a1f0a775cf Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sun, 20 Dec 2020 14:36:41 -0800 Subject: Add catch-all callback for client/registerCapability --- lua/lspconfig/configs.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lua/lspconfig/configs.lua') diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua index 1a844c85..d1b0090d 100644 --- a/lua/lspconfig/configs.lua +++ b/lua/lspconfig/configs.lua @@ -1,3 +1,4 @@ +local log = require 'vim.lsp.log' local util = require 'lspconfig/util' local api, validate, lsp = vim.api, vim.validate, vim.lsp local tbl_extend = vim.tbl_extend @@ -51,6 +52,18 @@ function configs.__newindex(t, config_name, config_def) end end + -- pyright and jdtls ignore dynamicRegistration settings and sent client/registerCapability handler which are unhandled + config.handlers['client/registerCapability'] = function(_, _, _, _) + log.warn(string.format( [[ + The language server %s incorrectly triggers a registerCapability handler + despite dynamicRegistration set to false. Please report upstream. + ]] , config.name)) + return { + result = nil; + error = nil; + } + end + config.handlers["workspace/configuration"] = function(err, method, params, client_id) if err then error(tostring(err)) end if not params.items then -- cgit v1.2.3-70-g09d2