diff options
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -362,14 +362,13 @@ local function lspc_select(choices) local cmd = 'printf "' .. menu_input .. '" | ' .. lspc.menu_cmd lspc.log('collect choice using: ' .. cmd) - if lspc.menu_cmd == 'vis-menu' then + if lspc.menu_cmd:sub(0, 8) == 'vis-menu' then status, output = vis:pipe(vis.win.file, {start = 0, finish = 0}, cmd) else local menu = io.popen(cmd) output = menu:read('*a') local _, _, _status = menu:close() status = _status - end local choice = nil @@ -1078,7 +1077,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 +1088,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 +1111,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, } |
