I’m trying to make the Angular language server work in NvChad, for a NX monorepo, but it doesn’t seem to work. This is what I’ve pieced together from different sources on the internet (the part after the “– Angular”-comment, the rest is boilerplate NvChad):
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
-- Angular
local util = require("lspconfig.util")
lspconfig.angularls.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
-- as far as I understand, the line below (or something similar) should be required because monorepos contain many configuration files for the apps
root_dir = util.root_pattern("project.json"),
}
- Does anyone have a working configuration for NvChad that works for an NX monorepo containing Angular apps?
- I’m unsure as to how to actually install the language server. I’ve installed it using Mason, where it’s called “angular-language-server”, but I’ve also seen sources stating that it should be installed using NPM (
npm i .g @angular/language-server
), and I’ve done both
I am completely new to NeoVim, so please be patient =).