22 references to AddSource
Microsoft.CodeAnalysis (3)
SourceGeneration\GeneratorContexts.cs (1)
82
public 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)
460
sgc.
AddSource
("test", SourceText.From("public class D{}", Encoding.UTF8));
463
Assert.Throws<ArgumentException>("hintName", () => sgc.
AddSource
("test", SourceText.From("public class D{}", Encoding.UTF8)));
466
Assert.Throws<ArgumentException>("hintName", () => sgc.
AddSource
("test.cs", SourceText.From("public class D{}", Encoding.UTF8)));
586
var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.
AddSource
("test", SourceText.From("public class D {}", Encoding.UTF8)); });
616
var 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)); });
756
e.
AddSource
("a", SourceText.From("public class E {}", Encoding.UTF8));
780
var generator = new CallbackGenerator((ic) => { }, (sgc) => { sgc.
AddSource
("a", SourceText.From("")); });
SourceGeneration\SyntaxAwareGeneratorTests.cs (3)
420
onExecute: (e) => { e.
AddSource
("test", SourceText.From("public class D{}", Encoding.UTF8)); }
510
onExecute: (e) => { receiver = e.SyntaxReceiver; e.
AddSource
("test", SourceText.From("public class D{}", Encoding.UTF8)); }
2052
onExecute: (e) => { e.
AddSource
("test", SourceText.From("public class D{}", Encoding.UTF8)); }
Microsoft.CodeAnalysis.Test.Utilities (1)
SourceGeneration\TestGenerators.cs (1)
40
context.
AddSource
(hintName, SourceText.From(content, Encoding.UTF8));
Microsoft.CodeAnalysis.TestAnalyzerReference (3)
HelloWorldGenerator.cs (3)
27
context.
AddSource
(GeneratedEnglishClassName, SourceText.From($$"""
38
context.
AddSource
(GeneratedSpanishClassName, SourceText.From($$"""
48
context.
AddSource
(GeneratedEnglishClassName + "WithTime", SourceText.From($$"""
Microsoft.ML.AutoML.SourceGenerator (3)
EstimatorTypeGenerator.cs (1)
53
context.
AddSource
(className + ".cs", SourceText.From(code.TransformText(), Encoding.UTF8));
SweepableEstimatorFactoryGenerator.cs (1)
48
context.
AddSource
(className + ".cs", SourceText.From(code.TransformText(), Encoding.UTF8));
SweepableEstimatorGenerator.cs (1)
73
context.
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);