Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SourceGenerator: Make AnalyzerConfigOptions available in GeneratorInitializationContext #49978

@xoofx

Description

@xoofx

Hey,

I would like to develop a Source Generator that only registers if a certain option (passed from MSBuild) is specified, so that it can completely avoid to RegisterForSyntaxNotifications and would not have any cost to the compilation if it is turned off.

Today, AnalyzerConfigOptions is only accessible from GeneratorExecutionContext, would it be possible to make this accessible to GeneratorInitializationContext as well? Is there any drawbacks in doing this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions