Closed FreeCodeFanatic closed 6 days ago
show your lspconfig
i use NvChad 2.5, the lsp is a basic one, used the config from the docs,is just for c and python.
local base = require("nvchad.configs.lspconfig")
local on_attach = base.on_attach
local capabilities = base.capabilities
local lspconfig = require("lspconfig")
lspconfig.clangd.setup {
cmd = { "clangd-19" },
on_attach = on_attach, -- Use the base on_attach function
capabilities = capabilities,
}
-- Setup for Ruff-LSP
lspconfig.ruff_lsp.setup{
on_attach = on_attach,
capabilities = capabilities,
}
lspconfig.pyright.setup({
on_attach = on_attach,
capabilities = capabilities,
settings = {
python = {
analysis = {
typeCheckingMode = 'strict',
reportUnusedImport = "none",
},
},
},
})
use our on_init too
Thanks a lot, I did not read the code from starter, I just migrate from 2.0 to 2.5. I will let here a example with the modification for other users to see, maybe it will help.
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig"
local nvlsp = require "nvchad.configs.lspconfig"
local lspconfig = require("lspconfig")
--Setup Clangd
lspconfig.clangd.setup {
cmd = { "clangd-19" },
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init, --you need to add
capabilities = nvlsp.capabilities,
}
-- Setup Ruff-LSP
lspconfig.ruff_lsp.setup{
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init, --you need to add
capabilities = nvlsp.capabilities,
}
--Setup Pyright lsp
lspconfig.pyright.setup({
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init, --you need to add
capabilities = nvlsp.capabilities,
settings = {
python = {
analysis = {
typeCheckingMode = 'strict',
reportUnusedImport = "none",
},
},
},
})
Describe the bug The lsp information are not red, in any theme I use, the color is not red, if I select the theme again the lsp information become red, but if i exit and enter again the color will become "beige". I tried clangd, ruff lsp and pyright, all is the same. And for the theme all of them
To Reproduce Just use the default NvChad and a lsp, choose a theme, exit and renter.
Screenshots
System
https://github.com/user-attachments/assets/d106f7af-f5fe-405f-8973-2af3bc4f9ec0