microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.02k stars 12.49k forks source link

IntelliSense hangs after Find All References in VS 2022. Solution with many projects. #54277

Closed olmobrutall closed 1 year ago

olmobrutall commented 1 year ago

Bug Report

Executing Find All References in a highly referenced project hangs VS IntelliSense, making all the TS language services unusable until VS is restarted.

🔎 Search Terms

Visual Studio 2022, Find All References, Multi-Project

🕗 Version & Regression Information

Microsoft.TypeScript.MSBuild 5.0.4

The problem started after a reform that splitted three big projects into 50 smaller ones.

⏯ Playground Link

Unfortunately the issue only appears on solutions on many projects (maybe some O(N^2) algorithm?), so it can not be reproduced with a TypeScript Playground.

On the other side, the project is OpenSource and hosted in GitHub.

Steps to reproduce:

🙁 Actual behavior

The progress indicator in le botom-left corner hangs forever in one of the extension projects (typically Signum.Alerts or Signum.Authorization, but could be any...)

image

This task can not be cancelled in any way and while in this state, all the TypeScript services are unresponsive.

The only solution is a VS restart.

🙂 Expected behavior

The task is able to finish or at least is cancelable.

goldenauge commented 1 year ago

Same issue here!

olmobrutall commented 1 year ago

Looks like this is stale...

Please some attention... we have to restart VS 2022 a few times every day because of this issue. image

joj commented 1 year ago

@armanio123 maybe you can take a look as part of your current FAR investigation?

@olmobrutall are your projects mostly combined C# and TS, using the TypeScript Nuget?

olmobrutall commented 1 year ago

@joj Yes are many C# project (about 40) using TypeScript Nuget in Visual Studio.

Is the same solution related to this other issue where we also worked together: https://github.com/microsoft/TypeScript/issues/53795

Unfortunately in this case is not something that can be reproduced with an small new project.

In the branch ts_hang I have removed some custom Nuget that do C# -> TypeScript magic and some IL rewriting to better isolate the problem.

olmobrutall commented 1 year ago

I've found that VS Code is much faster on this, but only looks in the current project not in all the solution... maybe an option to enable this in Visual Studio could make sense?

mehdy-karimpour commented 1 year ago

I have same issue!

rezanos commented 1 year ago

same issue here! so annoying 😩

olmobrutall commented 1 year ago

Problem is solved in VS 2022 after installing Microsoft.TypeScript.MSBuild 5.2.2.

Now the behaviour is like in VS Code: Project-wide (instead of solution-wide) but very fast.

Thank a lot!