Skip to content

Commit c921e36

Browse files
committed
refactor: cleanup nvim 0.11.0 warnings
1 parent ac42b18 commit c921e36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lua/copilot/client.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function M.buf_attach(force)
5858
-- In case it has changed, we update it
5959
M.config.root_dir = config.get_root_dir()
6060

61-
local ok, client_id_or_err = pcall(lsp_start, M.config)
61+
local ok, client_id_or_err = pcall(vim.lsp.start, M.config)
6262
if not ok then
6363
logger.error(string.format("failed to start LSP client: %s", client_id_or_err))
6464
return
@@ -101,7 +101,7 @@ function M.use_client(callback)
101101
return
102102
end
103103

104-
local client_id, err = vim.lsp.start_client(M.config)
104+
local client_id, err = vim.lsp.start(M.config)
105105

106106
if not client_id then
107107
logger.error(string.format("error starting LSP client: %s", err))
@@ -370,7 +370,7 @@ function M.add_workspace_folder(folder_path)
370370

371371
local client = M.get()
372372
if client and client.initialized then
373-
client.notify("workspace/didChangeWorkspaceFolders", {
373+
api.notify(client, "workspace/didChangeWorkspaceFolders", {
374374
event = {
375375
added = { workspace_folder },
376376
removed = {},

lua/copilot/panel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ function panel:refresh()
467467
vim.cmd("stopinsert")
468468
else
469469
-- assume cursor at end of line
470-
local _, utf16_index = vim.str_utfindex(self.state.line)
470+
local _, utf16_index = vim.str_utfindex(self.state.line, "utf-16")
471471
params.doc.position.character = utf16_index
472472
params.position.character = params.doc.position.character
473473
end

0 commit comments

Comments
 (0)