From 862e0313e37b5c09abcab8caeab8d499c7196941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Wo=C5=BAniak?= <184065+radwo@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:54:22 +0200 Subject: [PATCH] refactor: migrate deprecated get_line_diagnostics to vim.diagnostic.get Replaced `vim.lsp.diagnostic.get_line_diagnostics` with `vim.diagnostic.get` to align with the updated Neovim API. --- lua/CopilotChat/actions.lua | 2 +- lua/CopilotChat/select.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/CopilotChat/actions.lua b/lua/CopilotChat/actions.lua index f321ea0d..763cf8d1 100644 --- a/lua/CopilotChat/actions.lua +++ b/lua/CopilotChat/actions.lua @@ -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 diff --git a/lua/CopilotChat/select.lua b/lua/CopilotChat/select.lua index 7d42df7b..29ea6bf3 100644 --- a/lua/CopilotChat/select.lua +++ b/lua/CopilotChat/select.lua @@ -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