Closed KorigamiK closed 4 weeks ago
show your lspconfig
Here it is:
local configs = require "nvchad.configs.lspconfig"
configs.defaults()
local handlers = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }),
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }),
}
local on_attach = configs.on_attach
local on_init = configs.on_init
local capabilities = configs.capabilities
local lspconfig = require "lspconfig"
lspconfig.lua_ls.setup {
handlers = handlers,
}
you removed the types there... copy the ones from our default lua_ls setup
Why isn't the lua_ls table not extended? The handlers are not set in the default configuration either:
require("lspconfig").lua_ls.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
on_init = M.on_init,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
workspace = {
library = {
vim.fn.expand "$VIMRUNTIME/lua",
vim.fn.expand "$VIMRUNTIME/lua/vim/lsp",
vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
"${3rd}/luv/library",
},
maxPreload = 100000,
preloadFileSize = 10000,
},
},
},
}
not extended
that isnt nvchad thing, its how lspconfig does things..
why do you have to set handlers in lsp's setup? its a global thing right
why do you have to set handlers in lsp's setup? its a global thing right
It's because lsp hover doesn't have borders on by default in NvChad. Maybe it's worth adding the handlers in the default nchad configuration as well?
https://github.com/LazyVim/LazyVim/issues/556#issuecomment-1501207493
why do you have to set handlers in lsp's setup? its a global thing right
But I am modifying literally the same table after the default configuration is added right? Why doesn't it add on to the existing lua_ls
table?
.setup doesnt modify the old values, it initializes with whatever key/vals it has
Describe the bug NvChad types are not recognized anymore.
Expected behavior No diagnostic errors
Screenshots
Desktop (please complete the following information):