-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lsp): update deprecated API calls (#514)
- Loading branch information
Showing
3 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
---@mod rustaceanvim.compat compativility layer for | ||
---API calls that are deprecated or removed in nvim nightly | ||
|
||
local compat = {} | ||
|
||
---@return lsp.Diagnostic[] | ||
function compat.get_line_diagnostics() | ||
if vim.lsp.diagnostic.from then | ||
local opts = { | ||
lnum = vim.api.nvim_win_get_cursor(0)[1] - 1, | ||
} | ||
return vim.lsp.diagnostic.from(vim.diagnostic.get(0, opts)) | ||
end | ||
---@diagnostic disable-next-line: deprecated | ||
return vim.lsp.diagnostic.get_line_diagnostics() | ||
end | ||
|
||
return compat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters