From 40c0bdce99d5eb94c2968baf8c53a72e8022d082 Mon Sep 17 00:00:00 2001 From: lidulibai Date: Tue, 4 Oct 2022 17:31:58 +0800 Subject: [PATCH] Fix when capabilities was not provided. capabilities is optional --- lua/jdtls/setup.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/jdtls/setup.lua b/lua/jdtls/setup.lua index 45816af..1c6bb91 100644 --- a/lua/jdtls/setup.lua +++ b/lua/jdtls/setup.lua @@ -236,7 +236,7 @@ function M.start_or_attach(config) config.handlers['language/progressReport'] = config.handlers['language/progressReport'] or progress_report config.handlers['language/status'] = config.handlers['language/status'] or status_callback config.handlers['workspace/configuration'] = config.handlers['workspace/configuration'] or configuration_handler - local capabilities = vim.tbl_deep_extend('keep', config.capabilities, lsp.protocol.make_client_capabilities()) + local capabilities = vim.tbl_deep_extend('keep', config.capabilities or {}, lsp.protocol.make_client_capabilities()) local extra_capabilities = { textDocument = { codeAction = {