fix: updated require(lspconfig) to vim.lsp.config('...')

This commit is contained in:
Ward Truyen
2026-02-28 12:49:05 +01:00
parent d631d24d88
commit c74930b788

View File

@@ -1,10 +1,11 @@
-- URL: https://github.com/neovim/nvim-lspconfig
-- NOTE: this adds a Language Server Provider for source files like C++, Java/-Script, etc. -- NOTE: this adds a Language Server Provider for source files like C++, Java/-Script, etc.
-- It will check the code for errors, warnings, variables and structures and give suggestions. -- It will check the code for errors, warnings, variables and structures and give suggestions.
return { return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
version = "*", version = "*",
config = function() config = function()
local lspconfig = require("lspconfig") -- local lspconfig = require("lspconfig")
vim.cmd([[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]]) vim.cmd([[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]])
vim.cmd([[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]]) vim.cmd([[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]])
@@ -27,7 +28,8 @@ return {
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }), ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }),
} }
lspconfig.clangd.setup({ -- lspconfig.clangd.setup({
vim.lsp.config("clangd",{
keys = { keys = {
{ "<leader>pc", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" }, { "<leader>pc", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
}, },
@@ -49,7 +51,8 @@ return {
handlers = handlers, handlers = handlers,
}) })
lspconfig.glsl_analyzer.setup({ -- lspconfig.glsl_analyzer.setup({
vim.lsp.config("glsl_analyzer",{
filetypes = { "glsl", "vert", "tese", "frag", "geom", "comp", "vs", "fs" }, filetypes = { "glsl", "vert", "tese", "frag", "geom", "comp", "vs", "fs" },
handlers = handlers, handlers = handlers,
}) })
@@ -77,14 +80,16 @@ return {
}, },
}) })
lspconfig.rust_analyzer.setup({ -- lspconfig.rust_analyzer.setup({
vim.lsp.config("rust_analyzer",{
settings = { settings = {
["rust-analyzer"] = {}, ["rust-analyzer"] = {},
}, },
handlers = handlers, handlers = handlers,
}) })
lspconfig.lua_ls.setup({ -- lspconfig.lua_ls.setup({
vim.lsp.config("lua_ls",{
handlers = handlers, handlers = handlers,
}) })