Skip to content

Commit 827fd1c

Browse files
resolving deprecation for lsp client.get call (#421)
* resolving deprecation for lsp client.get call * fix: keep support for neovim 0.10 --------- Co-authored-by: Antoine Gaudreau Simard <[email protected]>
1 parent 1041a7b commit 827fd1c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lua/copilot/api.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ end
2828
---@return boolean sent
2929
function mod.notify(client, method, params)
3030
logger.trace("api notify:", method, params)
31-
return client.notify(method, params)
31+
32+
if vim.fn.has("nvim-0.11") == 1 then
33+
return client:notify(method, params)
34+
else
35+
return client.notify(method, params)
36+
end
3237
end
3338

3439
---@alias copilot_editor_info { name: string, version: string }

lua/copilot/panel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ function panel:refresh()
469469
else
470470
local utf16_index
471471
-- assume cursor at end of line
472-
if vim.has("nvim-0.11") then
472+
if vim.fn.has("nvim-0.11") == 1 then
473473
utf16_index = vim.str_utfindex(self.state.line, "utf-16")
474474
else
475475
---@diagnostic disable-next-line: missing-parameter

0 commit comments

Comments
 (0)