public static ISourceGeneratorLogger GetLogger(this SourceGeneratorContext context) { if (_logger.TryGetValue(context, out var logger)) { return(logger); } throw new InvalidOperationException("The SourceGeneratorContext has not been initialized from a SourceGeneratorHost."); }
public static ProjectInstance GetProjectInstance(this SourceGeneratorContext context) { if (_project.TryGetValue(context, out var instance)) { return(instance); } throw new InvalidOperationException("The SourceGeneratorContext has not been initialized from a SourceGeneratorHost."); }
public static void SetProjectInstance(this SourceGeneratorContext context, ProjectInstance projectInstance) { _project.Add(context, projectInstance); }
public abstract void Execute(SourceGeneratorContext context);
public static void SetLogger(this SourceGeneratorContext context, ISourceGeneratorLogger logger) { _logger.Add(context, logger); }