Closed XenHunt closed 2 days ago
After some research and finding how it is working in neovim config of mason package, I found a correct config for lsp-client-angular-language-server-command
:
(setq lsp-clients-angular-language-server-command
'("ngserver"
"--stdio"
"--tsProbeLocations"
"<mine-root-directory>/.nvm/versions/node/v20.13.1/lib/node_modules/"
"--ngProbeLocations"
"<mine-root-directory>/.nvm/versions/node/v20.13.1/lib/node_modules/@angular/language-server/node_modules/"
))
edit: Added a lua function from which I got a right configuration
---@param install_dir string
return function(install_dir)
local append_node_modules = _.map(function(dir)
return path.concat { dir, "node_modules" }
end)
local function get_cmd(workspace_dir)
local cmd = {
"ngserver",
"--stdio",
"--tsProbeLocations",
table.concat(append_node_modules { install_dir, workspace_dir }, ","),
"--ngProbeLocations",
table.concat(
append_node_modules {
path.concat { install_dir, "node_modules", "@angular", "language-server" },
workspace_dir,
},
","
),
}
if platform.is.win then
cmd[1] = vim.fn.exepath(cmd[1])
end
return cmd
end
return {
cmd = get_cmd(vim.loop.cwd()),
on_new_config = function(new_config, root_dir)
new_config.cmd = get_cmd(root_dir)
end,
}
end
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
Angular-ls doesn't work correctly, as it must. When I try to edit html file of a component, it does gives me any autocompletion of angular specific components or variables in ts file of that component. As of
lsp-workspace-show-log
I get for angular-ls incode-Action
,hover
,codeLens
onlyResult:null
Steps to reproduce
ng new test
.title
, that is a variable in app.component.tsExpected behavior
Expected that will be given autocompletion for selecting this variable.
Which Language Server did you use?
angular-ls, html-ls, ts-ls
OS
Linux
Error callstack
No response
Anything else?
I did some research for myself.