From 5ff1faa34487c6ea373695b442192f76f4b7ac6f Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 21 Sep 2024 21:25:51 -0700 Subject: [PATCH] Some LSP servers return null for the codeLensProvider capability --- autoload/lsp/capabilities.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/lsp/capabilities.vim b/autoload/lsp/capabilities.vim index 46f59739..71edc6e0 100644 --- a/autoload/lsp/capabilities.vim +++ b/autoload/lsp/capabilities.vim @@ -229,8 +229,10 @@ export def ProcessServerCaps(lspserver: dict, caps: dict) # codeLensProvider if lspserver.caps->has_key('codeLensProvider') lspserver.isCodeLensProvider = true - if lspserver.caps.codeLensProvider->has_key('resolveProvider') - lspserver.isCodeLensResolveProvider = true + var codeLensProvider = lspserver.caps.codeLensProvider + if codeLensProvider->type() == v:t_dict + && codeLensProvider->has_key('resolveProvider') + lspserver.isCodeLensResolveProvider = codeLensProvider.resolveProvider else lspserver.isCodeLensResolveProvider = false endif