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

Cohosting - Support LSP endpoints #10364

Open davidwengier opened 6 months ago

davidwengier commented 6 months ago

Display

Endpoint Cohosting Calls Roslyn Calls Web Tools Notes
Diagnostics https://github.com/dotnet/razor/issues/10696 / https://github.com/dotnet/razor/pull/10882 Y: https://github.com/dotnet/roslyn/pull/75102 Y Roslyn dependencies are problematic
WorkspaceDiagnostics ✔️ N/A N N Not supported by us
DocumentColor https://github.com/dotnet/razor/pull/10740 N Y ~Not in platform. See AB#2032948~ Fixed with AB#570071
ColorPresentation https://github.com/dotnet/razor/pull/10740 N Y ~Not in platform. See AB#2032948~ Fixed with AB#570071. Not supported in VS
DocumentSymbol https://github.com/dotnet/razor/issues/10689 / https://github.com/dotnet/razor/pull/10728 Y: https://github.com/dotnet/roslyn/pull/74730 N
FoldingRange https://github.com/dotnet/razor/pull/10447 / https://github.com/dotnet/razor/pull/10638 Y: https://github.com/dotnet/roslyn/pull/73609 Y
InlayHints AB#567229 / https://github.com/dotnet/razor/pull/10672 Y: https://github.com/dotnet/roslyn/pull/74548 N
ProjectContext ✔️ N/A N N Roslyn handles this for us
SemanticTokensRange https://github.com/dotnet/razor/pull/10097 / https://github.com/dotnet/razor/pull/10619 Y: https://github.com/dotnet/roslyn/pull/72495 N
SemanticTokensRefresh ✔️ N/A N N Called from an interceptor now. Handled by Roslyn in cohosting
DocumentSpellCheck ✅ #10746 / https://github.com/dotnet/razor/pull/10825 Y: https://github.com/dotnet/roslyn/pull/74978 N
WorkspaceSpellCheck ✔️ N/A N N Not supported by us

Edit

Endpoint Cohosting Calls Roslyn Calls Web Tools Notes
OnAutoInsert ✅ #10630 / https://github.com/dotnet/razor/pull/10674 Y: https://github.com/dotnet/roslyn/pull/73781 Y ~No IBraceCompletionServices in OOP?~ Fixed in https://github.com/dotnet/roslyn/pull/73756
CodeAction ✅ #10742 / https://github.com/dotnet/razor/pull/11147 Y Y
Completion 🔜 https://github.com/dotnet/razor/issues/10697 Y Y Has dependency on CompletionListCache from LSP Services
TextPresentation https://github.com/dotnet/razor/pull/10740 Y Y Not supported in Roslyn
UriPresentation https://github.com/dotnet/razor/pull/10336 / https://github.com/dotnet/razor/pull/10642 Y Y Not supported in Roslyn
DocumentSync ✔️ N/A N N Roslyn handles this for us
Formatting ✅ #10743 /https://github.com/dotnet/razor/pull/10822 N Y Calls Roslyn API
InlineCompletion 🔜 #10744 Y N
LinkedEditingRange https://github.com/dotnet/razor/pull/10349 / https://github.com/dotnet/razor/pull/10596 N N
MapCode 🔜 #10745 Y N
Rename https://github.com/dotnet/razor/issues/10688 / https://github.com/dotnet/razor/pull/10721 Y: https://github.com/dotnet/roslyn/pull/73781 Y
PrepareRename https://github.com/dotnet/roslyn/pull/73781 ? We don't suport this at the moment
WrapWithTag N Y Not in platform
BreakpointSpan N N Calls Roslyn API, but probably needs a re-think in a cohosted world
ProximityExpression N N Calls Roslyn API, but probably needs a re-think in a cohosted world
ValidateBreakpointRange Y N

Navigate

Endpoint Cohosting Calls Roslyn Calls Web Tools Notes
CodeLens Y N We don't support this at the moment. VS doesn't either.
Definition ✅ #10631 / https://github.com/dotnet/razor/pull/10750 Y: https://github.com/dotnet/roslyn/pull/73781 Y ~Needs MetadataAsFileService which needs Workspace~ Fixed in https://github.com/dotnet/roslyn/pull/73781
DocumentHighlight https://github.com/dotnet/razor/pull/10656 Y Y ~Roslyn side isn't in OOP~ No idea why I wrote that.
FindAllReferences Y N Roslyn side has WPF/problematic dependencies
Hover ✅ #10839 / https://github.com/dotnet/razor/pull/11150 Y Y Roslyn side has WPF dependencies
Implementation https://github.com/dotnet/razor/issues/10695 / https://github.com/dotnet/razor/pull/10824 Y: https://github.com/dotnet/roslyn/pull/74978 Y
SignatureHelp https://github.com/dotnet/razor/pull/10595 Y: https://github.com/dotnet/roslyn/pull/73781 Y OOP service uses STJ (see: https://github.com/dotnet/roslyn/pull/74280)

Other

Endpoint Cohosting Calls Roslyn Calls Web Tools Notes
RazorLanguageQuery N N VS Code only. Hopefully unnecessary
RazorMapToDocumentRange N N VS Code only. Hopefully unnecessary
~MonitorConfigurationFilePath~ ✔️ N/A N N Doesn't exist in Razor any more
~ProjectInfo~ ✔️ N/A N N Doesn't exist in Razor any more
ryzngard commented 6 months ago

❓are there any quick and easy ones for those not directly working on cohosting to fill a few hours and get used to the new design?

davidwengier commented 6 months ago

"Quick and easy" is a funny expression. I would say there is a heirachy of ease:

  1. Razor only: Things that have "N" in both Roslyn and Web Tools columns, and therefore have no dependencies outside our repo. Sadly the only two of these left are outside of LSP, so might have other unknown hurdles.
  2. Web Tools only: Things have an "N" in the Roslyn column, but "Y" in Web Tools, means all of the code changes are confined to our repo, since our method of communcation with Web Tools hasn't changed
  3. "Easy" Roslyn: Things have a "Y*" in the Roslyn column, from a cursory look, use only workspace services in Roslyn, so should "just" be a matter of exposing helper methods through our EA, and calling them
  4. Everything else: Things that have a "Y" in the Roslyn column potentially require rework or rearchitecting on the Roslyn side (modulo my understanding of MEF)

Worth noting that 3 and 4 are somewhat blocked on Roslyn LSP types being available to us, too