fix(lsp): handlers should focus quickfix list

This commit is contained in:
Michael Lingelbach 2021-06-21 20:44:37 -07:00
parent b585f723bc
commit 060255253f

View File

@ -196,7 +196,6 @@ M['textDocument/references'] = function(_, _, result)
if not result then return end if not result then return end
util.set_qflist(util.locations_to_items(result)) util.set_qflist(util.locations_to_items(result))
api.nvim_command("copen") api.nvim_command("copen")
api.nvim_command("wincmd p")
end end
--@private --@private
@ -211,7 +210,6 @@ local symbol_handler = function(_, _, result, _, bufnr)
util.set_qflist(util.symbols_to_items(result, bufnr)) util.set_qflist(util.symbols_to_items(result, bufnr))
api.nvim_command("copen") api.nvim_command("copen")
api.nvim_command("wincmd p")
end end
--@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol --@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol
M['textDocument/documentSymbol'] = symbol_handler M['textDocument/documentSymbol'] = symbol_handler
@ -302,7 +300,6 @@ local function location_handler(_, method, result)
if #result > 1 then if #result > 1 then
util.set_qflist(util.locations_to_items(result)) util.set_qflist(util.locations_to_items(result))
api.nvim_command("copen") api.nvim_command("copen")
api.nvim_command("wincmd p")
end end
else else
util.jump_to_location(result) util.jump_to_location(result)
@ -383,7 +380,6 @@ local make_call_hierarchy_handler = function(direction)
end end
util.set_qflist(items) util.set_qflist(items)
api.nvim_command("copen") api.nvim_command("copen")
api.nvim_command("wincmd p")
end end
end end