From d84c28e4c847e6b995e9fdcb2216e9290dceb5d2 Mon Sep 17 00:00:00 2001 From: Tristan Russell Date: Sun, 24 Aug 2025 23:09:48 -0400 Subject: [PATCH] feat: Updated to new API/syntax for enabling LSPs --- after/plugin/lsp.lua | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index fd390e8..4b18c36 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -29,7 +29,8 @@ cmp.setup({ }, }) -require('lspconfig').lua_ls.setup { +vim.lsp.enable("lua_ls") +vim.lsp.config("lua_ls", { on_init = function(client) if client.workspace_folders then local path = client.workspace_folders[1].name @@ -40,30 +41,23 @@ require('lspconfig').lua_ls.setup { client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) version = 'LuaJIT' }, - -- Make the server aware of Neovim runtime files workspace = { checkThirdParty = false, library = { vim.env.VIMRUNTIME - -- Depending on the usage, you might want to add additional paths here. - -- "${3rd}/luv/library" - -- "${3rd}/busted/library", } - -- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189) - -- library = vim.api.nvim_get_runtime_file("", true) } }) end, settings = { Lua = {} } -} +}) -require('lspconfig').clangd.setup{ +vim.lsp.enable("clangd") +vim.lsp.config("clangd", { capabilities = require('cmp_nvim_lsp').default_capabilities(), cmd = { "clangd", @@ -72,19 +66,19 @@ require('lspconfig').clangd.setup{ "--completion-style=detailed", "--all-scopes-completion", } -} +}) -require('lspconfig').pyright.setup{} -require('lspconfig').html.setup{} -require('lspconfig').angularls.setup{} -require('lspconfig').ts_ls.setup({ +vim.lsp.enable("pyright") +vim.lsp.enable("html") +vim.lsp.enable("angularls") + +vim.lsp.enable("ts_ls") +vim.lsp.config("ts_ls", { cmd = { "/usr/lib/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" }, filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact" }, init_options = { - -- Required for plugins (even if unused) plugins = {}, }, - -- Ensure tsserver uses project-specific tsconfig.json on_attach = function(client, bufnr) client.server_capabilities.documentFormattingProvider = false -- Optional end