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

Source generator wishlist #77371

Open
9 tasks
davhdavh opened this issue Feb 28, 2025 · 0 comments
Open
9 tasks

Source generator wishlist #77371

davhdavh opened this issue Feb 28, 2025 · 0 comments
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@davhdavh
Copy link

davhdavh commented Feb 28, 2025

In no particular order, a wish list to make it easier to write a source generator:

  • GeneratorAttributeSyntaxContext has a member that provides a suggestion for the hintName used in AddSource - its a pita to ensure things are not duplicate named and doesn't exceed the 254 windows path limit
  • Location has a AllLocationAreEqualWrapper, so that memoization doesn't care about where things are if a Location is in the pipeline
  • GeneratorAttributeSyntaxContext has Location for easy error reporting
  • Memoization algorithm uses IStructuralEquatable if available, its a pita to have to wrap all collections
  • GeneratorAttributeSyntaxContext has Built-in helper to get all settings from attribute mapped to a settings object that matches the attribute
  • GeneratorAttributeSyntaxContext has Built-in helper to check partial keyword in chain and get the declaration list for the output (ofcourse in a collection type that uses sequenceequals)
  • AdditionalText has helper to find "parent" file if DependentUpon is set and/or way to group AdditionalText to the parent
  • That "commandName": "DebugRoslynComponent", would run each rule TWICE and give error if it was uncached (ie, you fed up the compare)
  • A well documented way to include the attribute in the nuget
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant