aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-02-20 14:13:04 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2022-02-20 14:15:57 +0100
commit47b7b1e47bb10183f5b4ee84d90b4e3eefabe75c (patch)
tree8602de288016435f3de6b29ea758923d26c4ef7a
parent16f70ee02942e489fdf383c71d1439912ab6a008 (diff)
downloadvis-lspc-47b7b1e47bb10183f5b4ee84d90b4e3eefabe75c.tar.gz
vis-lspc-47b7b1e47bb10183f5b4ee84d90b4e3eefabe75c.zip
send clientCapabilities
Be nicer to the language servers by providing our capabilities so maybe we get more deterministic results. We do not support dynamicRegistration, markdown or workDoneProgress.
-rw-r--r--README.md2
-rw-r--r--init.lua43
2 files changed, 39 insertions, 6 deletions
diff --git a/README.md b/README.md
index b0b3539..b700bb8 100644
--- a/README.md
+++ b/README.md
@@ -27,8 +27,6 @@ A dirty workaround we currently use is to send the whole file content in a `text
method call before calling any other method.
If someone can come up with an idea how to solve this I would appreciate contributions.
-We never send any client capabilities.
-
Communicating with language-servers via other channels than stdin/stdout.
Currently only clangd, pylsp and lua-language-server are configured by default and somewhat tested.
diff --git a/init.lua b/init.lua
index a063ac2..840fb38 100644
--- a/init.lua
+++ b/init.lua
@@ -170,10 +170,45 @@ do
end
assert(vis_pid)
--- our capabilities we tell the language server when calling "initialize"
-local client_capabilites = {}
-client_capabilites.workspace = {}
-client_capabilites.workspace.configuration = false
+--
+--- ClientCapabilities we tell the language server when calling "initialize"
+--
+local supported_markup_kind = {'plaintext'}
+
+local goto_methods_capabilities = {
+ linkSupport = true,
+ dynamicRegistration = false,
+}
+
+local client_capabilites = {
+ workspace = {configuration = false},
+ textDocument = {
+ synchronization = {dynamicRegistration = false, didSave = true},
+ -- ask the server to send us only plaintext completionItems
+ completion = {
+ dynamicRegistration = false,
+ completionItem = {documentationFormat = supported_markup_kind},
+ },
+ -- ask the server to send us only plaintext hover results
+ hover = {dynamicRegistration = false, contentFormat = supported_markup_kind},
+ -- ask the server to send us only plaintext signatureHelp results
+ signatureHelp = {
+ dynamicRegistration = false,
+ signatureInformation = {documentationFormat = supported_markup_kind},
+ },
+ declaration = {dynamicRegistration = false, linkSupport = true},
+ definition = goto_methods_capabilities,
+ typeDefinition = goto_methods_capabilities,
+ implementation = goto_methods_capabilities,
+ references = {dynamicRegistration = false},
+ rename = {
+ dynamicRegistration = false,
+ prepareSupport = false,
+ honorsChangeAnnotations = false,
+ },
+ },
+ window = {workDoneProgress = false, showDocument = {support = false}},
+}
-- check if fzf is available and use fzf instead of vis-menu per default
if os.execute('type fzf >/dev/null 2>/dev/null') then