trying to add clangd and cmake lsps

This commit is contained in:
dlond 2025-05-22 17:55:13 +12:00
parent e9c8f49891
commit abed9bdabc
2 changed files with 11 additions and 13 deletions

View File

@ -9,8 +9,6 @@ return {
'neovim/nvim-lspconfig',
event = { 'BufReadPre', 'BufNewFile' }, -- Load LSP config early
dependencies = {
-- Dependencies for nvim-lspconfig itself, if any.
-- Mason and mason-lspconfig are removed as Nix handles LSP installation.
{ 'j-hui/fidget.nvim', opts = {} }, -- Useful status updates for LSP
'hrsh7th/cmp-nvim-lsp', -- LSP completion source for nvim-cmp
},
@ -38,7 +36,8 @@ return {
},
},
clangd = {
root_dir = require('lspconfig.util').root_pattern('compile_commands.json', '.git', '.clangd'), -- Helps find project root
cmd = { 'clangd', '--compile-commands-dir=build' },
root_dir = require('lspconfig.util').root_pattern('CMakeLists.tst', '.git'),
},
pyright = {
settings = {
@ -56,9 +55,11 @@ return {
nixd = {},
ruff = {},
texlab = {},
-- Add other servers like "bashls", "yamlls", "gopls", "rust_analyzer" etc.
-- Ensure the corresponding packages (e.g., pkgs.bash-language-server)
-- are in your Home Manager home.packages list.
cmake = {
cmd = { 'cmake-language-server', '--stdio' },
filetypes = { 'cmake' },
root_dir = require('lspconfig.util').root_pattern('CMakeLists.tst', '.git'),
},
}
-- Iterate through the defined servers list and set them up with lspconfig

View File

@ -8,7 +8,6 @@ return {
-- main = 'nvim-treesitter.configs', -- Keep if needed from kickstart
opts = { -- Use opts to merge/override defaults
ensure_installed = {
-- List ALL parsers you want installed based on your previous config
'bash',
'c',
'cmake',
@ -20,16 +19,14 @@ return {
'make',
'markdown',
'markdown_inline',
'nix', -- Added based on previous diff
'python', -- Added based on previous diff
'nix',
'python',
'query',
'vim',
'vimdoc',
'yaml', -- Added based on previous diff
-- Add any others you commonly use
'yaml',
},
-- Autoinstall languages that are not installed
auto_install = true, -- Keep kickstart's default or set as desired
auto_install = true,
-- Keep other kickstart defaults like highlight/indent settings unless you want to change them
highlight = {