Compare commits

...

2 commits

2 changed files with 9 additions and 3 deletions

View file

@ -11,8 +11,13 @@ local preview_location_callback = function(_, result)
end
local peek_definition = function()
local params = vim.lsp.util.make_position_params()
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
local bufnr = vim.api.nvim_get_current_buf()
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
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 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
vim.lsp.buf_request(bufnr, 'textDocument/codeAction', params, function(err, result, ctx, config)

View file

@ -21,6 +21,7 @@ local ts_langs = {
"toml" ,
"tsx" ,
"typescript",
"typst" ,
"verilog" ,
"vhdl" ,
"vim" ,