6 types derived from AdditionalText
Microsoft.Analyzers.Extra.Tests (1)
Resources\FileVisibleToAnalyzer.cs (1)
15internal class FileVisibleToAnalyzer : AdditionalText
Microsoft.Analyzers.Local.Tests (1)
Resources\FileVisibleToAnalyzer.cs (1)
15internal class FileVisibleToAnalyzer : AdditionalText
Microsoft.CodeAnalysis (1)
AdditionalTextFile.cs (1)
16internal sealed class AdditionalTextFile : AdditionalText
Microsoft.CodeAnalysis.Test.Utilities (2)
Mocks\TestAdditionalText.cs (1)
12public sealed class TestAdditionalText : AdditionalText
SourceGeneration\TestGenerators.cs (1)
138internal class InMemoryAdditionalText : AdditionalText
System.Windows.Forms.Analyzers.CSharp.Tests (1)
TestAdditionalText.cs (1)
16public sealed class TestAdditionalText : AdditionalText
242 references to AdditionalText
Microsoft.Analyzers.Extra.Tests (1)
Resources\AnalyzerOptionsFactory.cs (1)
16var files = fileNames.Select(name => (AdditionalText)new FileVisibleToAnalyzer(name)).ToArray();
Microsoft.Analyzers.Local (1)
ApiLifecycle\ModelLoader.cs (1)
26var assemblyBaselineFile = files.FirstOrDefault(file =>
Microsoft.Analyzers.Local.Tests (1)
Resources\AnalyzerOptionsFactory.cs (1)
16var files = fileNames.Select(name => (AdditionalText)new FileVisibleToAnalyzer(name)).ToArray();
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,
Compilation\Compilation.cs (2)
199ImmutableArray<AdditionalText> additionalTexts = default, 211ImmutableArray<AdditionalText> additionalTexts = default,
Compilation\DeterministicKey.cs (2)
55ImmutableArray<AdditionalText> additionalTexts = default, 82ImmutableArray<AdditionalText> additionalTexts = default,
Compilation\DeterministicKeyBuilder.cs (2)
125ImmutableArray<AdditionalText> additionalTexts, 159foreach (var additionalText in additionalTexts)
DiagnosticAnalyzer\AdditionalTextComparer.cs (5)
14internal sealed class AdditionalTextComparer : IEqualityComparer<AdditionalText> 18public bool Equals(AdditionalText? x, AdditionalText? y) 53public int GetHashCode(AdditionalText obj) 59private static SourceText? GetTextOrNullIfBinary(AdditionalText text)
DiagnosticAnalyzer\AdditionalTextValueProvider.cs (9)
11/// Provides custom values associated with <see cref="AdditionalText"/> instances using the given computeValue delegate. 15internal readonly AnalysisValueProvider<AdditionalText, TValue> CoreValueProvider; 18/// Provides custom values associated with <see cref="AdditionalText"/> instances using the given <paramref name="computeValue"/>. 20/// <param name="computeValue">Delegate to compute the value associated with a given <see cref="AdditionalText"/> instance.</param> 21/// <param name="additionalTextComparer">Optional equality comparer to determine equivalent <see cref="AdditionalText"/> instances that have the same value. 23public AdditionalTextValueProvider(Func<AdditionalText, TValue> computeValue, IEqualityComparer<AdditionalText>? additionalTextComparer = null) 25CoreValueProvider = new AnalysisValueProvider<AdditionalText, TValue>(computeValue, additionalTextComparer ?? EqualityComparer<AdditionalText>.Default);
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
102sb.AppendLine($"{nameof(AdditionalText)}: {_file.Value.AdditionalFile.Path}");
DiagnosticAnalyzer\AnalysisResult.cs (2)
25ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics, 55public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> AdditionalFileDiagnostics { get; }
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\AnalysisScope.cs (5)
60public ImmutableArray<AdditionalText> AdditionalFiles { get; } 111var additionalFiles = analyzerOptions?.AdditionalFiles ?? ImmutableArray<AdditionalText>.Empty; 124var additionalFiles = filterFile.AdditionalFile != null ? ImmutableArray.Create(filterFile.AdditionalFile) : ImmutableArray<AdditionalText>.Empty; 132ImmutableArray<AdditionalText> additionalFiles, 231public bool ShouldAnalyze(AdditionalText file)
DiagnosticAnalyzer\AnalyzerConfigOptionsProvider.cs (2)
23/// Get options for a given <see cref="AdditionalText"/> 25public abstract AnalyzerConfigOptions GetOptions(AdditionalText textFile);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
775foreach (var additionalFile in analysisScope.AdditionalFiles)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
612var additionalFile = file.AdditionalFile;
DiagnosticAnalyzer\AnalyzerOptions.cs (6)
17internal static readonly AnalyzerOptions Empty = new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty); 22public ImmutableArray<AdditionalText> AdditionalFiles { get; } 25/// A set of options keyed to <see cref="SyntaxTree"/> or <see cref="AdditionalText"/>. 34public AnalyzerOptions(ImmutableArray<AdditionalText> additionalFiles, AnalyzerConfigOptionsProvider optionsProvider) 49public AnalyzerOptions(ImmutableArray<AdditionalText> additionalFiles) 56public AnalyzerOptions WithAdditionalFiles(ImmutableArray<AdditionalText> additionalFiles)
DiagnosticAnalyzer\CompilationStartedEvent.cs (4)
14public ImmutableArray<AdditionalText> AdditionalFiles { get; } 16private CompilationStartedEvent(Compilation compilation, ImmutableArray<AdditionalText> additionalFiles) 23: this(compilation, ImmutableArray<AdditionalText>.Empty) 32public CompilationStartedEvent WithAdditionalFiles(ImmutableArray<AdditionalText> additionalFiles)
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,
DiagnosticAnalyzer\CompilerAnalyzerConfigOptionsProvider.cs (1)
31public override AnalyzerConfigOptions GetOptions(AdditionalText textFile)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (12)
124/// An additional file action reports <see cref="Diagnostic"/>s about the <see cref="AdditionalText"/> of a document. 252/// <param name="text"><see cref="AdditionalText"/> for which the value is queried.</param> 256public bool TryGetValue<TValue>(AdditionalText text, AdditionalTextValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 440/// An additional file action reports <see cref="Diagnostic"/>s about the <see cref="AdditionalText"/> of a document. 516/// <param name="text"><see cref="AdditionalText"/> instance for which the value is queried.</param> 520public bool TryGetValue<TValue>(AdditionalText text, AdditionalTextValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 638/// <param name="text"><see cref="AdditionalText"/> for which the value is queried.</param> 642public bool TryGetValue<TValue>(AdditionalText text, AdditionalTextValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 1587/// An additional file action can use an <see cref="AdditionalFileAnalysisContext"/> to report <see cref="Diagnostic"/>s about a non-source <see cref="AdditionalText"/> document. 1595/// <see cref="AdditionalText"/> that is the subject of the analysis. 1597public AdditionalText AdditionalFile { get; } 1622AdditionalText additionalFile,
DiagnosticAnalyzer\SourceOrAdditionalFile.cs (2)
19public AdditionalText? AdditionalFile { get; } 27public SourceOrAdditionalFile(AdditionalText file)
SourceGeneration\GeneratorAdaptor.cs (1)
81public ImmutableArray<AdditionalText> AdditionalTexts;
SourceGeneration\GeneratorContexts.cs (2)
24internal GeneratorExecutionContext(Compilation compilation, ParseOptions parseOptions, ImmutableArray<AdditionalText> additionalTexts, AnalyzerConfigOptionsProvider optionsProvider, ISyntaxContextReceiver? syntaxReceiver, string sourceExtension, CancellationToken cancellationToken = default) 55public ImmutableArray<AdditionalText> AdditionalFiles { get; }
SourceGeneration\GeneratorDriver.cs (6)
37internal GeneratorDriver(ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, GeneratorDriverOptions driverOptions) 135public GeneratorDriver AddAdditionalTexts(ImmutableArray<AdditionalText> additionalTexts) 141public GeneratorDriver RemoveAdditionalTexts(ImmutableArray<AdditionalText> additionalTexts) 147public GeneratorDriver ReplaceAdditionalText(AdditionalText oldText, AdditionalText newText) 162public GeneratorDriver ReplaceAdditionalTexts(ImmutableArray<AdditionalText> newTexts) => FromState(_state.With(additionalTexts: newTexts));
SourceGeneration\GeneratorDriverState.cs (4)
18ImmutableArray<AdditionalText> additionalTexts, 69/// The set of <see cref="AdditionalText"/>s available to source generators during a run 71internal readonly ImmutableArray<AdditionalText> AdditionalTexts; 109ImmutableArray<AdditionalText>? additionalTexts = null,
SourceGeneration\IncrementalContexts.cs (2)
62public IncrementalValuesProvider<AdditionalText> AdditionalTextsProvider => new IncrementalValuesProvider<AdditionalText>(SharedInputNodes.AdditionalTexts.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.AdditionalTexts), CatchAnalyzerExceptions);
SourceGeneration\Nodes\SharedInputNodes.cs (2)
24public static readonly InputNode<AdditionalText> AdditionalTexts = new InputNode<AdditionalText>(b => b.DriverState.AdditionalTexts);
Microsoft.CodeAnalysis.CSharp (6)
CommandLine\CSharpCompiler.cs (1)
376private protected override GeneratorDriver CreateGeneratorDriver(string baseDirectory, ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray<AdditionalText> additionalTexts)
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)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
166var options = new AnalyzerOptions(ImmutableArray.Create<AdditionalText>(additionalText));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (20)
Diagnostics\DiagnosticAnalyzerTests.AllInOne.cs (3)
41var options = new AnalyzerOptions(new[] { new TestAdditionalText() }.ToImmutableArray<AdditionalText>()); 102var options = new AnalyzerOptions(new[] { new TestAdditionalText() }.ToImmutableArray<AdditionalText>()); 114new[] { new TestAdditionalText("myfilepath", text) }.ToImmutableArray<AdditionalText>()
Diagnostics\DiagnosticAnalyzerTests.cs (11)
1532var analyzerOptions = new AnalyzerOptions(additionalFiles: ImmutableArray<AdditionalText>.Empty, analyzerConfigOptionsProvider); 3607new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty)); 3883AdditionalText additionalFile = new TestAdditionalText("Additional File Text"); 3921AdditionalText additionalFile1 = new TestAdditionalText("Additional File1 Text", path: path1); 3922AdditionalText additionalFile2 = new TestAdditionalText("Additional File2 Text", path: path2); 3958ImmutableArray<AdditionalText> additionalFiles, 3965foreach (var additionalFile in additionalFiles) 3999ImmutableArray<AdditionalText> additionalFiles, 4012foreach (var additionalFile in additionalFiles) 4021static ImmutableArray<Diagnostic> getReportedDiagnostics(AnalysisResult analysisResult, DiagnosticAnalyzer analyzer, AdditionalText additionalFile) 4316var analyzerOptions = new AnalyzerOptions(ImmutableArray.Create<AdditionalText>(additionalTextFile));
Diagnostics\GetDiagnosticsTests.cs (6)
553var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty)); 562var analyzerOptions = new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty, analyzerConfigOptionsProvider); 608analyzerOptions = new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty, analyzerConfigOptionsProvider); 665new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty), 718new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty), 747new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (35)
SourceGeneration\GeneratorDriverFuzzTests.cs (18)
77public abstract IncrementalValuesProvider<AdditionalText> Apply(IncrementalValuesProvider<AdditionalText> provider); 85public override IncrementalValuesProvider<AdditionalText> Apply(IncrementalValuesProvider<AdditionalText> provider) 87var provider1 = provider.Select((additionalText, _) => (AdditionalText)new InMemoryAdditionalText(additionalText.Path, additionalText.GetText()!.ToString() switch 124public override IncrementalValuesProvider<AdditionalText> Apply(IncrementalValuesProvider<AdditionalText> provider) 127Logics.Select(logic => (AdditionalText)new InMemoryAdditionalText(HintNameProvider.GetNextHintName(), additionalText.GetText()!.ToString() switch 162public override IncrementalValuesProvider<AdditionalText> Apply(IncrementalValuesProvider<AdditionalText> provider) 211public override IncrementalValuesProvider<AdditionalText> Apply(IncrementalValuesProvider<AdditionalText> provider) 216=> (AdditionalText)new InMemoryAdditionalText( 244public override IncrementalValuesProvider<AdditionalText> Apply(IncrementalValuesProvider<AdditionalText> provider) => provider; 315driver1 = driver1.ReplaceAdditionalTexts(editedInputs.ToImmutableArray<AdditionalText>()); 525var editedInputs = ImmutableArray.Create(new AdditionalText[] 553}.Select(logic => (AdditionalText)new InMemoryAdditionalText(hintNameProvider.GetNextHintName(), additionalText.GetText()!.ToString() switch
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);
SourceGeneration\StateTableTests.cs (1)
1351ImmutableArray<AdditionalText>.Empty,
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
MockCSharpCompiler.cs (1)
95ImmutableArray<AdditionalText> additionalTextFiles,
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
56GeneratorDriver ICompilationFactoryService.CreateGeneratorDriver(ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, string? generatedFilesBaseDirectory)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Preview\PreviewWorkspaceTests.cs (1)
165var analyzerOptions = new AnalyzerOptions(additionalFiles: ImmutableArray<AdditionalText>.Empty);
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestAnalyzerConfigOptionsProvider.cs (1)
20public override AnalyzerConfigOptions GetOptions(AdditionalText textFile)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
405foreach (var additionalFile in context.AdditionalFiles)
Microsoft.CodeAnalysis.Rebuild.UnitTests (5)
BasicDeterministicKeyBuilderTests.cs (1)
91var key = compilation.GetDeterministicKey(additionalTexts: ImmutableArray.Create<AdditionalText>(additionalText));
CSharpDeterministicKeyBuilderTests.cs (1)
196var key = compilation.GetDeterministicKey(additionalTexts: ImmutableArray.Create<AdditionalText>(additionalText));
DeterministicKeyBuilderTests.cs (3)
221protected static JArray GetAdditionalTextValues(Compilation compilation, ImmutableArray<AdditionalText> additionalTexts, ImmutableArray<KeyValuePair<string, string>> pathMap = default) 735ImmutableArray.Create<AdditionalText>(additionalText), 760ImmutableArray.Create<AdditionalText>(additionalText));
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
3094public AdditionalText CallbackFilterFile { get; private set; }
Microsoft.CodeAnalysis.UnitTests (12)
Diagnostics\AnalysisContextInfoTests.cs (1)
29var options = new AnalyzerOptions(new[] { new TestAdditionalText() }.ToImmutableArray<AdditionalText>());
Diagnostics\CompilationWithAnalyzersTests.cs (1)
61var analyzerOptions = new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty);
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)
CommandLine\VisualBasicCompiler.vb (1)
300Private Protected Overrides Function CreateGeneratorDriver(baseDirectory As String, parseOptions As ParseOptions, generators As ImmutableArray(Of ISourceGenerator), analyzerConfigOptionsProvider As AnalyzerConfigOptionsProvider, additionalTexts As ImmutableArray(Of AdditionalText)) As GeneratorDriver
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)
Diagnostics\DiagnosticAnalyzerTests.AllInOne.vb (3)
22Dim options = New AnalyzerOptions({DirectCast(New TestAdditionalText(), AdditionalText)}.ToImmutableArray()) 48Dim options = New AnalyzerOptions({CType(new TestAdditionalText(), AdditionalText)}.ToImmutableArray()) 56Dim additionalTexts As AdditionalText() = {New TestAdditionalText("myfilepath", sourceText)}
Diagnostics\DiagnosticAnalyzerTests.vb (2)
1655Dim additionalFile As AdditionalText = New TestAdditionalText("Additional File Text") 1676additionalFile As AdditionalText)
SourceGeneration\GeneratorDriverTests.vb (1)
51additionalTexts:=ImmutableArray.Create(Of AdditionalText)(additionalText),
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
MockVisualBasicCompiler.vb (1)
84additionalTextFiles As ImmutableArray(Of AdditionalText),
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Workspace\LanguageServices\VisualBasicCompilationFactoryService.vb (1)
67additionalTexts As ImmutableArray(Of AdditionalText),
Microsoft.CodeAnalysis.Workspaces (17)
Diagnostics\CompilationWithAnalyzersPair.cs (1)
93public async Task<(AnalysisResult? projectAnalysisResult, AnalysisResult? hostAnalysisResult)> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
Diagnostics\DocumentAnalysisScope.cs (5)
19private readonly Lazy<AdditionalText> _lazyAdditionalFile; 39_lazyAdditionalFile = new Lazy<AdditionalText>(ComputeAdditionalFile); 49/// Gets the <see cref="AdditionalText"/> corresponding to the <see cref="TextDocument"/>. 52public AdditionalText AdditionalFile => _lazyAdditionalFile.Value; 54private AdditionalText ComputeAdditionalFile()
Diagnostics\Extensions.cs (1)
114AdditionalText? additionalFileToAnalyze = null;
Shared\Extensions\ProjectExtensions.cs (1)
28internal static DocumentId? GetDocumentForFile(this Project project, AdditionalText additionalText)
Workspace\Host\CompilationFactory\ICompilationFactoryService.cs (1)
18GeneratorDriver CreateGeneratorDriver(ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, string? generatedFilesBaseDirectory);
Workspace\Solution\AdditionalDocumentState.cs (1)
13public readonly AdditionalText AdditionalText;
Workspace\Solution\AdditionalTextWithState.cs (2)
12/// An implementation of <see cref="AdditionalText"/> for the compiler that wraps a <see cref="AdditionalDocumentState"/>. 17internal sealed class AdditionalTextWithState(AdditionalDocumentState documentState) : AdditionalText
Workspace\Solution\ProjectState.cs (4)
62private ImmutableArray<AdditionalText> _lazyAdditionalFiles; 299private ImmutableArray<AdditionalText> AdditionalFiles 396public override AnalyzerConfigOptions GetOptions(AdditionalText textFile) 475public override AnalyzerConfigOptions GetOptions(AdditionalText textFile)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
416var additionalTexts = (ImmutableArray<AdditionalText>)additionalTextsMember.GetValue(state)!;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
26private static SourceText GenerateSourceForAdditionalFile(AdditionalText file, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (1)
58GeneratorDriver ICompilationFactoryService.CreateGeneratorDriver(ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, string? generatedFilesBaseDirectory)
Microsoft.DotNet.CodeAnalysis (6)
Analyzers\BaseAnalyzer.cs (1)
23var configFile = context.Options.AdditionalFiles.FirstOrDefault(file => file.Path.Contains(ConfigFileName));
Analyzers\MembersMustExistAnalyzer.cs (2)
66private static IEnumerable<string> ReadRequiredAPIsFromFiles(IEnumerable<AdditionalText> additionalAnalyzerFiles) 69foreach (var additionalFile in additionalAnalyzerFiles)
Analyzers\PinvokeAnalyzer.cs (3)
64private AdditionalText _exceptionFile; 65private AdditionalText _allowedPinvokeFile; 70private Dictionary<string, string> ParseAdditionalFile(AdditionalText additionalFile)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
204public override AnalyzerConfigOptions GetOptions(AdditionalText textFile) => throw new System.NotSupportedException();
Microsoft.Gen.MetricsReports.Unit.Tests (1)
GeneratorTests.cs (1)
194public override AnalyzerConfigOptions GetOptions(AdditionalText textFile) => throw new NotSupportedException();
Microsoft.ML.AutoML.SourceGenerator (4)
EstimatorTypeGenerator.cs (1)
25if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
SearchSpaceGenerator.cs (1)
22if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
SweepableEstimatorFactoryGenerator.cs (1)
22if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
SweepableEstimatorGenerator.cs (1)
21if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\AppManifestAnalyzer.cs (1)
36private static void VerifyAppManifest(AdditionalFileAnalysisContext context, AdditionalText appManifest)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
CompilerAnalyzerConfigOptionsProvider.cs (1)
36public override AnalyzerConfigOptions GetOptions(AdditionalText textFile)