angular / vscode-ng-language-service

Angular extension for Visual Studio Code
MIT License
779 stars 117 forks source link

Extension causes high cpu load #2037

Closed tanmoy02 closed 5 months ago

tanmoy02 commented 5 months ago

image

Angular.ng-template-unresponsive.cpuprofile.txt

atscott commented 5 months ago

@tanmoy02 Can you provide more information?

tanmoy02 commented 5 months ago

@atscott No, there's no specific workflow to mention. I was working on a service file in my Angular 16 app, and the editor started lagging. After checking the status of running extensions, I noticed that this one and another code completion extension were unresponsive. I disabled the code completion extension first and restarted my editor, but the lag persisted, and this extension was still unresponsive. After disabling all unresponsive extensions, the performance improved slightly. I'm using VS Code (1.89.1).

atscott commented 5 months ago

@tanmoy02 Can you try installing some older versions of the extension? My suspicion is that this happened in 17.3.2 and you won't see the problem in 17.3.1

tanmoy02 commented 5 months ago

@tanmoy02 Can you try installing some older versions of the extension? My suspicion is that this happened in 17.3.2 and you won't see the problem in 17.3.1

Okay, but 17.3.1 is not available, should I install 17.3.0? https://github.com/angular/vscode-ng-language-service/releases

atscott commented 5 months ago

17.3.1 was published to the marketplace (https://marketplace.visualstudio.com/items?itemName=Angular.ng-template). I just forgot to put it in the releases in the repo. But you can try 17.3.0 as well.

ivanwonder commented 5 months ago

The easy way to install the old version is here.

image
tanmoy02 commented 5 months ago

@ivanwonder Thank you for your guidance. @atscott I have installed 17.3.1 from the marketplace & so far it is working without any issues.

atscott commented 5 months ago

@tanmoy02 Okay, thank you for taking a look. @ivanwonder I think sadly we may need to revert https://github.com/angular/vscode-ng-language-service/commit/13d9776143dc6e7941005763a09211e01ed692a5

ivanwonder commented 5 months ago

Yes, Looks like we need to use the incremental parser(ts.updateSourceFile) in the client to fix it, but I do not want to do that in the client. I will revert it first.

angular-automatic-lock-bot[bot] commented 4 months ago

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.