My setup at the moment looks like this:
local cwd = vim.fn.getcwd()
local project_library_path = cwd .. "/node_modules"
local cmd = {
DATA_PATH .. "/lsp_servers/angularls/node_modules/@angular/language-server/bin/ngserver",
"--ngProbeLocations",
project_library_path,
"--tsProbeLocations",
project_library_path ,
"--stdio",
}
require'lspconfig'.angularls.setup{
cmd = cmd,
on_new_config = function(new_config, new_root_dir)
new_config.cmd = cmd
end
}
On :LspInfo, I can see that the cmd is executable, but somehow it doesn't attach.
I have difficulty to differentiate @angular/language-server from @angular/language-service...
I am not sure what the tsProbeLocations and ngProbeLocations do and if my path is correct.
Finally, I red from Angular Language Service website and there isn't a good guideline for neovim. (except for coc-angular, but I don't use coc.)
I used the default
require'lspconfig'.angularls.setup{}for my lspconfig and also installed @angular/language-server as a dev dependency in the angular project and it worked.With angular language server installed globally with npm and the default lspconfig, I also saw that the cmd is executable with no client attaching to the buffer.