aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorElvis Claros Castro <elvis@claros.ar>2025-08-30 19:21:25 -0300
committerElvis Claros Castro <elvis@claros.ar>2025-08-30 19:21:25 -0300
commitec011dd9c8d4372f4f8566b87981ecc178675adf (patch)
tree671b6be58f94528f790f05422bc75a1c3f988172 /lua
parentbcb5775dabf2b9144d8a87721d0095d087827f3e (diff)
downloadnvim-conf-ec011dd9c8d4372f4f8566b87981ecc178675adf.tar.gz
nvim-conf-ec011dd9c8d4372f4f8566b87981ecc178675adf.zip
feat(lsp): migración a configuración nativa de LSP en Neovim y mejora de servidores
- Refactoriza la configuración de LSP para usar vim.lsp.start/autocmd nativo, eliminando la dependencia de lspconfig en la mayoría de los servidores. - Añade funciones auxiliares para detección de directorio raíz y configuración de comandos de servidores. - Asegura que todos los servidores LSP tengan filetypes y capabilities explícitos para mejor integración. - Actualiza dependencias de plugins y eventos para soportar el nuevo flujo nativo de LSP. - Mejora el soporte de inlay hints y agrega un mapeo de teclas para alternar inlay hints. - Reemplaza el uso de lspconfig.util por vim.fs.find nativo para detección de raíz. - Marca la integración legacy de mason como obsoleta, favoreciendo la verificación nativa de ejecutables. - Limpia y estandariza los archivos de configuración de servidores para mayor consistencia. - Elimina el archivo no utilizado MIGRACION_BLINK.md. Esta migración permite mejor compatibilidad con Neovim 0.11+, simplifica la gestión de LSP y mejora el rendimiento y la fiabilidad.
Diffstat (limited to 'lua')
-rw-r--r--lua/pi/lsp/attach.lua13
-rw-r--r--lua/pi/lsp/default.lua71
-rw-r--r--lua/pi/lsp/init.lua45
-rw-r--r--lua/pi/lsp/mason.lua14
-rw-r--r--lua/pi/lsp/servers/clangd.lua1
-rw-r--r--lua/pi/lsp/servers/emmet_ls.lua11
-rw-r--r--lua/pi/lsp/servers/html.lua3
-rw-r--r--lua/pi/lsp/servers/jsonls.lua3
-rw-r--r--lua/pi/lsp/servers/kotlin_language_server.lua16
-rw-r--r--lua/pi/lsp/servers/lua_ls.lua25
-rw-r--r--lua/pi/lsp/servers/phpactor.lua2
-rw-r--r--lua/pi/lsp/servers/python.lua9
-rw-r--r--lua/pi/lsp/servers/smarty_ls.lua34
-rw-r--r--lua/pi/lsp/servers/texlab.lua24
-rw-r--r--lua/pi/lsp/servers/ts_ls.lua51
-rw-r--r--lua/plugins/lsp.lua46
-rw-r--r--lua/plugins/navigator.lua5
-rw-r--r--lua/plugins/note.lua9
-rw-r--r--lua/plugins/rustowl.lua4
19 files changed, 275 insertions, 111 deletions
diff --git a/lua/pi/lsp/attach.lua b/lua/pi/lsp/attach.lua
index 03002d6..24842fe 100644
--- a/lua/pi/lsp/attach.lua
+++ b/lua/pi/lsp/attach.lua
@@ -16,6 +16,13 @@ return function(client, bufnr)
}
end, { buffer = 0, desc = "LSP format file" })
+ -- Add inlay hint toggle
+ vim.keymap.set("n", "<leader>vh", function()
+ local current = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr })
+ vim.lsp.inlay_hint.enable(not current, { bufnr = bufnr })
+ vim.notify("Inlay hints " .. (current and "disabled" or "enabled"))
+ end, { buffer = 0, desc = "LSP Toggle inlay hints" })
+
telescope_mapper("gr", "lsp_references", { buffer = true, desc = "LSP References of symbol on cursor" })
telescope_mapper("<leader>pv", "find_symbol", { buffer = true, desc = "LSP find symbol on the project" })
telescope_mapper("<leader>pd", "lsp_document_symbols", { buffer = true, desc = "LSP document symbols" })
@@ -23,7 +30,11 @@ return function(client, bufnr)
vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc"
+ -- Enable inlay hints if supported (Neovim 0.11+ compatible)
+ -- Use pcall to handle any potential errors with inlay hints
if client.server_capabilities.inlayHintProvider then
- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
+ pcall(function()
+ vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
+ end)
end
end
diff --git a/lua/pi/lsp/default.lua b/lua/pi/lsp/default.lua
index 01e4d73..f7fa455 100644
--- a/lua/pi/lsp/default.lua
+++ b/lua/pi/lsp/default.lua
@@ -1,8 +1,49 @@
+-- Helper function to find root directory patterns
+local function root_pattern(...)
+ local patterns = { ... }
+ return function(fname)
+ for _, pattern in ipairs(patterns) do
+ local found = vim.fs.find(pattern, {
+ path = fname,
+ upward = true,
+ })[1]
+ if found then
+ return vim.fs.dirname(found)
+ end
+ end
+ end
+end
+
+-- Server command configurations
+local server_commands = {
+ emmet_ls = { "emmet-ls", "--stdio" },
+ gopls = { "gopls" },
+ html = { "vscode-html-language-server", "--stdio" },
+ jsonls = { "vscode-json-language-server", "--stdio" },
+ lua_ls = { "lua-language-server" },
+ phpactor = { "phpactor", "language-server" },
+ svelte = { "svelteserver", "--stdio" },
+ tailwindcss = { "tailwindcss-language-server", "--stdio" },
+ ts_ls = { "typescript-language-server", "--stdio" },
+ volar = { "vue-language-server", "--stdio" },
+ texlab = { "texlab" },
+ pyright = { "pyright-langserver", "--stdio" },
+ kotlin_language_server = { "kotlin-language-server" },
+ smarty_ls = { "smarty-language-server", "--stdio" },
+ clangd = { "clangd" },
+}
+
return {
mason = {
enable = true,
auto_install = false,
},
+ get_server_cmd = function(server)
+ return server_commands[server] or { server }
+ end,
+ get_default_root_dir = function()
+ return root_pattern(".git", "package.json", "Cargo.toml", "composer.json")(vim.api.nvim_buf_get_name(0))
+ end,
servers = {
emmet_ls = { enable = true },
gopls = { enable = true },
@@ -10,33 +51,33 @@ return {
jsonls = { enable = true },
lua_ls = { enable = true, neodev = true },
-- nil_ls = { enable = true },
- phpactor = {enable = true },
+ phpactor = { enable = true },
-- rust_analyzer = { enable = true },
svelte = { enable = true },
- tailwindcss = { enable = true, filetypes = {"blade", "html", "svelte"} },
+ tailwindcss = { enable = true, filetypes = { "blade", "html", "svelte" } },
ts_ls = { enable = true },
volar = { enable = true },
- texlab = { enable = true, filetypes = {"tex", "bib"} },
- pyright = { enable = true, filetypes = {"python"} },
- kotlin_language_server = { enable = true, filetypes = {"kotlin"}, root_dir = require("lspconfig.util").root_pattern(
- "build.gradle.kts",
- "pom.xml",
- ".git"
- ) },
+ texlab = { enable = true, filetypes = { "tex", "bib" } },
+ pyright = { enable = true, filetypes = { "python" } },
+ kotlin_language_server = {
+ enable = true,
+ filetypes = { "kotlin" },
+ root_dir = root_pattern("build.gradle.kts", "pom.xml", ".git"),
+ },
smarty_ls = {
enable = true,
- filetypes = {"smarty"},
- root_dir = require("lspconfig.util").root_pattern("composer.json", ".git"),
+ filetypes = { "smarty" },
+ root_dir = root_pattern("composer.json", ".git"),
},
clangd = {
enable = true,
- filetypes = {"c", "cpp", "objc", "objcpp", "cuda", "proto" },
- root_dir = require("lspconfig.util").root_pattern("compile_commands.json", ".git"),
+ filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
+ root_dir = root_pattern("compile_commands.json", ".git"),
},
},
- default_options = function (options)
+ default_options = function(options)
return vim.tbl_deep_extend("force", {
- on_attach = require"pi.lsp.attach",
+ on_attach = require "pi.lsp.attach",
flags = require "pi.lsp.flags",
capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()),
}, options)
diff --git a/lua/pi/lsp/init.lua b/lua/pi/lsp/init.lua
index 64d09b7..31b5161 100644
--- a/lua/pi/lsp/init.lua
+++ b/lua/pi/lsp/init.lua
@@ -2,8 +2,14 @@ return {
setup = function(ops)
ops = vim.tbl_deep_extend("force", require "pi.lsp.default", ops)
- local lspconfig = require "lspconfig"
- require('lspconfig.ui.windows').default_options.border = 'single'
+ -- Configure LSP border for native LSP
+ vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
+ border = "single",
+ })
+ vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
+ border = "single",
+ })
+
local mason_servers = {}
for server, options in pairs(ops.servers) do
if options.enable == true then
@@ -14,7 +20,40 @@ return {
else
server_options = definition(options)
end
- lspconfig[server].setup(server_options)
+
+ -- Setup the server with native LSP
+ local client_config = vim.tbl_extend("force", {
+ name = server,
+ cmd = server_options.cmd or ops.get_server_cmd(server),
+ root_dir = server_options.root_dir or ops.get_default_root_dir(),
+ settings = server_options.settings,
+ init_options = server_options.init_options,
+ on_attach = server_options.on_attach,
+ capabilities = server_options.capabilities,
+ filetypes = server_options.filetypes,
+ }, server_options)
+
+ -- Auto-start LSP for appropriate filetypes
+ if client_config.filetypes then
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = client_config.filetypes,
+ callback = function(ev)
+ -- Only start if no client of this type is already attached
+ local clients = vim.lsp.get_clients({ bufnr = ev.buf, name = server })
+ if #clients == 0 then
+ -- Create a copy of config for this buffer
+ local buf_config = vim.deepcopy(client_config)
+ if buf_config.root_dir and type(buf_config.root_dir) == "function" then
+ buf_config.root_dir = buf_config.root_dir(vim.api.nvim_buf_get_name(ev.buf))
+ end
+ vim.lsp.start(buf_config, {
+ bufnr = ev.buf,
+ })
+ end
+ end,
+ })
+ end
+
table.insert(mason_servers, server)
end
end
diff --git a/lua/pi/lsp/mason.lua b/lua/pi/lsp/mason.lua
index 91d0c2b..6c959a6 100644
--- a/lua/pi/lsp/mason.lua
+++ b/lua/pi/lsp/mason.lua
@@ -1,11 +1,21 @@
local mason_lspconfig = require "mason-lspconfig"
local servers = require "pi.lsp.servers"
-local lspconfig = require "lspconfig"
+
+-- Note: This file is deprecated in favor of native LSP configuration
+-- Keeping for reference/compatibility
local mason_servers = {}
+-- Since we're using native LSP, we'll check for executables differently
+local server_commands = {
+ lua_ls = "lua-language-server",
+ gopls = "gopls",
+ ts_ls = "typescript-language-server",
+ -- Add other servers as needed
+}
+
for server, _ in pairs(servers) do
- local cmd = lspconfig[server].cmd[1]
+ local cmd = server_commands[server] or server
if vim.fn.executable(cmd) == 0 then
table.insert(mason_servers, server)
end
diff --git a/lua/pi/lsp/servers/clangd.lua b/lua/pi/lsp/servers/clangd.lua
index e989cf6..3c4ac95 100644
--- a/lua/pi/lsp/servers/clangd.lua
+++ b/lua/pi/lsp/servers/clangd.lua
@@ -6,6 +6,7 @@ return function(ops)
local config = {
on_attach = lsp_attach,
flags = lsp_flags,
+ filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
capabilities = vim.tbl_deep_extend("force", capabilities, {
offsetEncoding = { "utf-16" },
general = {
diff --git a/lua/pi/lsp/servers/emmet_ls.lua b/lua/pi/lsp/servers/emmet_ls.lua
index e79a052..8d907b4 100644
--- a/lua/pi/lsp/servers/emmet_ls.lua
+++ b/lua/pi/lsp/servers/emmet_ls.lua
@@ -4,9 +4,10 @@ local lsp_flags = require "pi.lsp.flags"
return function(ops)
local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
return vim.tbl_extend("force", {
- on_attach = lsp_attach,
- flags = lsp_flags,
- capabilities = capabilities,
- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" },
- }, ops)
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ capabilities = capabilities,
+ -- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" },
+ filetypes = { "html", "css", "sass", "scss", "less", "blade", "vue" },
+ }, ops)
end
diff --git a/lua/pi/lsp/servers/html.lua b/lua/pi/lsp/servers/html.lua
index b20553b..17413ee 100644
--- a/lua/pi/lsp/servers/html.lua
+++ b/lua/pi/lsp/servers/html.lua
@@ -2,9 +2,12 @@ local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
local config = {
on_attach = lsp_attach,
+ filetypes = { "html" },
flags = lsp_flags,
+ capabilities = capabilities,
}
if vim.fn.executable "html-languageserver" == 1 then
config.cmd = { "html-languageserver", "--stdio" }
diff --git a/lua/pi/lsp/servers/jsonls.lua b/lua/pi/lsp/servers/jsonls.lua
index 3fa16e1..bfc2237 100644
--- a/lua/pi/lsp/servers/jsonls.lua
+++ b/lua/pi/lsp/servers/jsonls.lua
@@ -2,9 +2,12 @@ local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
local config = {
on_attach = lsp_attach,
flags = lsp_flags,
+ capabilities = capabilities,
+ filetypes = { "json", "jsonc" },
}
if vim.fn.executable "json-languageserver" == 1 then
config.cmd = { "json-languageserver", "--stdio" }
diff --git a/lua/pi/lsp/servers/kotlin_language_server.lua b/lua/pi/lsp/servers/kotlin_language_server.lua
index 59e9406..5ae9022 100644
--- a/lua/pi/lsp/servers/kotlin_language_server.lua
+++ b/lua/pi/lsp/servers/kotlin_language_server.lua
@@ -1,12 +1,14 @@
local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
return vim.tbl_extend("force", {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- ["kotlin-language-server"] = {
- }
- }
- }, ops)
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ capabilities = capabilities,
+ filetypes = { "kotlin" },
+ settings = {
+ ["kotlin-language-server"] = {},
+ },
+ }, ops)
end
diff --git a/lua/pi/lsp/servers/lua_ls.lua b/lua/pi/lsp/servers/lua_ls.lua
index 3975310..c641911 100644
--- a/lua/pi/lsp/servers/lua_ls.lua
+++ b/lua/pi/lsp/servers/lua_ls.lua
@@ -3,10 +3,25 @@ local lsp_flags = require "pi.lsp.flags"
return function(ops)
if ops.neodev == true then
- require("neodev").setup()
+ -- Setup neodev with explicit configuration for native LSP
+ require("neodev").setup {
+ library = {
+ enabled = true,
+ runtime = true,
+ types = true,
+ plugins = true,
+ },
+ setup_jsonls = true,
+ lspconfig = false, -- Don't let neodev override lspconfig setup
+ }
end
-
+
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
+
return vim.tbl_extend("force", {
+ cmd = { "lua-language-server" },
+ filetypes = { "lua" },
+ capabilities = capabilities,
on_attach = lsp_attach,
flags = lsp_flags,
settings = {
@@ -26,6 +41,12 @@ return function(ops)
},
hint = {
enable = true,
+ -- Disable some problematic hints that might cause position issues
+ setType = false,
+ paramType = true,
+ paramName = "Disable", -- Can be "All", "Literal", "Disable"
+ semicolon = "Disable", -- Can be "All", "SameLine", "Disable"
+ arrayIndex = "Disable", -- Can be "All", "Auto", "Disable"
},
completion = {
callSnippet = "Replace",
diff --git a/lua/pi/lsp/servers/phpactor.lua b/lua/pi/lsp/servers/phpactor.lua
index 6196cdb..88c1535 100644
--- a/lua/pi/lsp/servers/phpactor.lua
+++ b/lua/pi/lsp/servers/phpactor.lua
@@ -51,11 +51,13 @@ local function phpactor_attach(_, bufnr)
end
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
return vim.tbl_extend("force", {
on_attach = function(client, bufnr)
lsp_attach(client, bufnr)
phpactor_attach(client, bufnr)
end,
+ capabilities = capabilities,
flags = lsp_flags,
filetypes = { "php", "blade" },
init_options = {
diff --git a/lua/pi/lsp/servers/python.lua b/lua/pi/lsp/servers/python.lua
index db561aa..3e79ffd 100644
--- a/lua/pi/lsp/servers/python.lua
+++ b/lua/pi/lsp/servers/python.lua
@@ -1,16 +1,19 @@
local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
-return function (ops)
+return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
+
return vim.tbl_extend("force", {
on_attach = lsp_attach,
flags = lsp_flags,
+ capabilities = capabilities,
settings = {
["pyright"] = {
disableOrganizeImports = false,
disableDiagnostics = false,
disableLanguageServices = false,
typeCheckingMode = "strict",
- }
- }
+ },
+ },
}, ops)
end
diff --git a/lua/pi/lsp/servers/smarty_ls.lua b/lua/pi/lsp/servers/smarty_ls.lua
index bf29082..88e4b22 100644
--- a/lua/pi/lsp/servers/smarty_ls.lua
+++ b/lua/pi/lsp/servers/smarty_ls.lua
@@ -2,24 +2,26 @@ local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
return vim.tbl_extend("force", {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- css = {
- validate = true
- },
- smarty = {
- pluginDirs = {}
- },
- ["smarty_ls"] = {
- checkOnSave = {
- overrideCommand = {
- "smarty-language-server",
- "--stdio",
- },
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ capabilities = capabilities,
+ settings = {
+ css = {
+ validate = true,
+ },
+ smarty = {
+ pluginDirs = {},
+ },
+ ["smarty_ls"] = {
+ checkOnSave = {
+ overrideCommand = {
+ "smarty-language-server",
+ "--stdio",
},
},
},
- }, ops)
+ },
+ }, ops)
end
diff --git a/lua/pi/lsp/servers/texlab.lua b/lua/pi/lsp/servers/texlab.lua
index 523628b..810bae4 100644
--- a/lua/pi/lsp/servers/texlab.lua
+++ b/lua/pi/lsp/servers/texlab.lua
@@ -1,16 +1,18 @@
local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
return vim.tbl_extend("force", {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- ["texlab"] = {
- latexFormatter = "latexindent",
- latexindent = {
- modifyLineBreaks = false
- }
- }
- }
- }, ops)
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ capabilities = capabilities,
+ settings = {
+ ["texlab"] = {
+ latexFormatter = "latexindent",
+ latexindent = {
+ modifyLineBreaks = false,
+ },
+ },
+ },
+ }, ops)
end
diff --git a/lua/pi/lsp/servers/ts_ls.lua b/lua/pi/lsp/servers/ts_ls.lua
index c68c894..ad4953b 100644
--- a/lua/pi/lsp/servers/ts_ls.lua
+++ b/lua/pi/lsp/servers/ts_ls.lua
@@ -2,32 +2,35 @@ local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
+ local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
return vim.tbl_extend("force", {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- typescript = {
- inlayHints = {
- includeInlayParameterNameHints = "all",
- includeInlayParameterNameHintsWhenArgumentMatchesName = false,
- includeInlayFunctionParameterTypeHints = true,
- includeInlayVariableTypeHints = true,
- includeInlayPropertyDeclarationTypeHints = true,
- includeInlayFunctionLikeReturnTypeHints = true,
- includeInlayEnumMemberValueHints = true,
- },
+ on_attach = lsp_attach,
+ capabilities = capabilities,
+ flags = lsp_flags,
+ filetypes = { "typescriptreact", "javascriptreact", "blade", "vue" },
+ settings = {
+ typescript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all",
+ includeInlayParameterNameHintsWhenArgumentMatchesName = false,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayVariableTypeHints = true,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayEnumMemberValueHints = true,
},
- javascript = {
- inlayHints = {
- includeInlayParameterNameHints = "all",
- includeInlayParameterNameHintsWhenArgumentMatchesName = false,
- includeInlayFunctionParameterTypeHints = true,
- includeInlayVariableTypeHints = true,
- includeInlayPropertyDeclarationTypeHints = true,
- includeInlayFunctionLikeReturnTypeHints = true,
- includeInlayEnumMemberValueHints = true,
- },
+ },
+ javascript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all",
+ includeInlayParameterNameHintsWhenArgumentMatchesName = false,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayVariableTypeHints = true,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayEnumMemberValueHints = true,
},
},
- }, ops)
+ },
+ }, ops)
end
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua
index eae804e..c7f6d52 100644
--- a/lua/plugins/lsp.lua
+++ b/lua/plugins/lsp.lua
@@ -1,25 +1,43 @@
return {
- "neovim/nvim-lspconfig",
- dependencies = {
+ -- Native LSP configuration for Neovim 0.11+
+ {
"nvimtools/none-ls.nvim",
- {
- "williamboman/mason.nvim",
- opts = {
- ui = {
- border = "rounded",
- },
+ event = "VeryLazy",
+ },
+ {
+ "williamboman/mason.nvim",
+ opts = {
+ ui = {
+ border = "rounded",
},
},
+ event = "VeryLazy",
+ },
+ {
"folke/neodev.nvim",
+ dependencies = {
+ "neovim/nvim-lspconfig", -- Required by neodev for lspconfig.util
+ },
+ event = "VeryLazy",
+ },
+ {
"williamboman/mason-lspconfig.nvim",
+ event = "VeryLazy",
+ },
+ {
"WhoIsSethDaniel/mason-tool-installer.nvim",
+ event = "VeryLazy",
},
- event = "VeryLazy",
- main = "pi.lsp",
- opts = {
- mason = {
- enable = true,
- auto_install = false,
+ {
+ name = "native-lsp",
+ dir = vim.fn.stdpath("config"),
+ event = "VeryLazy",
+ main = "pi.lsp",
+ opts = {
+ mason = {
+ enable = true,
+ auto_install = false,
+ },
},
},
}
diff --git a/lua/plugins/navigator.lua b/lua/plugins/navigator.lua
index 53a7735..bc72469 100644
--- a/lua/plugins/navigator.lua
+++ b/lua/plugins/navigator.lua
@@ -9,14 +9,11 @@ return {
event = "LspAttach",
dependencies = {
{ "ray-x/guihua.lua", build = "cd lua/fzy && make" },
- {
- "neovim/nvim-lspconfig",
- },
},
opts = {
default_mapping = false,
lsp = {
- disable_lsp = "all",
+ disable_lsp = "all", -- Uses native LSP configuration instead of lspconfig
hover = {
enable = false,
},
diff --git a/lua/plugins/note.lua b/lua/plugins/note.lua
index 2728bde..e2b5db3 100644
--- a/lua/plugins/note.lua
+++ b/lua/plugins/note.lua
@@ -19,9 +19,12 @@ return {
-- Using the parent .git folder as the cwd
cwd = function()
local bufPath = vim.api.nvim_buf_get_name(0)
- local cwd = require("lspconfig").util.root_pattern(".git")(bufPath)
-
- return cwd
+ -- Use native vim.fs.find instead of lspconfig.util
+ local cwd = vim.fs.find(".git", {
+ path = bufPath,
+ upward = true,
+ })[1]
+ return cwd and vim.fs.dirname(cwd) or vim.fn.getcwd()
end,
},
},
diff --git a/lua/plugins/rustowl.lua b/lua/plugins/rustowl.lua
index b85ec08..34a66a6 100644
--- a/lua/plugins/rustowl.lua
+++ b/lua/plugins/rustowl.lua
@@ -1,5 +1,7 @@
return {
"cordx56/rustowl",
ft = { "rust" },
- dependencies = { "neovim/nvim-lspconfig" },
+ opts = {
+ client = {}, -- Uses native vim.lsp.start internally
+ },
}