Skip to content

Remove SyntaxTree rooting from interop source generators #83870

Open

Description

@jkoritzinsky

In the interop source generators, we root the syntax tree with our Location objects we propagate for diagnostic reporting. We should use the tricks used in #83868 to create Location objects that don't root SyntaxTree objects to reduce the places we root Roslyn object inputs.

Activity

  1. ghost added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Mar 24, 2023
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Mar 24, 2023
  3. added
    source-generatorIndicates an issue with a source generator feature
    and removed
    untriagedNew issue has not been triaged by the area owner
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Mar 24, 2023
  4. added this to the 8.0.0 milestone on Mar 24, 2023
  5. Sergio0694 commented on Mar 26, 2023

    @Sergio0694
    Contributor

    Related: could we consider trying to push to get dotnet/roslyn#63776 implemented, especially since you also mentioned you'd be able to contribute the feature yourself assuming it got approved? Using those APIs would completely solve this issue while also allowing both these source generators and the regex ones to be simplified quite a bit, due to no longer having to maintain that very awkward tuple-return-and-branch pattern to return diagnostics and immediately redirect them to an output node before getting just the incremental models to continue down the pipeline.

    As a nice side benefit, they'd also be a set of APIs that'd greatly benefit a ton of other generators out there and not just the ones in the runtime (eg. ours in the MVVM Toolkit, as well as those in ComputeSharp, etc.), which is also nice on its own.

    What do you think? 🙂

  6. modified the milestones: 8.0.0, 9.0.0 on Jul 26, 2023
  7. modified the milestones: 9.0.0, 10.0.0 on Jun 20, 2024
  8. modified the milestones: 10.0.0, 11.0.0 on Jun 12, 2025
  9. dotnet-policy-service commented on Apr 13, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/interop-contrib
    See info in area-owners.md if you want to be subscribed.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions