Skip to content

Commit 91b91c3

Browse files
committed
fix(examples/nvim): fix deprecations
1 parent 8f8d208 commit 91b91c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/nvim/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,22 @@ Response:
9696

9797
-- The easiest way to configure the language server is to use the nvim-lspconfig plugin: https://github.com/neovim/nvim-lspconfig
9898
-- Use the following snippet to configure it after installing it with the plugin manager of your choice.
99+
-- See the nvim-lspconfig docs for the supported parameters on top of the init_options at https://github.com/neovim/nvim-lspconfig/blob/master/doc/lspconfig.txt
99100
require('nvim-lspconfig').lsp_ai.setup {
100-
-- See the nvim-lspconfig docs for the supported parameters on top of the init_options at https://github.com/neovim/nvim-lspconfig/blob/master/doc/lspconfig.txt
101-
root_dir = vim.loop.cwd(),
101+
root_dir = vim.fn.getcwd(),
102102
init_options = lsp_ai_init_options,
103103
}
104104

105105
-- Start lsp-ai or attach the active instance when opening a buffer, handled automatically when using nvim-lspconfig
106106
local lsp_ai_config = {
107107
cmd = { 'lsp-ai' },
108-
root_dir = vim.loop.cwd(),
108+
root_dir = vim.fn.getcwd(),
109109
init_options = lsp_ai_init_options,
110110
}
111111
vim.api.nvim_create_autocmd("BufEnter", {
112112
callback = function(args)
113113
local bufnr = args.buf
114-
local client = vim.lsp.get_active_clients({bufnr = bufnr, name = "lsp-ai"})
114+
local client = vim.lsp.get_clients({bufnr = bufnr, name = "lsp-ai"})
115115
if #client == 0 then
116116
vim.lsp.start(lsp_ai_config, {bufnr = bufnr})
117117
end

0 commit comments

Comments
 (0)