Closed l3d00m closed 4 months ago
While opening the issue, I actually fixed this by setting the following in my neovim config
angularls = {
root_dir = require("lspconfig.util").root_pattern("project.json"),
},
instead of
return {
angularls = {
root_dir = require("lspconfig.util").root_pattern(".git"),
},
EDIT: Nevermind, this is still happenning. Just less often. Sorry for the confusion
@l3d00m Are you able to reproduce this issue with the VSCode extension? If not, then please file a bug on the repo that owns the vim integration (LazyVim?) as we do not directly support the integration with editors other than VSCode.
Thanks for you response, I'm not able to reproduce in VSCode.
I've made this a stackoverflow question for now. There is no really suitable repository as far as I can tell (lazyvim also is just a distribution, not the maintainers).
@atscott I also experiencing this, but switching to v17.3.2
it works fine. I tried it to a new created project ng new test
.
Same issue here, you are using mason, right? It could be an issue how mason-lspconfig
is passing arguments to the language server (https://github.com/williamboman/mason-lspconfig.nvim/blob/main/lua/mason-lspconfig/server_configurations/angularls/init.lua).
I think this only happens when angularls tries to check typescript files, e.g. x.component.ts
. I don't experience the same issue for x.component.html
(which is a crash on first save of the mentioned file).
I'm using a very similar setup to you:
local util = require 'lspconfig.util'
lspconfig.angularls.setup {
root_dir = util.root_pattern('angular.json', 'project.json'),
}
Yes I'm also using mason, and it will crash a few seconds after you save a file
Thanks for your feedback. With that I could provide a better reproduction. I've updated the original description to highlight that:
nx serve
for the LSP to crashangularls
lspconfig
(no need to set the root dir for a vanilla angular project)I have opened it now in the LazyVim repo, so I'm closing this now
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
🐞 bug report
Is this a regression?
Not sure, new to angular. But I've found #1030, where it's supposed to be fixed. Works with angular v17, accourding to comments below.
Description
The language server in nvim crashes after saves of an
.component.ts
file. It crashes withProgram does not contain "PROJECT_PATH/apps/org/src/app/app.component.ngtypecheck.ts"
I cannot reproduce this in VS Code, so I'm not sure if this is actually the correct repository.
Bug Type
What does this bug affect
Reproduction
Steps to reproduce the behavior:
ng new my-app
with the default settings (just press enter).app.component.ts
in neovim (with LazyVim and angular LSP enabled)Program does not contain "c:/Users/myuser/IdeaProjects/projects/my-app/org/apps/org/src/app/app.component.ngtypecheck.ts"
Expected behavior
It should not crash.
Logs
Log file gives us deep insight into the behavior and performance of the extension. If the issue is a performance problem or an error occured, please provide the output of the log file below.
Set Angular Log level to verbose.
Screenshots
If applicable, add screenshots to help explain your problem.
🌍 Your Environment
Angular Version:
Extension Version:
VSCode Version:
Operating System:
Extension options:
Anything else relevant?
NVIM v0.10.0
LazyVim V12.19.1
mason.nvim at 0950b15
mason-lspconfig.nvim at 37a336b
nvim-lspconfig at 9c9eb07