parent
5c00f581bf
commit
474e62d942
1 changed files with 8 additions and 3 deletions
|
@ -11,8 +11,13 @@ local preview_location_callback = function(_, result)
|
||||||
end
|
end
|
||||||
|
|
||||||
local peek_definition = function()
|
local peek_definition = function()
|
||||||
local params = vim.lsp.util.make_position_params()
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
|
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||||
|
|
||||||
|
if next(clients) then
|
||||||
|
local params = vim.lsp.util.make_position_params(0, clients[1].offset_encoding)
|
||||||
|
return vim.lsp.buf_request(bufnr, 'textDocument/definition', params, preview_location_callback)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local inlay_hint_toggle = function()
|
local inlay_hint_toggle = function()
|
||||||
|
@ -206,7 +211,7 @@ local on_attach = function(client_id, client, bufnr)
|
||||||
|
|
||||||
local lsp_diagnostics = vim.lsp.diagnostic.from(vim.diagnostic.get(bufnr, diag_opts))
|
local lsp_diagnostics = vim.lsp.diagnostic.from(vim.diagnostic.get(bufnr, diag_opts))
|
||||||
local context = { diagnostics = lsp_diagnostics }
|
local context = { diagnostics = lsp_diagnostics }
|
||||||
local params = lsp_util.make_range_params()
|
local params = lsp_util.make_range_params(0, client.offset_encoding)
|
||||||
params.context = context
|
params.context = context
|
||||||
|
|
||||||
vim.lsp.buf_request(bufnr, 'textDocument/codeAction', params, function(err, result, ctx, config)
|
vim.lsp.buf_request(bufnr, 'textDocument/codeAction', params, function(err, result, ctx, config)
|
||||||
|
|
Loading…
Reference in a new issue