feat(neovim): update config

This commit is contained in:
Felix Schröter 2020-09-26 23:54:07 +02:00
parent 5e0b72ca74
commit 0a772c90b0
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
10 changed files with 251 additions and 215 deletions

View file

@ -0,0 +1,18 @@
-- extensions for lsp functionality
local function preview_location_callback(_, method, result)
if result == nil or vim.tbl_isempty(result) then
vim.lsp.log.info(method, 'No location found')
return nil
end
if vim.tbl_islist(result) then
vim.lsp.util.preview_location(result[1])
else
vim.lsp.util.preview_location(result)
end
end
function peek_definition()
local params = vim.lsp.util.make_position_params()
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
end