Skip to content
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

Razor/Roslyn Cohosting: Use #line directives instead of ISpanMappingService #72136

Open
11 tasks
davidwengier opened this issue Feb 16, 2024 · 1 comment
Open
11 tasks
Assignees
Milestone

Comments

@davidwengier
Copy link
Contributor

davidwengier commented Feb 16, 2024

Currently Razor tooling provides an implementation of ISpanMappingService, and various features in Roslyn call into it in order to map locations in Razor generated C# code, back to the originating .razor or .cshtml file. With cohosting, we want to remove the need for this service and have Roslyn honour #line directives instead. Some of all of these items could potentially be limited to only supporting enhanced line directives, to ensure full fidelity of results. Further, it might be desirable to only support #line directives if there isn't an ISpanMappingService for the document in question, to allow venus/legacy Razor editor to be unaffected.

Things that might need specific changes

Things that can be changed to use line directives
(with varying degrees of difficulty, and appropriate API changes to ensure relevant Location data is available)

  • RemoteCodeLensReferencesService.FixUpDescriptorsAsync

  • VisualStudioDocumentNavigationService.GetNavigationCallbackAsync

  • VisualStudioWorkspaceImpl.ShouldApplyChangesToMappedDocuments

    • called from VisualStudioWorkspaceImpl.GetMappedTextChangesAsync
      • called from VisualStudioWorkspaceImpl.ApplyMappedFileChanges
  • ProtocolConversions.GetMappedSpanResultAsync

    • called from ProtocolConversions.ChangedDocumentsToTextDocumentEditsAsync
      • called from RenameHandler.HandleRequestAsync
    • called from ProtocolConversions.TextSpanToLocationAsync
      • called from WorkspaceSymbolsHandler.AddItemAsync
      • called from AbstractGoToDefinitionHandler.GetDefinitionAsync
  • AbstractDocumentSpanEntry.TryMapAndGetFirstAsync

Part of dotnet/razor#9519

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 16, 2024
@arunchndr arunchndr added Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 11, 2024
@arunchndr arunchndr added this to the 17.12 milestone Jun 11, 2024
@arunchndr
Copy link
Member

Parking on Cyrus for now. But based on his availability, we can move to another LSP owner (David/Joey) within Roslyn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants