Skip to content

Standardise roslyn on registercompilationstart#6818

Open
metalgearsloth wants to merge 2 commits into
space-wizards:masterfrom
metalgearsloth:2026-07-18-comp-start
Open

Standardise roslyn on registercompilationstart#6818
metalgearsloth wants to merge 2 commits into
space-wizards:masterfrom
metalgearsloth:2026-07-18-comp-start

Conversation

@metalgearsloth

Copy link
Copy Markdown
Contributor

Faster than the generic registeroperationaction.

Builds noisy ah but in dummy runs was anywhere from a second to several seconds faster.

Faster than the generic registeroperationaction
@metalgearsloth

Copy link
Copy Markdown
Contributor Author

@Tayrtahn if my guardian angel is listening.

@Tayrtahn Tayrtahn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I won't be able to actually test these changes for a bit, but this all looks good to me. Good stuff!

if (preferGenericAttribute is null)
return;

var typeTypeSymbol = compilationContext.Compilation.GetTypeByMetadataName("System.Type");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

'tis a bit silly, but make it a const string, please.

context.RegisterOperationAction(Check, OperationKind.PropertyReference);
context.RegisterCompilationStartAction(compilationContext =>
{
var taskType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.Task`1");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Samesies

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