aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorGregory Anders <greg@gpanders.com>2021-07-26 12:39:50 -0600
committerGitHub <noreply@github.com>2021-07-26 11:39:50 -0700
commit3e00d4f01cebedb758050e2e3faf065036fcfdc2 (patch)
tree8bd7eb8c163bd7897bb1225b509289ff8fc33559 /runtime/doc
parentb8813bacfe7888c9c1b40ce27f414bb868d449be (diff)
downloadrneovim-3e00d4f01cebedb758050e2e3faf065036fcfdc2.tar.gz
rneovim-3e00d4f01cebedb758050e2e3faf065036fcfdc2.tar.bz2
rneovim-3e00d4f01cebedb758050e2e3faf065036fcfdc2.zip
feat(lsp): make list handlers configurable (#15199)
The handlers for textDocument/references, textDocument/documentSymbol, and workspace/symbol open their results in the quickfix list by default and are not configurable. They are also incompatible with `vim.lsp.with` as they do not accept a configuration parameter. Add a `config` parameter to the handler for these three messages which allows them to be configured with `vim.lsp.with`. Additionally, add a new configuration option 'loclist' that, when true, causes these handlers to open their results in the location list rather than the quickfix list.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lsp.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index a15c74d148..5a27e195bc 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -322,6 +322,18 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
}
}
<
+ Some handlers do not have an explicitly named handler function (such as
+ |on_publish_diagnostics()|). To override these, first create a reference
+ to the existing handler: >
+
+ local on_references = vim.lsp.handlers["textDocument/references"]
+ vim.lsp.handlers["textDocument/references"] = vim.lsp.with(
+ on_references, {
+ -- Use location list instead of quickfix list
+ loclist = true,
+ }
+ )
+<
*lsp-handler-resolution*
Handlers can be set by: