Skip to content

Commit

Permalink
fix(lightbulb): wrong lnum in get
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Aug 4, 2024
1 parent 2303d67 commit a751b92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/lspsaga/codeaction/lightbulb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ local function diagnostic_vim_to_lsp(diagnostics)
return {
range = {
start = {
line = diagnostic.lnum,
line = diagnostic.lnum + 1,
character = diagnostic.col,
},
['end'] = {
line = diagnostic.end_lnum,
line = diagnostic.end_lnum + 1,
character = diagnostic.end_col,
},
},
Expand All @@ -108,7 +108,7 @@ local function render(bufnr)
local row = api.nvim_win_get_cursor(0)[1] - 1
local params = lsp.util.make_range_params()
params.context = {
diagnostics = diagnostic_vim_to_lsp(vim.diagnostic.get(bufnr, { lnum = row + 1 })),
diagnostics = diagnostic_vim_to_lsp(vim.diagnostic.get(bufnr, { lnum = row })),
}

lsp.buf_request(bufnr, 'textDocument/codeAction', params, function(_, result, _)
Expand Down

0 comments on commit a751b92

Please sign in to comment.