6 types derived from AdditionalText
Microsoft.Analyzers.Extra.Tests (1)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.Test.Utilities (2)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
242 references to AdditionalText
Microsoft.Analyzers.Extra.Tests (1)
Microsoft.Analyzers.Local (1)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.CodeAnalysis (109)
CommandLine\CommonCompiler.cs (8)
819ImmutableArray<AdditionalText> additionalTexts,
877private protected abstract GeneratorDriver CreateGeneratorDriver(string baseDirectory, ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray<AdditionalText> additionalTexts);
959var additionalTexts = ImmutableArray<AdditionalText>.CastUp(additionalTextFiles);
1019ImmutableArray<AdditionalText> additionalFiles = default,
1058ImmutableArray<AdditionalText> additionalTextFiles,
1099ImmutableArray<AdditionalText> additionalTextFiles,
1544ImmutableArray<AdditionalText> additionalTextFiles,
1746ImmutableArray<AdditionalText> additionalTexts,
DiagnosticAnalyzer\AnalysisResultBuilder.cs (16)
24private static readonly ImmutableDictionary<string, OneOrMany<AdditionalText>> s_emptyPathToAdditionalTextMap =
25ImmutableDictionary<string, OneOrMany<AdditionalText>>.Empty.WithComparers(PathUtilities.Comparer);
32private readonly Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByAdditionalFile;
34private readonly ImmutableDictionary<string, OneOrMany<AdditionalText>> _pathToAdditionalTextMap;
38private Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localAdditionalFileDiagnosticsOpt = null;
41internal AnalysisResultBuilder(bool logAnalyzerExecutionTime, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<AdditionalText> additionalFiles)
47_completedSyntaxAnalyzersByAdditionalFile = new Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>>();
63private static ImmutableDictionary<string, OneOrMany<AdditionalText>> CreatePathToAdditionalTextMap(ImmutableArray<AdditionalText> additionalFiles)
70var builder = ImmutableDictionary.CreateBuilder<string, OneOrMany<AdditionalText>>(PathUtilities.Comparer);
71foreach (var file in additionalFiles)
85value = new OneOrMany<AdditionalText>(file);
305AdditionalText? getAdditionalTextKey(Diagnostic diagnostic)
312foreach (var additionalText in additionalTexts)
463Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics,
505ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics;
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (11)
107_analysisResultBuilder = new AnalysisResultBuilder(analysisOptions.LogAnalyzerExecutionTime, analyzers, _analysisOptions.Options?.AdditionalFiles ?? ImmutableArray<AdditionalText>.Empty);
212private void VerifyAdditionalFile(AdditionalText file)
227private ImmutableArray<AdditionalText> AdditionalFiles => _analysisOptions.Options?.AdditionalFiles ?? ImmutableArray<AdditionalText>.Empty;
520public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, CancellationToken cancellationToken)
535public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
552public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, CancellationToken cancellationToken)
569public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
883ImmutableArray<AdditionalText> additionalFiles,
990ImmutableArray<AdditionalText> additionalFiles,
1042ImmutableArray<AdditionalText> additionalFiles,
Microsoft.CodeAnalysis.CSharp (6)
SourceGeneration\CSharpGeneratorDriver.cs (5)
26/// <param name="additionalTexts">A list of <see cref="AdditionalText"/>s available to generators in this driver.</param>
27internal CSharpGeneratorDriver(CSharpParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, GeneratorDriverOptions driverOptions)
57/// <param name="additionalTexts">A list of <see cref="AdditionalText"/>s available to generators in this driver, or <c>null</c> if there are none.</param>
62public static CSharpGeneratorDriver Create(IEnumerable<ISourceGenerator> generators, IEnumerable<AdditionalText>? additionalTexts = null, CSharpParseOptions? parseOptions = null, AnalyzerConfigOptionsProvider? optionsProvider = null, GeneratorDriverOptions driverOptions = default)
67public static CSharpGeneratorDriver Create(IEnumerable<ISourceGenerator> generators, IEnumerable<AdditionalText>? additionalTexts, CSharpParseOptions? parseOptions, AnalyzerConfigOptionsProvider? optionsProvider)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (20)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (35)
SourceGeneration\GeneratorDriverTests.cs (16)
827var texts = ImmutableArray.Create<AdditionalText>(new InMemoryAdditionalText("a", "abc"), new InMemoryAdditionalText("b", "def"));
829ImmutableArray<AdditionalText> passedIn = default;
839Assert.Equal<AdditionalText>(texts, passedIn);
1778driver = driver.AddAdditionalTexts(ImmutableArray.Create<AdditionalText>(text2));
1984List<AdditionalText> texts = new List<AdditionalText>() { new InMemoryAdditionalText("abc", "") };
1990.WithComparer(new LambdaComparer<(Compilation, ImmutableArray<AdditionalText>)>((c1, c2) => c1.Item1 == c2.Item1, 0))
2015Assert.Equal(texts[0], ((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value)[0]);
2021var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value;
2044Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value);
2050var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value;
2065var value = ((Compilation, ImmutableArray<AdditionalText>))source.Source.Outputs[source.OutputIndex].Value;
2073var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value;
2096Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value);
2102var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value;
3585driver = driver.AddAdditionalTexts(ImmutableArray<AdditionalText>.Empty);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
Microsoft.CodeAnalysis.Rebuild.UnitTests (5)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.UnitTests (12)
InternalUtilities\AdditionalTextComparerTests.cs (10)
16AdditionalText text1 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
17AdditionalText text2 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
26AdditionalText text1 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
27AdditionalText text2 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
41AdditionalText text1 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
42AdditionalText text2 = new InMemoryAdditionalText(@"c:\d\e\f.txt", "abc");
54AdditionalText text1 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
55AdditionalText text2 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "def");
67AdditionalText text1 = new InMemoryAdditionalText(@"c:\a\b\c.txt", "abc");
68AdditionalText text2 = new InMemoryAdditionalText(@"c:\a\B\c.txt", "abc");
Microsoft.CodeAnalysis.VisualBasic (4)
SourceGeneration\VisualBasicGeneratorDriver.vb (3)
22Friend Sub New(parseOptions As VisualBasicParseOptions, generators As ImmutableArray(Of ISourceGenerator), optionsProvider As AnalyzerConfigOptionsProvider, additionalTexts As ImmutableArray(Of AdditionalText), driverOptions As GeneratorDriverOptions)
40Public Shared Function Create(generators As ImmutableArray(Of ISourceGenerator), Optional additionalTexts As ImmutableArray(Of AdditionalText) = Nothing, Optional parseOptions As VisualBasicParseOptions = Nothing, Optional analyzerConfigOptionsProvider As AnalyzerConfigOptionsProvider = Nothing, Optional driverOptions As GeneratorDriverOptions = Nothing) As VisualBasicGeneratorDriver
46Public Shared Function Create(generators As ImmutableArray(Of ISourceGenerator), additionalTexts As ImmutableArray(Of AdditionalText), parseOptions As VisualBasicParseOptions, analyzerConfigOptionsProvider As AnalyzerConfigOptionsProvider) As VisualBasicGeneratorDriver
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces (17)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.DotNet.CodeAnalysis (6)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.ML.AutoML.SourceGenerator (4)
System.Windows.Forms.Analyzers (1)
System.Windows.Forms.Analyzers.CSharp.Tests (1)