-
Notifications
You must be signed in to change notification settings - Fork 122
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
Extension stops working after 30-60 minutes #1399
Comments
In my experience, this is also happening for input properties. |
The `TextEdit` is not meant to replace text to the right of the position. Instead, `InsesrtReplaceEdit` should be used. Reference discussion in LSP issue for examples on replacement vs insertion range for `InsertReplaceEdit`: microsoft/language-server-protocol#846 Fixes angular#1399 Note that the issue did not appear in the VE version of the extension because it was only providing completions as inserts (they had no `replacementSpan`).
The `TextEdit` is not meant to replace text to the right of the position. Instead, `InsesrtReplaceEdit` should be used. Reference discussion in LSP issue for examples on replacement vs insertion range for `InsertReplaceEdit`: microsoft/language-server-protocol#846 Fixes angular#1399 Note that the issue did not appear in the VE version of the extension because it was only providing completions as inserts (they had no `replacementSpan`).
I'm also receiving this issue, revert to 11.2.14 for the time being. Intellisense is very broken in 12.0.4 in HTML templates. |
@xantari @ashwingairola @devhus are any of you able to provide a project with a set of steps that reproduces this issue? I don't see anything in the logs. What could also be helpful is enabling either This trace shows the requests going from the client to the Angular language server as well as the response back. If something is breaking there, hopefully we can see it in the output (i.e. messages aren't being sent for some reason). |
Example from 12.0.4 Angular Language Service in the attached project. Global angular tools installed are 12.0.3. Local project version is 11.2.0: I know this because of this warning: To repro, hover over products in product-list.component.html using 12.0.4 of the angular language tools and you won't get any intellisense. Revert back to 11.2.14 and hover over the products item and you will get intellisense when you hover over the "products" variable in product-list.component.html At 11.2.14 hovering over products I see the following: This is the log from 11.2.14 where it works, you can see the output is a bit different: I've also noticed that I can get it to break in 11.2.14 as well by turning on the "angular.experimental-ivy": true flag. Did 12.0.4 of the language service perhaps turn that on by default and might explain why it's broken in 12.0.4, and also broken in 11.2.14 when the IVY flag is turned on? Here are the source files I'm using: |
@xantari yes, Ivy became the default in v12. Can you share your |
@atscott The tsconfig is in the APM.zip project example I attached above. |
same. navigation doesn't work from html to code page. <button (click)="getItems()"> Get Items |
@xantari Ah, I see that now (I was on my phone last night after hours). I'm able to reproduce your issue as well in that project so I will be investigating this today. Thanks! |
Its enabled, i will be able to share a bugged project with you today's night if you still need it. |
@devhus - I think that would be helpful. I have identified the issue with @xantari's project. The first |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…se tag Unclosed element tags are not assigned an `endSourceSpan` by the parser. As a result, the visitor which determines the target node at a position for the language service was unable to determine that a given position was inside an unclosed parent. This happens because we update the `endSourceSpan` of template/element nodes to be the end tag (and there is not one for unclosed tags). Consequently, the visitor then cannot match a position to any child node location. This change updates the visitor logic to check if there are any `children` of a template/element node and updates the end span to be the end span of the last child. This allows our `isWithin` logic to identify that a child position is within the unclosed parent. Addresses one of the issues found during investigation of angular/vscode-ng-language-service#1399
that is a sample project(removed a lot of base code from the original project), it has some memory leak bug as well (in case that was what is causing the issue) |
…se tag Unclosed element tags are not assigned an `endSourceSpan` by the parser. As a result, the visitor which determines the target node at a position for the language service was unable to determine that a given position was inside an unclosed parent. This happens because we update the `endSourceSpan` of template/element nodes to be the end tag (and there is not one for unclosed tags). Consequently, the visitor then cannot match a position to any child node location. This change updates the visitor logic to check if there are any `children` of a template/element node and updates the end span to be the end span of the last child. This allows our `isWithin` logic to identify that a child position is within the unclosed parent. Addresses one of the issues found during investigation of angular/vscode-ng-language-service#1399
@devhus - I played around with the example project and wasn't able to reproduce the issue. There was a fix for autocompletion in the release yesterday. Could you update your extension to see if that resolves your issue? |
…se tag Unclosed element tags are not assigned an `endSourceSpan` by the parser. As a result, the visitor which determines the target node at a position for the language service was unable to determine that a given position was inside an unclosed parent. This happens because we update the `endSourceSpan` of template/element nodes to be the end tag (and there is not one for unclosed tags). Consequently, the visitor then cannot match a position to any child node location. This change updates the visitor logic to check if there are any `children` of a template/element node and updates the end span to be the end span of the last child. This allows our `isWithin` logic to identify that a child position is within the unclosed parent. Addresses one of the issues found during investigation of angular/vscode-ng-language-service#1399
…se tag Unclosed element tags are not assigned an `endSourceSpan` by the parser. As a result, the visitor which determines the target node at a position for the language service was unable to determine that a given position was inside an unclosed parent. This happens because we update the `endSourceSpan` of template/element nodes to be the end tag (and there is not one for unclosed tags). Consequently, the visitor then cannot match a position to any child node location. This change updates the visitor logic to check if there are any `children` of a template/element node and updates the end span to be the end span of the last child. This allows our `isWithin` logic to identify that a child position is within the unclosed parent. Addresses one of the issues found during investigation of angular/vscode-ng-language-service#1399
You need to leave it open for some time. Open the project through |
…se tag (#42554) Unclosed element tags are not assigned an `endSourceSpan` by the parser. As a result, the visitor which determines the target node at a position for the language service was unable to determine that a given position was inside an unclosed parent. This happens because we update the `endSourceSpan` of template/element nodes to be the end tag (and there is not one for unclosed tags). Consequently, the visitor then cannot match a position to any child node location. This change updates the visitor logic to check if there are any `children` of a template/element node and updates the end span to be the end span of the last child. This allows our `isWithin` logic to identify that a child position is within the unclosed parent. Addresses one of the issues found during investigation of angular/vscode-ng-language-service#1399 PR Close #42554
…se tag (#42554) Unclosed element tags are not assigned an `endSourceSpan` by the parser. As a result, the visitor which determines the target node at a position for the language service was unable to determine that a given position was inside an unclosed parent. This happens because we update the `endSourceSpan` of template/element nodes to be the end tag (and there is not one for unclosed tags). Consequently, the visitor then cannot match a position to any child node location. This change updates the visitor logic to check if there are any `children` of a template/element node and updates the end span to be the end span of the last child. This allows our `isWithin` logic to identify that a child position is within the unclosed parent. Addresses one of the issues found during investigation of angular/vscode-ng-language-service#1399 PR Close #42554
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@devhus - I have left the application running with |
Well, do you notice any memory leak in the project? (Nodejs runtime thread in your task manager will have about 1.5GB ram usage as you're serving the project and the memory usage keep increasing until your serve session is crashed) |
@devhus It sounds like this may potentially be angular/angular-cli#20801. If that's the case, then the issue is with the cli and is being tracked there. |
may also be related to #1421 |
After `ngcc` finishes, only enable language service for projects that are open. This avoids an error that would otherwise be thrown by TypeScript. It's not entirely clear what causes the project to close immediately after opening, but it appears to be triggered by having files open from multiple projects. The files not actively being displayed in the editor have their projects closed, but this also only appears to happen after having the editor open for a long time. Fixes angular#1438 Fixes angular#1399 - Not entirely sure this fixes the issue there, but it may and we don't currently have any other indicators for what the issue there might be if the cause is different.
After `ngcc` finishes, only enable language service for projects that are open. This avoids an error that would otherwise be thrown by TypeScript. It's not entirely clear what causes the project to close immediately after opening, but it appears to be triggered by having files open from multiple projects. The files not actively being displayed in the editor have their projects closed, but this also only appears to happen after having the editor open for a long time. Fixes angular#1438 Fixes angular#1399 - Not entirely sure this fixes the issue there, but it may and we don't currently have any other indicators for what the issue there might be if the cause is different.
…1461) After `ngcc` finishes, only enable language service for projects that are open. This avoids an error that would otherwise be thrown by TypeScript. It's not entirely clear what causes the project to close immediately after opening, but it appears to be triggered by having files open from multiple projects. The files not actively being displayed in the editor have their projects closed, but this also only appears to happen after having the editor open for a long time. Fixes #1438 Fixes #1399 - Not entirely sure this fixes the issue there, but it may and we don't currently have any other indicators for what the issue there might be if the cause is different.
…1461) After `ngcc` finishes, only enable language service for projects that are open. This avoids an error that would otherwise be thrown by TypeScript. It's not entirely clear what causes the project to close immediately after opening, but it appears to be triggered by having files open from multiple projects. The files not actively being displayed in the editor have their projects closed, but this also only appears to happen after having the editor open for a long time. Fixes #1438 Fixes #1399 - Not entirely sure this fixes the issue there, but it may and we don't currently have any other indicators for what the issue there might be if the cause is different. (cherry picked from commit 30c4996)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Is this a regression?
Yes, the previous version in which this bug was not present was: 11.2.14Description
Just finished upgrading my project to Angular 12 with the Ng Language Service v12 the IntelliSense starts getting buggy,
After few minutes from Initializing Angular Language Features the awareness of variables and methods in the component's template stopped working
Hovering on a variable shows its type, but trying to get the props of that variable won't show anything like the image below.
Note that, reloading VSCode or restarting it will fix the issue for a few minutes after the extension is initialized, then the issue will start to take effect.
Also enabling the Legacy View Engine option won't fix it, it will even bug it more taking away those few minutes before the issue happens.
Bug Type
Logs
(yes there is a lot of wired white spaces added to the logs for no reason, wasn't me who added it)
nglangsvc.log
nglangsvc.log
Screenshots
when the issue happens and tries to Go to definition of a variable:

🌍 Your Environment
Angular Version:
Extension Version:
VSCode Version:
Operating System:
package.json:
The text was updated successfully, but these errors were encountered: