feat(neovim): update config
This commit is contained in:
parent
5e0b72ca74
commit
0a772c90b0
10 changed files with 251 additions and 215 deletions
18
home/editors/neovim/lsp/extensions.lua
Normal file
18
home/editors/neovim/lsp/extensions.lua
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue