refactor(nvim): migrate LSP configuration to vim.lsp API
- Update `lsp.lua` to replace deprecated `lspconfig` setup calls with the modern `vim.lsp.config` and `vim.lsp.enable` API. - Maintain Ruff/Pyright hover capabilities by ensuring `on_attatch` logic remains within the new config block. Rationale: Adopting the native Neovim 0.11+ LSP API now prepares the configuration for the upcoming `nvim-lspconfig` v3.0.0 release and reduces external plugin reliance.
This commit is contained in:
1 parent
0503e16c35
commit
1a7ce2f1be
1 file changed
+5
-5
@@ -1,15 +1,15 @@
|
|||||||
local lspconfig = require('lspconfig')
|
|
||||||
|
|
||||||
-- Python LSP: Pyright (Type checking and navigation)
|
-- Python LSP: Pyright (Type checking and navigation)
|
||||||
lspconfig.pyright.setup{}
|
vim.lsp.config('pyright', {})
|
||||||
|
vim.lsp.enable('pyright')
|
||||||
|
|
||||||
-- Python LSP: Ruff (Ultra-fast Linting and Auto-formatting)
|
-- Python LSP: Ruff (Ultra-fast Linting and Auto-formatting)
|
||||||
lspconfig.ruff.setup{
|
vim.lsp.config('ruff', {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
-- Disable hover provider in Ruff so it doesn't conflict with Pyright
|
-- Disable hover provider in Ruff so it doesn't conflict with Pyright
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
end,
|
end,
|
||||||
}
|
})
|
||||||
|
vim.lsp.enable('ruff')
|
||||||
|
|
||||||
-- Configure LSP Keybindings on attach
|
-- Configure LSP Keybindings on attach
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
|||||||
Reference in new issue
Block a user