Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular-ls has no knowledge of wider project #4499

Closed
2 of 3 tasks
JordanAnthonyKing opened this issue Jul 18, 2024 · 3 comments
Closed
2 of 3 tasks

Angular-ls has no knowledge of wider project #4499

JordanAnthonyKing opened this issue Jul 18, 2024 · 3 comments
Labels

Comments

@JordanAnthonyKing
Copy link

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

Angular-ls features like code completion and go to definition aren't working for me.

I get no errors or messages in the angular-lsp buffers.

image

Angular-ls reports that all features are available.

image

The lsp-log makes no references to angular if I open an html file however after opening a ts file I get:

Command "c:/Users/jking/.config/emacs/.local/etc/lsp/npm/typescript-language-server/typescript-language-server.cmd --stdio" is present on the path.
Command "ngserver --stdio --tsProbeLocations c:/Program Files/nodejs/node_modules --ngProbeLocations c:/Program Files/nodejs/node_modules/@angular/language-server/node_modules/" is present on the path.
Command "semgrep lsp" is not present on the path.
Command "deno lsp" is not present on the path.
Command "c:/Users/jking/.config/emacs/.local/etc/lsp/npm/typescript-language-server/typescript-language-server.cmd --stdio" is present on the path.
Command "ngserver --stdio --tsProbeLocations c:/Program Files/nodejs/node_modules --ngProbeLocations c:/Program Files/nodejs/node_modules/@angular/language-server/node_modules/" is present on the path.
Found the following clients for c:/Users/jking/source/XSight/XClient/apps/location/src/app/modules/locations/components/data-providers/data-provider-popup/data-provider-popup.component.ts: (server-id ts-ls, priority -2), (server-id eslint, priority -1), (server-id angular-ls, priority -1)
The following clients were selected based on priority: (server-id ts-ls, priority -2), (server-id eslint, priority -1), (server-id angular-ls, priority -1)

Then after opening an html file I get something similar:

Command "c:/Users/jking/.config/emacs/.local/etc/lsp/npm/vscode-langservers-extracted/vscode-html-language-server.cmd --stdio" is present on the path.
Command "semgrep lsp" is not present on the path.
Command "ngserver --stdio --tsProbeLocations c:/Program Files/nodejs/node_modules --ngProbeLocations c:/Program Files/nodejs/node_modules/@angular/language-server/node_modules/" is present on the path.
Command "c:/Users/jking/.config/emacs/.local/etc/lsp/npm/vscode-langservers-extracted/vscode-html-language-server.cmd --stdio" is present on the path.
Command "semgrep lsp" is not present on the path.
Command "ngserver --stdio --tsProbeLocations c:/Program Files/nodejs/node_modules --ngProbeLocations c:/Program Files/nodejs/node_modules/@angular/language-server/node_modules/" is present on the path.
Found the following clients for c:/Users/jking/source/XSight/XClient/apps/location/src/app/modules/locations/components/data-providers/data-provider-popup/data-provider-popup.component.html: (server-id html-ls, priority -4), (server-id eslint, priority -1), (server-id angular-ls, priority -1)
The following clients were selected based on priority: (server-id html-ls, priority -4), (server-id eslint, priority -1), (server-id angular-ls, priority -1)

After this when trying to use a language server feature like completion I see this in the log:

Cancelling textDocument/codeLens(110) in hook after-change-functions
Cancelling textDocument/hover(109) in hook after-change-functions
Cancelling textDocument/codeLens(116) in hook after-change-functions
Cancelling textDocument/hover(115) in hook after-change-functions
Cancelling textDocument/diagnostic(128) in hook after-change-functions
Cancelling textDocument/diagnostic(129) in hook after-change-functions
Cancelling textDocument/diagnostic(130) in hook after-change-functions
Cancelling textDocument/codeLens(136) in hook after-change-functions
Cancelling textDocument/codeLens(143) in hook after-change-functions
Cancelling textDocument/hover(142) in hook after-change-functions
Cancelling textDocument/documentHighlight(141) in hook after-change-functions
Cancelling textDocument/documentLink(140) in hook after-change-functions
Cancelling textDocument/diagnostic(144) in hook after-change-functions
Cancelling textDocument/diagnostic(146) in hook after-change-functions
Cancelling textDocument/diagnostic(157) in hook after-change-functions
Cancelling textDocument/diagnostic(158) in hook after-change-functions
Cancelling textDocument/diagnostic(159) in hook after-change-functions

Basic completion works but there is no completion of project specific variables/functions/etc.

The only thing somewhat unusual about my project is that it's in a monorepo, but I have verified that the lsp-workspace is correct for the file I am currently editing. Evaling (lsp-workspace-root) returns the root of the angular project, not the root of the git repo.

Steps to reproduce

I've done no special config. I've installed the requirements and opened a project. However I think it's important to point out I have ignored the configuration advice given here: https://github.com/emacs-lsp/lsp-mode/wiki/Install-Angular-Language-server as according to this bug: #4459 it is outdated

Expected behavior

All language features should be available

Which Language Server did you use?

Angular

OS

Windows

Error callstack

No response

Anything else?

No response

@JordanAnthonyKing
Copy link
Author

I guess I should also point out that I always get these warnings too:

image

@JordanAnthonyKing
Copy link
Author

JordanAnthonyKing commented Jul 18, 2024

Okay, this is very likely some sort of known/unknown upstream bug. Basically I was getting no results when I was editing within an <ng-container> block. Turns out everywhere else works fine.

@Askath
Copy link

Askath commented Jul 19, 2024

I guess I should also point out that I always get these warnings too:

image

Getting this issue as well, in template files however after installing the html-ls server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants