diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-09 01:16:38 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-01-09 01:16:38 +0100 |
| commit | 5140a3ae419152735018c2b51887251cccf7a490 (patch) | |
| tree | 610ce77d4fabbbcd1b3a23e32d9c10c727db223a | |
| parent | 3aa233125a3e0a1f5f4de98a4987a032a3c04d68 (diff) | |
| download | vis-lspc-5140a3ae419152735018c2b51887251cccf7a490.tar.gz vis-lspc-5140a3ae419152735018c2b51887251cccf7a490.zip | |
add context parameter to textDocument/references call
Fixes !41.
| -rw-r--r-- | init.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1078,7 +1078,7 @@ end -- generic stub implementation for all textDocument methods taking -- a textDocumentPositionParams parameter -local function lspc_method_doc_pos(ls, method, win, argv) +local function lspc_method_doc_pos(ls, method, win, argv, additional_params) -- check if the language server has a provider for this method if not ls.capabilities[method .. 'Provider'] then return 'language server ' .. ls.name .. ' does not provide ' .. method @@ -1089,6 +1089,11 @@ local function lspc_method_doc_pos(ls, method, win, argv) end local params = vis_doc_pos_to_lsp(vis_get_doc_pos(win)) + if additional_params then + for k, v in pairs(additional_params) do + params[k] = v + end + end ls_call_text_document_method(ls, method, params, win, argv) end @@ -1107,7 +1112,8 @@ local lspc_goto_location_methods = { return lspc_method_doc_pos(ls, 'implementation', win, open_cmd) end, references = function(ls, win, open_cmd) - return lspc_method_doc_pos(ls, 'references', win, open_cmd) + return lspc_method_doc_pos(ls, 'references', win, open_cmd, + {context = {includeDeclaration = false}}) end, } |
