dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
505 stars 195 forks source link

razor/mapToDocumentRanges hangs when called via Roslyn.CodeActionResolve -> CSharpSpanMappingService #4642

Open TanayParikh opened 3 years ago

TanayParikh commented 3 years ago

Extension of https://github.com/dotnet/aspnetcore/issues/27825.

So that https://github.com/dotnet/roslyn/pull/49592 can be reverted.

Occurs when a code action is attempted to be resolved. Ex.

@Debugger.Launch()

you select the lightbulb and hover over @using System.Diagnostics you get a spinning circle instead of the preview.

Issue is related to Razor calling textDocument/codeActionResolve to Roslyn, and then Roslyn calling for CSharpSpanMappingService.MapSpansAsync which in turn calls for razor/mapToDocumentRanges. This razor/mapToDocumentRanges request is what's hanging.

TanayParikh commented 3 years ago

This issue requires further investigation, I haven't had luck and I believe it may benefit from a fresh pair of eyes if someone has the bandwidth. I can go over what I've tried and how to setup the repro env offline.

TanayParikh commented 3 years ago

Needs another eye on this.