Skip to content

[Sonic] Remove DesignTime ability and suppression from source generator#12847

Draft
chsienki wants to merge 2 commits intodotnet:mainfrom
chsienki:sonic/1_generator_cleanup
Draft

[Sonic] Remove DesignTime ability and suppression from source generator#12847
chsienki wants to merge 2 commits intodotnet:mainfrom
chsienki:sonic/1_generator_cleanup

Conversation

@chsienki
Copy link
Member

@chsienki chsienki commented Feb 27, 2026

Cleanup the source generator:

  • Remove the ability to produce design time documents

    • This was never actually used in production anyway
  • Remove the ability to suppress the generator:

    • With cohosting we never suppress the generator
    • Removed the associated voodoo code that made suppression work
    • Remove tests that check for suppression

These are in two commits so probably easiest to review each one. There is a bunch of white space change too where indentation changed so probably want to ignore whitespace in the diffs.

@chsienki chsienki changed the title [SonicRemove DesignTime ability and suppression from source generator [Sonic] Remove DesignTime ability and suppression from source generator Feb 27, 2026
@chsienki chsienki force-pushed the sonic/1_generator_cleanup branch from 7fbc887 to 319159c Compare February 27, 2026 23:38
var metadataRefs = context.MetadataReferencesProvider;

// We might get initialized before razor tooling has a chance to set this, so check it any time something changes. It's extremely cheap and we'll stop propagating directly below if it didn't changed.
var useRazorCohostServer = context.AdditionalTextsProvider.Collect().Combine(context.CompilationProvider).Select((_, _) => RazorCohostingOptions.UseRazorCohostServer);
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove this too while you're in here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants