From 91b91c3a41ea9fe0e2f88f7185b9118cf3d32eb7 Mon Sep 17 00:00:00 2001 From: "R.Chavignat" Date: Thu, 10 Oct 2024 15:14:36 +0200 Subject: [PATCH] fix(examples/nvim): fix deprecations --- examples/nvim/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/nvim/init.lua b/examples/nvim/init.lua index a7f474b..6c8253a 100644 --- a/examples/nvim/init.lua +++ b/examples/nvim/init.lua @@ -96,22 +96,22 @@ Response: -- The easiest way to configure the language server is to use the nvim-lspconfig plugin: https://github.com/neovim/nvim-lspconfig -- Use the following snippet to configure it after installing it with the plugin manager of your choice. +-- 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 require('nvim-lspconfig').lsp_ai.setup { - -- 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 - root_dir = vim.loop.cwd(), + root_dir = vim.fn.getcwd(), init_options = lsp_ai_init_options, } -- Start lsp-ai or attach the active instance when opening a buffer, handled automatically when using nvim-lspconfig local lsp_ai_config = { cmd = { 'lsp-ai' }, - root_dir = vim.loop.cwd(), + root_dir = vim.fn.getcwd(), init_options = lsp_ai_init_options, } vim.api.nvim_create_autocmd("BufEnter", { callback = function(args) local bufnr = args.buf - local client = vim.lsp.get_active_clients({bufnr = bufnr, name = "lsp-ai"}) + local client = vim.lsp.get_clients({bufnr = bufnr, name = "lsp-ai"}) if #client == 0 then vim.lsp.start(lsp_ai_config, {bufnr = bufnr}) end