fix(neovim): migrate LSP config to native vim.lsp.config API
Replace deprecated require("lspconfig") setup with the Neovim 0.11+
native vim.lsp.config/vim.lsp.enable API. Clangd config now lives in
lsp/clangd.lua instead of the old plugins/lspconfig.lua +
configs/lspconfig.lua pair.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -298,29 +298,27 @@ return {
|
||||
}
|
||||
```
|
||||
|
||||
Create `~/.config/nvim/lua/plugins/lsp.lua`:
|
||||
Create `~/.config/nvim/lsp/clangd.lua` (native Neovim 0.11+ LSP config):
|
||||
|
||||
```lua
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
clangd = {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--header-insertion=iwyu",
|
||||
"--completion-style=detailed",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--header-insertion=iwyu",
|
||||
"--completion-style=detailed",
|
||||
},
|
||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "arduino" },
|
||||
}
|
||||
```
|
||||
|
||||
Enable the server (e.g. in `init.lua` or a plugin file):
|
||||
|
||||
```lua
|
||||
vim.lsp.enable("clangd")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Arduino CLI
|
||||
|
||||
Reference in New Issue
Block a user