22 references to AddSource
Microsoft.CodeAnalysis (3)
SourceGeneration\GeneratorContexts.cs (1)
82public void AddSource(string hintName, string source) => AddSource(hintName, SourceText.From(source, Encoding.UTF8));
SourceGeneration\ISourceGenerator.cs (1)
36/// to add source files via the <see cref="GeneratorExecutionContext.AddSource(string, SourceText)"/>
SourceGeneration\RunResults.cs (1)
163/// Represents the results of an <see cref="ISourceGenerator"/> calling <see cref="GeneratorExecutionContext.AddSource(string, SourceText)"/>.
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (11)
SourceGeneration\GeneratorDriverTests.cs (8)
460sgc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8)); 463Assert.Throws<ArgumentException>("hintName", () => sgc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8))); 466Assert.Throws<ArgumentException>("hintName", () => sgc.AddSource("test.cs", SourceText.From("public class D{}", Encoding.UTF8))); 586var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.AddSource("test", SourceText.From("public class D {}", Encoding.UTF8)); }); 616var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.AddSource("test", SourceText.From("public class D {}", Encoding.UTF8)); sgc.AddSource("test2", SourceText.From("public class E {}", Encoding.UTF8)); }); 756e.AddSource("a", SourceText.From("public class E {}", Encoding.UTF8)); 780var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.AddSource("a", SourceText.From("")); });
SourceGeneration\SyntaxAwareGeneratorTests.cs (3)
420onExecute: (e) => { e.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8)); } 510onExecute: (e) => { receiver = e.SyntaxReceiver; e.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8)); } 2052onExecute: (e) => { e.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8)); }
Microsoft.CodeAnalysis.Test.Utilities (1)
SourceGeneration\TestGenerators.cs (1)
40context.AddSource(hintName, SourceText.From(content, Encoding.UTF8));
Microsoft.CodeAnalysis.TestAnalyzerReference (3)
HelloWorldGenerator.cs (3)
27context.AddSource(GeneratedEnglishClassName, SourceText.From($$""" 38context.AddSource(GeneratedSpanishClassName, SourceText.From($$""" 48context.AddSource(GeneratedEnglishClassName + "WithTime", SourceText.From($$"""
Microsoft.ML.AutoML.SourceGenerator (3)
EstimatorTypeGenerator.cs (1)
53context.AddSource(className + ".cs", SourceText.From(code.TransformText(), Encoding.UTF8));
SweepableEstimatorFactoryGenerator.cs (1)
48context.AddSource(className + ".cs", SourceText.From(code.TransformText(), Encoding.UTF8));
SweepableEstimatorGenerator.cs (1)
73context.AddSource(c.Item1 + ".cs", SourceText.From(c.Item2, Encoding.UTF8));
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Roslyn3.11.cs (1)
156=> _context.AddSource(hintName, sourceText);