Skip to content

Port ComClassGenerator to string writing instead of constructing syntax nodes#125527

Open
DoctorKrolic wants to merge 4 commits intodotnet:mainfrom
DoctorKrolic:com-class-generator-string-writing
Open

Port ComClassGenerator to string writing instead of constructing syntax nodes#125527
DoctorKrolic wants to merge 4 commits intodotnet:mainfrom
DoctorKrolic:com-class-generator-string-writing

Conversation

@DoctorKrolic
Copy link
Contributor

The easiest part of #95882

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 13, 2026
@dotnet-policy-service
Copy link
Contributor

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

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! If you're taking a stab at this work, there's one more piece I'd like to figure out. Can we introduce a new type that doesn't store syntax nodes to handle the containing syntax (such as a type that, given syntax, computes a prefix, indent value to use for contents, and suffix)?

That way we could get to a point where we aren't passing syntax around between steps, as that's one of the main reasons we want to move to strings.

@DoctorKrolic
Copy link
Contributor Author

Can we introduce a new type that doesn't store syntax nodes to handle the containing syntax

I would like to revisit pipeline models after we port all generators to strings. This way I can focus on the "back side" of the pipeline without diving into the data collection part of it. Yes, this generator is the simplest of them, but for others trying to tweak the front and the back side at the same time might be challenging. For the transition period syntax is still a good common denominator since it is both siutable for node construction and string writing due to convinience of To[Full]String(). Porting to strings without changing the models still has value in simplification and reduction of all intermediate node allocations

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

Labels

area-System.Runtime.InteropServices community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants