Skip to content

Conversation

@chsienki
Copy link
Member

  • Introduce a new creation policy that runs only 'required' generators
  • Add a generator filter that hard codes razor to run in the required policy mode

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 20, 2025

/// <summary>
/// Source generators should not run. Whatever results were previously computed should be reused.
/// </summary>
Copy link
Member

Choose a reason for hiding this comment

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

why not just do 'DoNotCreate_ExceptRequired' (for the value below). i'm not sure we want/need 3 values. just that the second value shoudl always run razor(if you're saying it is always necessary for razor to run).

Copy link
Member Author

Choose a reason for hiding this comment

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

So that's what I was originally going to do. But when running in a debugger it seemed like the DoNotCreate path was always run after the create path, even in Automatic mode. That suggested to me that it was still going to be required? In theory we could re-run razor and it should just be a no-op?

I do not know/understand the intricacies of when this code gets called to know well enough if that would still be acceptable :)

- Introduce a new creation policy that runs only 'required' generators
- Add a generator filter that hard codes razor to run in the required policy mode
@chsienki chsienki force-pushed the razor_gen_always_run branch 2 times, most recently from 3f74b01 to f302e47 Compare July 2, 2025 17:31
@chsienki chsienki closed this Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants