Skip to content

Commit

Permalink
refactor: migrate deprecated get_line_diagnostics to vim.diagnostic.get
Browse files Browse the repository at this point in the history
Replaced `vim.lsp.diagnostic.get_line_diagnostics` with `vim.diagnostic.get`
to align with the updated Neovim API.
  • Loading branch information
radwo authored and deathbeam committed Oct 25, 2024
1 parent 9333944 commit 862e031
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/CopilotChat/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function M.help_actions(config)
local bufnr = vim.api.nvim_get_current_buf()
local winnr = vim.api.nvim_get_current_win()
local cursor = vim.api.nvim_win_get_cursor(winnr)
local line_diagnostics = vim.lsp.diagnostic.get_line_diagnostics(bufnr, cursor[1] - 1)
local line_diagnostics = vim.diagnostic.get(bufnr, { lnum = cursor[1] - 1 })

if #line_diagnostics == 0 then
return nil
Expand Down
2 changes: 1 addition & 1 deletion lua/CopilotChat/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function M.diagnostics(source)
end

local cursor = vim.api.nvim_win_get_cursor(winnr)
local line_diagnostics = vim.lsp.diagnostic.get_line_diagnostics(bufnr, cursor[1] - 1)
local line_diagnostics = vim.diagnostic.get(bufnr, { lnum = cursor[1] - 1 })

if #line_diagnostics == 0 then
return nil
Expand Down

0 comments on commit 862e031

Please sign in to comment.