2 types derived from SyntaxTree
Microsoft.CodeAnalysis.CSharp (1)
Syntax\CSharpSyntaxTree.cs (1)
27public abstract partial class CSharpSyntaxTree : SyntaxTree
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\VisualBasicSyntaxTree.vb (1)
22Inherits SyntaxTree
8693 references to SyntaxTree
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (1)
192SyntaxTree tree = await project.GetDocument(documentId).GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Program.cs (1)
206var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
BuildActionTelemetryTable (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
BuildValidator (1)
CompilationDiff.cs (1)
303foreach (var tree in compilation.SyntaxTrees)
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
179SyntaxTree operationSyntaxTree = invocation.Syntax.SyntaxTree;
ConfigurationSchemaGenerator.Tests (3)
GeneratorTests.cs (3)
30private static readonly SyntaxTree s_implicitUsingsSyntaxTree = SyntaxFactory.ParseSyntaxTree(SourceText.From( 42private static readonly SyntaxTree s_attributesSyntaxTree = CSharpSyntaxTree.ParseText(File.ReadAllText("ConfigurationSchemaAttributes.cs")); 1561var sourceSyntaxTree = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceText));
IdeBenchmarks (1)
RegexClassifierBenchmarks.cs (1)
80var tree = await document.GetSyntaxTreeAsync();
IdeCoreBenchmarks (7)
IncrementalSourceGeneratorBenchmarks.cs (2)
158var syntaxTree = compilation.SyntaxTrees.Single(t => t.FilePath.Contains("AbstractCaseCorrectionService")); 168var changedTree = syntaxTree.WithChangedText(changedText);
SyntacticChangeRangeBenchmark.cs (5)
23private SyntaxTree _tree; 55var newTree = _tree.WithChangedText(newText); 64var newTree = _tree.WithChangedText(newText); 73var newTree = _tree.WithChangedText(newText); 82var newTree = _tree.WithChangedText(newText);
Microsoft.Analyzers.Extra.Tests (4)
SyntaxNodeExtensionsTests.cs (4)
47SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 79SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 142SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 173SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr);
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
98var tree = await document.GetSyntaxTreeAsync();
DiagnosticVerifier.cs (1)
121var tree = await document.GetSyntaxTreeAsync();
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
30var syntaxTree = semanticModel.SyntaxTree;
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
74var tree = CSharpSyntaxTree.ParseText(code);
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
75var tree = document.GetSyntaxTreeAsync().Result;
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
75var tree = document.GetSyntaxTreeAsync().Result;
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (4)
68var syntaxTree = CSharpSyntaxTree.ParseText(GetMapActionString(updatedSource), path: $"TestMapActions.cs", options: ParseOptions); 134foreach (var syntaxTree in compilation.SyntaxTrees) 142var newSyntaxTree = CSharpSyntaxTree.Create(syntaxRootNode, options: ParseOptions, encoding: encoding, path: syntaxTree.FilePath); 360var generatedSyntaxTree = compilation.SyntaxTrees.Last();
Microsoft.AspNetCore.Http.Microbenchmarks (4)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (4)
68var syntaxTree = CSharpSyntaxTree.ParseText(GetMapActionString(updatedSource), path: $"TestMapActions.cs", options: ParseOptions); 134foreach (var syntaxTree in compilation.SyntaxTrees) 142var newSyntaxTree = CSharpSyntaxTree.Create(syntaxRootNode, options: ParseOptions, encoding: encoding, path: syntaxTree.FilePath); 360var generatedSyntaxTree = compilation.SyntaxTrees.Last();
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\SyntaxTreeExtensions.cs (1)
12internal static string GetInterceptorFilePath(this SyntaxTree tree, SourceReferenceResolver? resolver) =>
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CSharpCompiler.cs (1)
73public SyntaxTree CreateSyntaxTree(SourceText sourceText)
RuntimeViewCompiler.cs (1)
375var syntaxTree = _csharpCompiler.CreateSyntaxTree(sourceText).WithFilePath(assemblyName);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CompilerFailedExceptionFactoryTest.cs (1)
51var syntaxTree = CSharpSyntaxTree.ParseText("@class Test { public string Test { get; set; } }");
Microsoft.CodeAnalysis (308)
CodeGen\ILBuilder.cs (4)
38private SyntaxTree _lastSeqPointTree; 1017internal void DefineSequencePoint(SyntaxTree syntaxTree, TextSpan span) 1057var lastDebugDocument = _lastSeqPointTree; 1086internal void SetInitialDebugDocument(SyntaxTree initialSequencePointTree)
CodeGen\RawSequencePoint.cs (2)
16internal readonly SyntaxTree SyntaxTree; 23internal RawSequencePoint(SyntaxTree syntaxTree, int ilMarker, TextSpan span)
CodeGen\SequencePointList.cs (3)
23private readonly SyntaxTree _tree; 37private SequencePointList(SyntaxTree tree, OffsetAndSpan[] points) 130SyntaxTree currentTree = current._tree;
CommandLine\AnalyzerConfigSet.cs (1)
298treeOptionsBuilder.Count > 0 ? treeOptionsBuilder.ToImmutable() : SyntaxTree.EmptyDiagnosticOptions,
CommandLine\CommonCompiler.cs (8)
432var embeddedTreeMap = new Dictionary<string, SyntaxTree>(Arguments.EmbeddedFiles.Length); 435foreach (var tree in compilation.SyntaxTrees) 459SyntaxTree? tree; 482SyntaxTree tree, 806/// <param name="generatedFilesBaseDirectory">The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.</param> 1017IEnumerable<SyntaxTree> syntaxTrees, 1024foreach (var syntaxTree in syntaxTrees) 1159foreach (var tree in generatedSyntaxTrees)
Compilation\CommonSyntaxAndDeclarationManager.cs (2)
11internal readonly ImmutableArray<SyntaxTree> ExternalSyntaxTrees; 18ImmutableArray<SyntaxTree> externalSyntaxTrees,
Compilation\Compilation.cs (40)
96protected static IReadOnlyDictionary<string, string> SyntaxTreeCommonFeatures(IEnumerable<SyntaxTree> trees) 100foreach (var tree in trees) 196ImmutableArray<SyntaxTree> syntaxTrees, 314public SemanticModel GetSemanticModel(SyntaxTree syntaxTree, bool ignoreAccessibility = false) 321public SemanticModel GetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 326/// If <see cref="SemanticModelProvider"/> is non-null, it attempts to use <see cref="SemanticModelProvider.GetSemanticModel(SyntaxTree, Compilation, SemanticModelOptions)"/> 327/// to get a semantic model. Otherwise, it creates a new semantic model using <see cref="CreateSemanticModel(SyntaxTree, SemanticModelOptions)"/>. 330protected abstract SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options); 334/// Unlike the <see cref="GetSemanticModel(SyntaxTree, bool)"/> and <see cref="CommonGetSemanticModel(SyntaxTree, SemanticModelOptions)"/>, 338internal abstract SemanticModel CreateSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options); 556public IEnumerable<SyntaxTree> SyntaxTrees { get { return CommonSyntaxTrees; } } 557protected internal abstract ImmutableArray<SyntaxTree> CommonSyntaxTrees { get; } 564public Compilation AddSyntaxTrees(params SyntaxTree[] trees) 574public Compilation AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 579protected abstract Compilation CommonAddSyntaxTrees(IEnumerable<SyntaxTree> trees); 587public Compilation RemoveSyntaxTrees(params SyntaxTree[] trees) 598public Compilation RemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 603protected abstract Compilation CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree> trees); 623public Compilation ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree) 628protected abstract Compilation CommonReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree); 634public bool ContainsSyntaxTree(SyntaxTree syntaxTree) 639protected abstract bool CommonContainsSyntaxTree(SyntaxTree? syntaxTree); 1074foreach (var tree in this.CommonSyntaxTrees) 2495foreach (var tree in CommonSyntaxTrees) 2531foreach (var tree in CommonSyntaxTrees) 2553foreach (var tree in CommonSyntaxTrees) 2563internal abstract void AddDebugSourceDocumentsForChecksumDirectives(DebugDocumentsBuilder documentsBuilder, SyntaxTree tree, DiagnosticBag diagnostics); 2593internal static bool ReportUnusedImportsInTree(SyntaxTree tree) 2607internal abstract void CompleteTrees(SyntaxTree? filterTree); 3524private ConcurrentDictionary<SyntaxTree, SmallConcurrentSetOfInts>? _lazyTreeToUsedImportDirectivesMap; 3525private static readonly Func<SyntaxTree, SmallConcurrentSetOfInts> s_createSetCallback = t => new SmallConcurrentSetOfInts(); 3527private ConcurrentDictionary<SyntaxTree, SmallConcurrentSetOfInts> TreeToUsedImportDirectivesMap 3540internal void MarkImportDirectiveAsUsed(SyntaxTree? syntaxTree, int position) 3550internal bool IsImportDirectiveUsed(SyntaxTree syntaxTree, int position) 3569internal int CompareSyntaxTreeOrdering(SyntaxTree tree1, SyntaxTree tree2) 3582internal abstract int GetSyntaxTreeOrdinal(SyntaxTree tree);
Compilation\DeterministicKey.cs (4)
25public static SyntaxTreeKey Create(SyntaxTree tree) 30private readonly SyntaxTree _tree; 32public DefaultSyntaxTreeKey(SyntaxTree tree) 52ImmutableArray<SyntaxTree> syntaxTrees,
Compilation\GeneratedKind.cs (3)
10/// It is unknown if the <see cref="SyntaxTree"/> is automatically generated. 14/// The <see cref="SyntaxTree"/> is not automatically generated. 18/// The <see cref="SyntaxTree"/> is marked as automatically generated.
Compilation\SemanticModel.cs (3)
18/// an instance is obtained by a call to <see cref="Compilation.GetSemanticModel(SyntaxTree, SemanticModelOptions)"/>. 60public SyntaxTree SyntaxTree 68protected abstract SyntaxTree SyntaxTreeCore { get; }
Compilation\SemanticModelProvider.cs (1)
18public abstract SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default);
Compilation\SyntaxTreeOptionsProvider.cs (8)
16public abstract GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken cancellationToken); 21public abstract bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken cancellationToken, out ReportDiagnostic severity); 45DiagnosticOptions = SyntaxTree.EmptyDiagnosticOptions; 51private readonly ImmutableDictionary<SyntaxTree, Options> _options; 56SyntaxTree?[] trees, 60var builder = ImmutableDictionary.CreateBuilder<SyntaxTree, Options>(); 74public override GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken _) 77public override bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken _, out ReportDiagnostic severity)
Diagnostic\Diagnostic.cs (2)
493internal bool HasIntersectingLocation(SyntaxTree tree, TextSpan? filterSpanWithinTree = null) 516static bool isLocationWithinSpan(Location location, SyntaxTree tree, TextSpan? filterSpan)
Diagnostic\Location.cs (3)
42public virtual SyntaxTree? SourceTree { get { return null; } } 156/// Creates an instance of a <see cref="Location"/> for a span in a <see cref="SyntaxTree"/>. 158public static Location Create(SyntaxTree syntaxTree, TextSpan textSpan)
Diagnostic\SourceLocation.cs (3)
17private readonly SyntaxTree _syntaxTree; 20public SourceLocation(SyntaxTree syntaxTree, TextSpan span) 72public override SyntaxTree SourceTree
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
97sb.AppendLine($"{nameof(SyntaxTree)}: {_file.Value.SourceTree.FilePath}");
DiagnosticAnalyzer\AnalysisResult.cs (4)
23ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics, 24ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics, 45public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SyntaxDiagnostics { get; } 50public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SemanticDiagnostics { get; }
DiagnosticAnalyzer\AnalysisResultBuilder.cs (10)
30private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByTree; 31private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSemanticAnalyzersByTree; 36private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSemanticDiagnosticsOpt = null; 37private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSyntaxDiagnosticsOpt = null; 45_completedSyntaxAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 46_completedSemanticAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 302static SyntaxTree? getSourceTree(Diagnostic diagnostic) 457Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 503ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics;
DiagnosticAnalyzer\AnalysisScope.cs (5)
55public ImmutableArray<SyntaxTree> SyntaxTrees { get; } 123var trees = filterFile.SourceTree != null ? ImmutableArray.Create(filterFile.SourceTree) : ImmutableArray<SyntaxTree>.Empty; 131ImmutableArray<SyntaxTree> trees, 226public bool ShouldAnalyze(SyntaxTree tree) 246var filterTree = FilterFileOpt.GetValueOrDefault().SourceTree;
DiagnosticAnalyzer\AnalyzerConfigOptionsProvider.cs (1)
20public abstract AnalyzerConfigOptions GetOptions(SyntaxTree tree);
DiagnosticAnalyzer\AnalyzerDriver.cs (28)
40private readonly Func<SyntaxTree, CancellationToken, bool> _isGeneratedCode; 233private ConcurrentDictionary<SyntaxTree, bool>? _lazyGeneratedCodeFilesMap; 238private ConcurrentDictionary<SyntaxTree, bool> GeneratedCodeFilesMap 247private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>? _lazyGeneratedCodeSymbolsForTreeMap; 252private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>> GeneratedCodeSymbolsForTreeMap 261private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap; 266private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap 308private ConcurrentDictionary<SyntaxTree, bool>? _lazyTreesWithHiddenRegionsMap; 418_lazyGeneratedCodeFilesMap = new ConcurrentDictionary<SyntaxTree, bool>(); 419_lazyGeneratedCodeSymbolsForTreeMap = new Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>(); 421_lazyTreesWithHiddenRegionsMap = new ConcurrentDictionary<SyntaxTree, bool>(); 422_lazySuppressedAnalyzersForTreeMap = new ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>(); 743foreach (var tree in analysisScope.SyntaxTrees) 976foreach (var tree in compilation.SyntaxTrees) 1002private SemanticModel GetOrCreateSemanticModel(SyntaxTree tree) 1005protected SemanticModel GetOrCreateSemanticModel(SyntaxTree tree, Compilation compilation) 1287ImmutableHashSet<ISymbol> getOrComputeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, CancellationToken cancellationToken) 1318static ImmutableHashSet<ISymbol> computeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, INamedTypeSymbol generatedCodeAttribute, CancellationToken cancellationToken) 1355private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1365private ImmutableHashSet<DiagnosticAnalyzer> ComputeSuppressedAnalyzersForTree(SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 2140SyntaxTree? filterTree, 2167async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2183async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2207static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2300protected bool IsGeneratedCode(SyntaxTree tree, CancellationToken cancellationToken) 2331protected bool IsGeneratedOrHiddenCodeLocation(SyntaxTree syntaxTree, TextSpan span, CancellationToken cancellationToken) 2334protected bool IsHiddenSourceLocation(SyntaxTree syntaxTree, TextSpan span) 2341private bool HasHiddenRegions(SyntaxTree tree)
DiagnosticAnalyzer\AnalyzerExecutor.cs (18)
42private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 45private readonly Func<SyntaxTree, TextSpan, CancellationToken, bool> _isGeneratedCodeLocation; 46private readonly Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> _isAnalyzerSuppressedForTree; 61private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, CancellationToken cancellationToken) 108Func<SyntaxTree, TextSpan, CancellationToken, bool> isGeneratedCodeLocation, 109Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 111Func<SyntaxTree, SemanticModel> getSemanticModel, 140Func<SyntaxTree, TextSpan, CancellationToken, bool> isGeneratedCodeLocation, 141Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 143Func<SyntaxTree, SemanticModel> getSemanticModel, 250SyntaxTree? filterTree, 359SyntaxTree? filterTree, 414SyntaxTree? filterTree, 451SyntaxTree? filterTree, 468SyntaxTree? filterTree, 567var tree = file.SourceTree; 1444private AnalyzerDiagnosticReporter GetAddSemanticDiagnostic(SyntaxTree tree, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1451private AnalyzerDiagnosticReporter GetAddSemanticDiagnostic(SyntaxTree tree, TextSpan? span, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (1)
142SyntaxTree? filterTree,
DiagnosticAnalyzer\AnalyzerManager.cs (4)
94SyntaxTree? filterTree, 108SyntaxTree? filterTree, 188SyntaxTree? filterTree, 319foreach (var tree in analysisScope.SyntaxTrees)
DiagnosticAnalyzer\AnalyzerOptions.cs (1)
25/// A set of options keyed to <see cref="SyntaxTree"/> or <see cref="AdditionalText"/>.
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (1)
31SyntaxTree tree,
DiagnosticAnalyzer\CachingSemanticModelProvider.cs (8)
16/// and should invoke <see cref="ClearCache(SyntaxTree, Compilation)"/> and <see cref="ClearCache(Compilation)"/> to clear entries when appropriate. 36public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default) 39internal void ClearCache(SyntaxTree tree, Compilation compilation) 55private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelsMap; 59private readonly Func<SyntaxTree, SemanticModel> _createSemanticModel; 64_semanticModelsMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 68public SemanticModel GetSemanticModel(SyntaxTree tree, SemanticModelOptions options) 76public void ClearCachedSemanticModel(SyntaxTree tree)
DiagnosticAnalyzer\CompilationUnitCompletedEvent.cs (2)
13public CompilationUnitCompletedEvent(Compilation compilation, SyntaxTree compilationUnit, TextSpan? filterSpan = null) 22public SyntaxTree CompilationUnit { get; }
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (16)
199private void VerifyTree(SyntaxTree tree) 395public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, CancellationToken cancellationToken) 411public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken) 427public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 445public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 459public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, CancellationToken cancellationToken) 474public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken) 488public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 505public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 584private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 896var partialTrees = PooledHashSet<SyntaxTree>.GetInstance(); 897var tree = originalFile.SourceTree!; 922foreach (var partialTree in partialTrees) 935bool tryProcessTree(SyntaxTree partialTree, [NotNullWhen(true)] out (AnalysisScope scope, ImmutableArray<CompilationEvent> events)? scopeAndEvents) 1060var tree = analysisScope.FilterFileOpt!.Value.SourceTree!; 1106static bool shouldIncludeSymbol(ISymbolInternal symbol, SyntaxTree tree, CancellationToken cancellationToken)
DiagnosticAnalyzer\CompilerAnalyzerConfigOptionsProvider.cs (1)
28public override AnalyzerConfigOptions GetOptions(SyntaxTree tree)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (30)
117/// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. 433/// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. 531/// <param name="tree"><see cref="SyntaxTree"/> instance for which the value is queried.</param> 535public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 653/// <param name="tree"><see cref="SyntaxTree"/> for which the value is queried.</param> 657public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 707public SyntaxTree FilterTree { get; } 792public SyntaxTree? FilterTree { get; } 827SyntaxTree? filterTree, 888public SyntaxTree? FilterTree { get; } 909internal SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, bool isGeneratedCode, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 1049public SyntaxTree FilterTree { get; } 1159public SyntaxTree FilterTree { get; } 1269public SyntaxTree FilterTree { get; } 1306SyntaxTree filterTree, 1411public SyntaxTree FilterTree { get; } 1452SyntaxTree filterTree, 1505/// A syntax tree action can use a <see cref="SyntaxTreeAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="SyntaxTree"/> for a code document. 1509private readonly SyntaxTree _tree; 1517/// <see cref="SyntaxTree"/> that is the subject of the analysis. 1519public SyntaxTree Tree => _tree; 1546public SyntaxTreeAnalysisContext(SyntaxTree tree, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1552SyntaxTree tree, 1572/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxTree"/>. 1696public SyntaxTree FilterTree { get; } 1802public SyntaxTree FilterTree { get; } 1885private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 1920Func<SyntaxTree, SemanticModel> getSemanticModel, 1961/// Gets a <see cref="SemanticModel"/> for the given <see cref="SyntaxTree"/>, which is shared across all analyzers. 1963public SemanticModel GetSemanticModel(SyntaxTree syntaxTree) => _getSemanticModel(syntaxTree);
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (2)
233SyntaxTree? filterTree, 332SyntaxTree filterTree,
DiagnosticAnalyzer\SourceOrAdditionalFile.cs (2)
18public SyntaxTree? SourceTree { get; } 21public SourceOrAdditionalFile(SyntaxTree tree)
DiagnosticAnalyzer\SyntaxTreeValueProvider.cs (8)
11/// Provides custom values associated with <see cref="SyntaxTree"/> instances using the given computeValue delegate. 15internal AnalysisValueProvider<SyntaxTree, TValue> CoreValueProvider { get; private set; } 18/// Provides values associated with <see cref="SyntaxTree"/> instances using the given <paramref name="computeValue"/>. 20/// <param name="computeValue">Delegate to compute the value associated with a given <see cref="SyntaxTree"/> instance.</param> 21/// <param name="syntaxTreeComparer">Optional equality comparer to determine equivalent <see cref="SyntaxTree"/> instances that have the same value. 23public SyntaxTreeValueProvider(Func<SyntaxTree, TValue> computeValue, IEqualityComparer<SyntaxTree>? syntaxTreeComparer = null) 25CoreValueProvider = new AnalysisValueProvider<SyntaxTree, TValue>(computeValue, syntaxTreeComparer ?? SyntaxTreeComparer.Instance);
EmbeddedText.cs (1)
37/// <remarks>See remarks of <see cref="SyntaxTree.FilePath"/></remarks>
PEWriter\MetadataWriter.cs (1)
1790foreach (var tree in Module.CommonCompilation.SyntaxTrees)
ReferenceManager\CommonReferenceManager.Resolution.cs (1)
870var tree = location.SourceTree;
SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
SourceGeneration\GeneratedSyntaxTree.cs (2)
18public SyntaxTree Tree { get; } 20public GeneratedSyntaxTree(string hintName, SourceText text, SyntaxTree tree)
SourceGeneration\GeneratorDriver.cs (5)
73ArrayBuilder<SyntaxTree> trees = ArrayBuilder<SyntaxTree>.GetInstance(); 225var constantSourcesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 375var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 461internal abstract SyntaxTree ParseGeneratedSourceText(GeneratedSourceText input, string fileName, CancellationToken cancellationToken);
SourceGeneration\GeneratorDriverState.cs (1)
79/// The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.
SourceGeneration\Nodes\SharedInputNodes.cs (2)
26public static readonly InputNode<SyntaxTree> SyntaxTrees = new InputNode<SyntaxTree>(b => b.Compilation.SyntaxTrees.ToImmutableArray());
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
142var targetSyntaxTree = attributeTarget.SyntaxTree;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (7)
53/// cref="SyntaxTree"/>. 55internal IncrementalValuesProvider<(SyntaxTree tree, ImmutableArray<SyntaxNode> matches)> ForAttributeWithSimpleName( 125private static ImmutableArray<(SyntaxTree Tree, SourceGeneratorSyntaxTreeInfo Info)> GetSourceGeneratorInfo( 130foreach (var tree in compilation.CommonSyntaxTrees) 138var builder = ImmutableArray.CreateBuilder<(SyntaxTree Tree, SourceGeneratorSyntaxTreeInfo Info)>(count); 141foreach (var tree in compilation.CommonSyntaxTrees) 154SyntaxTree syntaxTree,
SourceGeneration\RunResults.cs (5)
21private ImmutableArray<SyntaxTree> _lazyGeneratedTrees; 58/// The <see cref="SyntaxTree"/>s produced during this generation pass by parsing each <see cref="SourceText"/> added by each generator. 63public ImmutableArray<SyntaxTree> GeneratedTrees 170internal GeneratedSourceResult(SyntaxTree tree, SourceText text, string hintName) 180public SyntaxTree SyntaxTree { get; }
SourceGeneration\SyntaxStore.cs (2)
49public IStateTable GetSyntaxInputTable(SyntaxInputNode syntaxInputNode, NodeStateTable<SyntaxTree> syntaxTreeTable) 84NodeStateTable<SyntaxTree> syntaxTreeState = syntaxTreeTable;
Symbols\IMethodSymbolInternal.cs (1)
58int CalculateLocalSyntaxOffset(int declaratorPosition, SyntaxTree declaratorTree);
Symbols\ISymbolInternal.cs (1)
174bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default);
Syntax\AbstractWarningStateMap.cs (2)
22protected AbstractWarningStateMap(SyntaxTree syntaxTree) 32protected abstract WarningStateMapEntry[] CreateWarningStateMapEntries(SyntaxTree syntaxTree);
Syntax\ICompilationUnitSyntax.cs (4)
10/// Interface implemented by any node that is the root 'CompilationUnit' of a <see cref="SyntaxTree"/>. i.e. 11/// any node returned by <see cref="SyntaxTree.GetRoot"/> where <see cref="SyntaxTree.HasCompilationUnitRoot"/> 14/// This interface provides a common way to both easily find the root of a <see cref="SyntaxTree"/>
Syntax\LineDirectiveMap.cs (2)
36protected LineDirectiveMap(SyntaxTree syntaxTree) 139private ImmutableArray<LineMappingEntry> CreateEntryMap(SyntaxTree tree, IList<TDirective> directives)
Syntax\SyntaxDiffer.cs (4)
37internal static IList<TextChange> GetTextChanges(SyntaxTree before, SyntaxTree after) 71internal static IList<TextSpan> GetPossiblyDifferentTextSpans(SyntaxTree? before, SyntaxTree? after)
Syntax\SyntaxList.cs (1)
27protected override SyntaxTree SyntaxTreeCore => this.Parent!.SyntaxTree;
Syntax\SyntaxNode.cs (8)
29internal SyntaxTree? _syntaxTree; 45internal SyntaxNode(GreenNode green, int position, SyntaxTree syntaxTree) 77public SyntaxTree SyntaxTree => this.SyntaxTreeCore; 353/// occurs when a <see cref="SyntaxTree"/> is incrementally parsed using <see cref="SyntaxTree.WithChangedText"/> 361/// from <see cref="SyntaxTree.WithChangedText"/>. This can happen as the parser is allowed to construct parse 691var tree = this.SyntaxTree; 1429protected abstract SyntaxTree SyntaxTreeCore { get; } 1650internal static T CloneNodeAsRoot<T>(T node, SyntaxTree syntaxTree) where T : SyntaxNode
Syntax\SyntaxNodeExtensions.cs (1)
434internal static SyntaxNode? AsRootOfNewTreeWithOptionsFrom(this SyntaxNode? node, SyntaxTree oldTree)
Syntax\SyntaxNodeOrToken.cs (1)
823public SyntaxTree? SyntaxTree => _nodeOrParent?.SyntaxTree;
Syntax\SyntaxReference.cs (1)
19public abstract SyntaxTree SyntaxTree { get; }
Syntax\SyntaxToken.cs (5)
637public SyntaxTree? SyntaxTree => Parent?.SyntaxTree; 644var tree = SyntaxTree; 663var tree = SyntaxTree; 689/// occurs when a <see cref="SyntaxTree"/> is incrementally parsed using <see cref="SyntaxTree.WithChangedText"/> 697/// from <see cref="SyntaxTree.WithChangedText"/>. This can happen as the parser is allowed to construct parse
Syntax\SyntaxTree.cs (8)
172public abstract SyntaxTree WithChangedText(SourceText newText); 336public abstract IList<TextSpan> GetChangedSpans(SyntaxTree syntaxTree); 351public abstract bool IsEquivalentTo(SyntaxTree tree, bool topLevel = false); 366public abstract IList<TextChange> GetChanges(SyntaxTree oldTree); 391public abstract SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options); 396public abstract SyntaxTree WithFilePath(string path); 407public virtual SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options) 413/// Returns a <see cref="String" /> that represents the entire source text of this <see cref="SyntaxTree"/>.
Syntax\SyntaxTreeComparer.cs (4)
12internal class SyntaxTreeComparer : IEqualityComparer<SyntaxTree> 16public bool Equals(SyntaxTree? x, SyntaxTree? y) 31public int GetHashCode(SyntaxTree obj)
Syntax\SyntaxTreeExtensions.cs (2)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 106public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
Syntax\SyntaxTrivia.cs (1)
398public SyntaxTree? SyntaxTree
Syntax\TranslationSyntaxReference.cs (1)
29public sealed override SyntaxTree SyntaxTree
XmlFileResolver.cs (1)
44/// Path of the source file (<see cref="SyntaxTree.FilePath"/>) or XML document that contains the <paramref name="path"/>.
Microsoft.CodeAnalysis.CodeStyle (78)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (3)
109SyntaxTree tree, 117SyntaxTree tree, 147SyntaxTree tree,
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (1)
98internal Location GetLocation(SyntaxTree syntaxTree)
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
46var tree = context.Tree;
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (2)
60var sourceTree = symbolContext.Symbol.Locations.FirstOrDefault()?.SourceTree; 114SyntaxTree sourceTree,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
65var tree = model.SyntaxTree;
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (5)
87var tree = context.SemanticModel.SyntaxTree; 127var tree = compilation.SyntaxTrees.FirstOrDefault(tree => !GeneratedCodeUtilities.IsGeneratedCode(tree, IsRegularCommentOrDocComment, context.CancellationToken)); 194IEnumerable<TextSpan> contiguousSpans, SyntaxTree tree, 209IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken); 212IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
98var tree = semanticModel.SyntaxTree; 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 508SyntaxTree tree, 545SyntaxTree tree,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
618foreach (var tree in namedTypeSymbol.Locations.Select(l => l.SourceTree).Distinct().WhereNotNull())
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
111protected abstract bool SupportsDiscard(SyntaxTree tree); 202private bool TryGetOptions(SyntaxTree syntaxTree, AnalyzerOptions analyzerOptions, CompilationOptions compilationOptions, CancellationToken cancellationToken, out Options options)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
163var tree = model.SyntaxTree; 222private readonly ConcurrentDictionary<SyntaxTree, (StrongBox<bool> completed, TextSpanMutableIntervalTree? intervalTree)> _codeBlockIntervals = [];
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
27var syntaxTree = match.SyntaxTree;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
79var syntaxTree = assignment.SyntaxTree;
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
140var syntaxTree = context.Node.SyntaxTree;
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 106public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
44public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 64public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
13public static SyntaxTree GetSourceTreeOrThrow(this Location location) 38var tree = loc.SourceTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 36public static bool IsScript(this SyntaxTree syntaxTree) 44this SyntaxTree syntaxTree, 54this SyntaxTree syntaxTree, 63this SyntaxTree syntaxTree, 96public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 121public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 130this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 169this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 202this SyntaxTree syntaxTree, 217this SyntaxTree syntaxTree, 228public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 250public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
35public readonly SyntaxTree Tree; 43SyntaxTree tree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
35SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 39SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 43SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
160bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 189bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 421TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 492bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (7)
78var syntaxTree = locations[0].SourceTree; 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 116Compilation compilation, SyntaxTree? syntaxTree, 203SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 274private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 276foreach (var current in trees)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
77/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
453internal SyntaxTree? GetSyntaxTree(string filePath)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
15using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
146public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
Microsoft.CodeAnalysis.CodeStyle.Fixes (19)
src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
16var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
21protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 70var syntaxTree = result.Item1;
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
60var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
80var tree = await this.Document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
43var syntaxTree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
242var destinationTree = destinationDeclaration.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
66var syntaxTree = destination.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
16public SyntaxTree SyntaxTree { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
62public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 64if (document.TryGetSyntaxTree(out var syntaxTree)) 230var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
27var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 31private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
17bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 20Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
30public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Microsoft.CodeAnalysis.CSharp (350)
Binder\Binder.cs (1)
252internal bool AreNullableAnnotationsEnabled(SyntaxTree syntaxTree, int position)
Binder\Binder_Attributes.cs (1)
411protected bool IsAttributeConditionallyOmitted(NamedTypeSymbol attributeType, SyntaxTree? syntaxTree, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Binder_Initializers.cs (1)
194var syntaxTree = syntaxRef.SyntaxTree;
Binder\Binder_Symbols.cs (3)
2744internal static bool CheckFeatureAvailability(SyntaxTree tree, MessageID feature, BindingDiagnosticBag diagnostics, Location location) 2753private static bool CheckFeatureAvailability(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, Location location) 2759private static bool CheckFeatureAvailability<TData>(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, TData data, Func<TData, Location> getLocation, bool forceWarning = false)
Binder\BinderFactory.BinderFactoryVisitor.cs (3)
53private SyntaxTree syntaxTree 640private static bool InSpan(Location location, SyntaxTree syntaxTree, TextSpan span) 649private static bool InSpan(ImmutableArray<Location> locations, SyntaxTree syntaxTree, TextSpan span)
Binder\BinderFactory.cs (3)
51private readonly SyntaxTree _syntaxTree; 63internal BinderFactory(CSharpCompilation compilation, SyntaxTree syntaxTree, bool ignoreAccessibility, ObjectPool<BinderFactoryVisitor> binderFactoryVisitorPoolOpt = null) 82internal SyntaxTree SyntaxTree
Binder\WithNullableContextBinder.cs (2)
13private readonly SyntaxTree _syntaxTree; 16internal WithNullableContextBinder(SyntaxTree syntaxTree, int position, Binder next)
BoundTree\BoundNode.cs (1)
145public SyntaxTree? SyntaxTree
CodeGen\CodeGenerator.cs (2)
455private void EmitStepThroughSequencePoint(SyntaxTree syntaxTree, TextSpan span) 496private TextSpan EmitSequencePoint(SyntaxTree syntaxTree, TextSpan span)
CommandLine\CSharpCompiler.cs (5)
54var trees = new SyntaxTree?[sourceFiles.Length]; 173private SyntaxTree? ParseFile( 201private static SyntaxTree ParseFile( 207var tree = SyntaxFactory.ParseSyntaxTree( 345SyntaxTree tree,
Compilation\CSharpCompilation.cs (84)
137private HashSet<SyntaxTree>? _lazyCompilationUnitCompletedTrees; 143private ImmutableHashSet<SyntaxTree>? _usageOfUsingsRecordedInTrees = ImmutableHashSet<SyntaxTree>.Empty; 145internal ImmutableHashSet<SyntaxTree>? UsageOfUsingsRecordedInTrees => Volatile.Read(ref _usageOfUsingsRecordedInTrees); 154private ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> _mappedPathToSyntaxTree; 158private ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> _pathToSyntaxTree; 161private ImmutableSegmentedDictionary<ReadOnlyMemory<byte>, OneOrMany<SyntaxTree>> _contentHashToSyntaxTree; 358IEnumerable<SyntaxTree>? syntaxTrees = null, 378SyntaxTree? syntaxTree = null, 391(syntaxTree != null) ? new[] { syntaxTree } : SpecializedCollections.EmptyEnumerable<SyntaxTree>(), 402IEnumerable<SyntaxTree>? syntaxTrees, 434ImmutableArray<SyntaxTree>.Empty, 534private static LanguageVersion CommonLanguageVersion(ImmutableArray<SyntaxTree> syntaxTrees) 537foreach (var tree in syntaxTrees) 820public new ImmutableArray<SyntaxTree> SyntaxTrees 828public new bool ContainsSyntaxTree(SyntaxTree? syntaxTree) 836public new CSharpCompilation AddSyntaxTrees(params SyntaxTree[] trees) 838return AddSyntaxTrees((IEnumerable<SyntaxTree>)trees); 844public new CSharpCompilation AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 860var externalSyntaxTrees = PooledHashSet<SyntaxTree>.GetInstance(); 908public new CSharpCompilation RemoveSyntaxTrees(params SyntaxTree[] trees) 910return RemoveSyntaxTrees((IEnumerable<SyntaxTree>)trees); 917public new CSharpCompilation RemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 929var removeSet = PooledHashSet<SyntaxTree>.GetInstance(); 934var externalSyntaxTrees = PooledHashSet<SyntaxTree>.GetInstance(); 976syntaxAndDeclarations: syntaxAndDeclarations.WithExternalSyntaxTrees(ImmutableArray<SyntaxTree>.Empty)); 982public new CSharpCompilation ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree? newTree) 1036internal override int GetSyntaxTreeOrdinal(SyntaxTree tree) 1051internal OneOrMany<SyntaxTree> GetSyntaxTreesByMappedPath(string mappedPath) 1066return mappedPathToSyntaxTree.TryGetValue(mappedPath, out var value) ? value : OneOrMany<SyntaxTree>.Empty; 1068ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> computeMappedPathToSyntaxTree() 1070var builder = ImmutableSegmentedDictionary.CreateBuilder<string, OneOrMany<SyntaxTree>>(); 1072foreach (var tree in SyntaxTrees) 1081internal OneOrMany<SyntaxTree> GetSyntaxTreesByContentHash(ReadOnlyMemory<byte> contentHash) 1092return contentHashToSyntaxTree.TryGetValue(contentHash, out var value) ? value : OneOrMany<SyntaxTree>.Empty; 1094ImmutableSegmentedDictionary<ReadOnlyMemory<byte>, OneOrMany<SyntaxTree>> computeHashToSyntaxTree() 1096var builder = ImmutableSegmentedDictionary.CreateBuilder<ReadOnlyMemory<byte>, OneOrMany<SyntaxTree>>(ContentHashComparer.Instance); 1097foreach (var tree in SyntaxTrees) 1107internal OneOrMany<SyntaxTree> GetSyntaxTreesByPath(string path) 1119return pathToSyntaxTree.TryGetValue(path, out var value) ? value : OneOrMany<SyntaxTree>.Empty; 1121ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> computePathToSyntaxTree() 1123var builder = ImmutableSegmentedDictionary.CreateBuilder<string, OneOrMany<SyntaxTree>>(); 1124foreach (var tree in SyntaxTrees) 1557internal bool IsSubmissionSyntaxTree(SyntaxTree tree) 2505public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree, bool ignoreAccessibility) 2514public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 2537internal override SemanticModel CreateSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 2551internal BinderFactory GetBinderFactory(SyntaxTree syntaxTree, bool ignoreAccessibility = false) 2561private BinderFactory GetBinderFactory(SyntaxTree syntaxTree, bool ignoreAccessibility, ref WeakReference<BinderFactory>[]? cachedBinderFactories) 2583private BinderFactory AddNewFactory(SyntaxTree syntaxTree, bool ignoreAccessibility, [NotNull] ref WeakReference<BinderFactory>? slot) 2615private void CompleteTree(SyntaxTree tree) 2617if (_lazyCompilationUnitCompletedTrees == null) Interlocked.CompareExchange(ref _lazyCompilationUnitCompletedTrees, new HashSet<SyntaxTree>(), null); 2644private void ReportUnusedImports(SyntaxTree? filterTree, BindingDiagnosticBag diagnostics, CancellationToken cancellationToken) 2660SyntaxTree infoTree = info.Tree; 2737internal override void CompleteTrees(SyntaxTree? filterTree) 2750foreach (var tree in this.SyntaxTrees) 2788public readonly SyntaxTree Tree; 2792public ImportInfo(SyntaxTree tree, SyntaxKind kind, TextSpan span) 2953var syntaxTree = syntaxTrees[i]; 2961foreach (var syntaxTree in syntaxTrees) 2972foreach (var syntaxTree in syntaxTrees) 3025private static void AppendLoadDirectiveDiagnostics(DiagnosticBag builder, SyntaxAndDeclarationManager syntaxAndDeclarations, SyntaxTree syntaxTree, Func<IEnumerable<Diagnostic>, IEnumerable<Diagnostic>>? locationFilterOpt = null) 3071private static bool IsDefinedOrImplementedInSourceTree(Symbol symbol, SyntaxTree tree, TextSpan? span) 3087private ImmutableArray<Diagnostic> GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, TextSpan? span, CancellationToken cancellationToken) 3140foreach (var otherTree in SyntaxTrees) 3168void compileMethodBodiesAndDocComments(SyntaxTree? filterTree, TextSpan? filterSpan, BindingDiagnosticBag bindingDiagnostics, CancellationToken cancellationToken) 3183void registeredUsageOfUsingsInTree(SyntaxTree tree) 3219private ReadOnlyBindingDiagnostic<AssemblySymbol> GetSourceDeclarationDiagnostics(SyntaxTree? syntaxTree = null, TextSpan? filterSpanWithinTree = null, Func<IEnumerable<Diagnostic>, SyntaxTree, TextSpan?, IEnumerable<Diagnostic>>? locationFilterOpt = null, Predicate<Symbol>? symbolFilter = null, CancellationToken cancellationToken = default) 3268private ReadOnlyBindingDiagnostic<AssemblySymbol> GetClsComplianceDiagnostics(SyntaxTree? syntaxTree, TextSpan? filterSpanWithinTree, CancellationToken cancellationToken) 3291private static IEnumerable<Diagnostic> FilterDiagnosticsByLocation(IEnumerable<Diagnostic> diagnostics, SyntaxTree tree, TextSpan? filterSpanWithinTree) 3304SyntaxTree syntaxTree, 3571public bool CheckDuplicateFilePathsAndFree(ImmutableArray<SyntaxTree> syntaxTrees, NamespaceSymbol globalNamespace) 3574foreach (var tree in syntaxTrees) 3805SyntaxTree tree, 3904foreach (var syntaxTree in this.SyntaxTrees) 3946protected override SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 3951protected internal override ImmutableArray<SyntaxTree> CommonSyntaxTrees 3959protected override Compilation CommonAddSyntaxTrees(IEnumerable<SyntaxTree> trees) 3964protected override Compilation CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 3974protected override Compilation CommonReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree? newTree) 3989protected override bool CommonContainsSyntaxTree(SyntaxTree? syntaxTree)
Compilation\CSharpSemanticModel.cs (4)
24/// cref="Compilation.GetSemanticModel(SyntaxTree, bool)"/>. 2789public new abstract SyntaxTree SyntaxTree 4940protected sealed override SyntaxTree SyntaxTreeCore 5223var tree = nameSyntax.SyntaxTree;
Compilation\MemberSemanticModel.cs (1)
1147public override SyntaxTree SyntaxTree
Compilation\MemberSemanticModel.NodeMapBuilder.cs (3)
21private NodeMapBuilder(OrderPreservingMultiDictionary<SyntaxNode, BoundNode> map, SyntaxTree tree, SyntaxNode thisSyntaxNodeOnly) 29private readonly SyntaxTree _tree; 39public static void AddToMap(BoundNode root, Dictionary<SyntaxNode, OneOrMany<BoundNode>> map, SyntaxTree tree, SyntaxNode node = null)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
129public override SyntaxTree SyntaxTree => _memberModel.SyntaxTree;
Compilation\SyntaxAndDeclarationManager.cs (72)
28ImmutableArray<SyntaxTree> externalSyntaxTrees, 50ImmutableArray<SyntaxTree> externalSyntaxTrees, 56var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 57var ordinalMapBuilder = PooledDictionary<SyntaxTree, int>.GetInstance(); 58var loadDirectiveMapBuilder = PooledDictionary<SyntaxTree, ImmutableArray<LoadDirective>>.GetInstance(); 59var loadedSyntaxTreeMapBuilder = PooledDictionary<string, SyntaxTree>.GetInstance(); 60var declMapBuilder = PooledDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.GetInstance(); 61var lastComputedMemberNamesMap = PooledDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>>.GetInstance(); 64foreach (var tree in externalSyntaxTrees) 91public SyntaxAndDeclarationManager AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 112var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 115foreach (var tree in trees) 154ArrayBuilder<SyntaxTree> treesBuilder, 155SyntaxTree tree, 160IDictionary<SyntaxTree, int> ordinalMapBuilder, 161IDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMapBuilder, 162IDictionary<string, SyntaxTree> loadedSyntaxTreeMapBuilder, 163IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder, 164IDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNamesMap, 189ArrayBuilder<SyntaxTree> treesBuilder, 190SyntaxTree tree, 195IDictionary<SyntaxTree, int> ordinalMapBuilder, 196IDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMapBuilder, 197IDictionary<string, SyntaxTree> loadedSyntaxTreeMapBuilder, 198IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder, 199IDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNamesMap, 241var loadedTree = SyntaxFactory.ParseSyntaxTree( 292SyntaxTree tree, 295IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder, 304public SyntaxAndDeclarationManager RemoveSyntaxTrees(HashSet<SyntaxTree> trees) 316var removeSet = PooledHashSet<SyntaxTree>.GetInstance(); 317foreach (var tree in trees) 333var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 334var ordinalMapBuilder = PooledDictionary<SyntaxTree, int>.GetInstance(); 338foreach (var tree in syntaxTrees) 383SyntaxTree oldTree, 385ImmutableArray<SyntaxTree> syntaxTrees, 386ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap, 387ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 388ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 389HashSet<SyntaxTree> removeSet, 414var tree = syntaxTrees[i]; 421SyntaxTree loadedTree; 434ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 435ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 436HashSet<SyntaxTree> removeSet) 442SyntaxTree loadedTree; 457SyntaxTree tree, 458IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMap, 466public SyntaxAndDeclarationManager ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree) 481var removeSet = PooledHashSet<SyntaxTree>.GetInstance(); 514ImmutableArray<SyntaxTree> newTrees; 523var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 524var ordinalMapBuilder = PooledDictionary<SyntaxTree, int>.GetInstance(); 527var tree = syntaxTrees[i]; 548var tree = syntaxTrees[i]; 606SyntaxTree oldTree, 607ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.Builder declMapBuilder, 608ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>>.Builder lastComputedMemberNamesMap) 663internal SyntaxAndDeclarationManager WithExternalSyntaxTrees(ImmutableArray<SyntaxTree> trees) 668internal static bool IsLoadedSyntaxTree(SyntaxTree tree, ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap) 670SyntaxTree loadedTree; 675ArrayBuilder<SyntaxTree> treesBuilder, 676SyntaxTree tree, 677IDictionary<SyntaxTree, int> ordinalMapBuilder, 678ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 679ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap) 697SyntaxTree loadedTree; 728private static bool TryGetLoadedSyntaxTree(ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, LoadDirective directive, out SyntaxTree loadedTree)
Compilation\SyntaxAndDeclarationManager.LazyState.cs (13)
20internal readonly ImmutableArray<SyntaxTree> SyntaxTrees; // In ordinal order. 21internal readonly ImmutableDictionary<SyntaxTree, int> OrdinalMap; // Inverse of syntaxTrees array (i.e. maps tree to index) 22internal readonly ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> LoadDirectiveMap; 23internal readonly ImmutableDictionary<string, SyntaxTree> LoadedSyntaxTreeMap; 24internal readonly ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> RootNamespaces; 43internal readonly ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> LastComputedMemberNames; 47ImmutableArray<SyntaxTree> syntaxTrees, 48ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap, 49ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 50ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 51ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> rootNamespaces, 52ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNames, 56Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer<SyntaxTree>.Default));
Compilation\SyntaxTreeSemanticModel.cs (5)
28private readonly SyntaxTree _syntaxTree; 44internal SyntaxTreeSemanticModel(CSharpCompilation compilation, SyntaxTree syntaxTree, SemanticModelOptions options) 53internal SyntaxTreeSemanticModel(CSharpCompilation parentCompilation, SyntaxTree parentSyntaxTree, SyntaxTree speculatedSyntaxTree, SemanticModelOptions options) 86public override SyntaxTree SyntaxTree
Compiler\ClsComplianceChecker.cs (3)
27private readonly SyntaxTree _filterTree; //if not null, limit analysis to types residing in this tree 39SyntaxTree filterTree, 73public static void CheckCompliance(CSharpCompilation compilation, BindingDiagnosticBag diagnostics, CancellationToken cancellationToken, SyntaxTree filterTree = null, TextSpan? filterSpanWithinTree = null)
Compiler\DocumentationCommentCompiler.cs (4)
37private readonly SyntaxTree _filterTree; //if not null, limit analysis to types residing in this tree 55SyntaxTree filterTree, 86public static void WriteDocumentationCommentXml(CSharpCompilation compilation, string? assemblyName, Stream? xmlDocStream, BindingDiagnosticBag diagnostics, CancellationToken cancellationToken, SyntaxTree? filterTree = null, TextSpan? filterSpanWithinTree = null) 124foreach (SyntaxTree tree in compilation.SyntaxTrees)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
547private static Binder MakeNameBinder(bool isParameter, bool isTypeParameterRef, Symbol memberSymbol, CSharpCompilation compilation, SyntaxTree syntaxTree)
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
29public static void ReportUnprocessed(SyntaxTree tree, TextSpan? filterSpanWithinTree, DiagnosticBag diagnostics, CancellationToken cancellationToken)
CSharpExtensions.cs (6)
395public static CompilationUnitSyntax GetCompilationUnitRoot(this SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken)) 400internal static bool HasReferenceDirectives([NotNullWhen(true)] this SyntaxTree? tree) 406internal static bool HasReferenceOrLoadDirectives([NotNullWhen(true)] this SyntaxTree? tree) 412internal static bool IsAnyPreprocessorSymbolDefined([NotNullWhen(true)] this SyntaxTree? tree, ImmutableArray<string> conditionalSymbols) 418internal static bool IsPreprocessorSymbolDefined([NotNullWhen(true)] this SyntaxTree? tree, string symbolName, int position) 425internal static PragmaWarningState GetPragmaDirectiveWarningState(this SyntaxTree tree, string id, int position)
Declarations\DeclarationTreeBuilder.cs (3)
41private readonly SyntaxTree _syntaxTree; 76SyntaxTree syntaxTree, 88SyntaxTree syntaxTree,
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
76var tree = trivia.SyntaxTree;
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
223internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
254internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (1)
51internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
SourceGeneration\CSharpGeneratorDriver.cs (1)
70internal override SyntaxTree ParseGeneratedSourceText(GeneratedSourceText input, string fileName, CancellationToken cancellationToken)
SymbolDisplay\SymbolDisplay.cs (2)
85/// <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param> 176/// <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param>
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
230internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\ErrorMethodSymbol.cs (1)
267internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\FileIdentifier.cs (1)
92public static FileIdentifier Create(SyntaxTree syntaxTree, SourceReferenceResolver? resolver)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
857internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) => throw ExceptionUtilities.Unreachable();
Symbols\LexicalSortKey.cs (1)
62private LexicalSortKey(SyntaxTree tree, int position, CSharpCompilation compilation)
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1567internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\MethodSymbol.cs (4)
511internal virtual bool CallsAreOmitted(SyntaxTree syntaxTree) 524private bool CallsAreConditionallyOmitted(SyntaxTree syntaxTree) 1143internal abstract int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree); 1234int IMethodSymbolInternal.CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) => CalculateLocalSyntaxOffset(localPosition, localTree);
Symbols\NativeIntegerTypeSymbol.cs (1)
374internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\ReducedExtensionMethodSymbol.cs (3)
139var syntaxTree = CSharpSyntaxTree.Dummy; 551internal override bool CallsAreOmitted(SyntaxTree syntaxTree) 578internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
372internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\SignatureOnlyMethodSymbol.cs (1)
179internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) { throw ExceptionUtilities.Unreachable(); }
Symbols\Source\LambdaSymbol.cs (1)
431internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Source\LocalFunctionSymbol.cs (1)
384internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Source\SourceAssemblySymbol.cs (1)
1558var tree = rootNs.Location.SourceTree;
Symbols\Source\SourceConstructorSymbolBase.cs (1)
168internal sealed override int CalculateLocalSyntaxOffset(int position, SyntaxTree tree)
Symbols\Source\SourceEventSymbol.cs (1)
423internal SyntaxTree SyntaxTree
Symbols\Source\SourceFieldSymbol.cs (2)
189public SyntaxTree SyntaxTree 228public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default)
Symbols\Source\SourceMemberContainerSymbol.cs (8)
862private SyntaxTree? AssociatedSyntaxTree => IsFileLocal ? declaration.Declarations[0].Location.SourceTree : null; 868if (AssociatedSyntaxTree is not SyntaxTree syntaxTree) 1011public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken) 1093internal int CalculateSyntaxOffsetInSynthesizedConstructor(int position, SyntaxTree tree, bool isStatic) 1136internal bool TryCalculateSyntaxOffsetOfPositionInInitializer(int position, SyntaxTree tree, bool isStatic, int ctorInitializerLength, out int syntaxOffset) 1167static bool findInitializer(ImmutableArray<ImmutableArray<FieldOrPropertyInitializer>> initializers, int position, SyntaxTree tree, 1321var conflictDict = new Dictionary<(string name, int arity, SyntaxTree? syntaxTree), SourceNamedTypeSymbol>(); 1879var tree = declaration.Declarations[0].SyntaxReference.SyntaxTree;
Symbols\Source\SourceMemberFieldSymbol.cs (1)
633public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default(CancellationToken))
Symbols\Source\SourceMemberMethodSymbol.cs (1)
1130internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
93internal SyntaxTree SyntaxTree 1073SyntaxTree? matchingTree = matchingTrees[0]; 1267SyntaxTree? matchingTree = matchingTrees[0];
Symbols\Source\SourceNamedTypeSymbol.cs (1)
153var syntaxTree = syntaxRef.SyntaxTree;
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
874static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueGlobalUsingsNotInTree(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes, SyntaxTree tree)
Symbols\Source\SourceNamespaceSymbol.cs (3)
108public override bool HasLocationContainedWithin(SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 386var leftTree = possibleFileLocalType.MergedDeclaration.Declarations[0].Location.SourceTree; 456public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default(CancellationToken))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
442SyntaxTree tree, 620internal sealed override bool CallsAreOmitted(SyntaxTree syntaxTree)
Symbols\Source\SourcePropertySymbol.cs (1)
544var syntaxTree = SyntaxTree;
Symbols\Source\SourcePropertySymbolBase.cs (1)
847internal SyntaxTree SyntaxTree
Symbols\SubstitutedMethodSymbol.cs (2)
302internal sealed override bool CallsAreOmitted(SyntaxTree syntaxTree) 354internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Symbol.cs (4)
440public virtual bool HasLocationContainedWithin(SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 452protected static bool IsLocationContainedWithin(Location loc, SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 932public virtual bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default(CancellationToken)) 953protected static bool IsDefinedInSourceTree(SyntaxReference syntaxRef, SyntaxTree tree, TextSpan? definedWithinSpan)
Symbols\SymbolDistinguisher.cs (1)
168var tree = syntaxReferences[0].SyntaxTree;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
280internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) 287var syntaxTree = CSharpSyntaxTree.Dummy;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
346internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
268internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedInstanceMethodSymbol.cs (1)
69internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
233internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
410internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
193internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) 254public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken)
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
375internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Syntax\CSharpLineDirectiveMap.cs (1)
16public CSharpLineDirectiveMap(SyntaxTree syntaxTree)
Syntax\CSharpPragmaWarningStateMap.cs (3)
39public CSharpPragmaWarningStateMap(SyntaxTree syntaxTree) : 44protected override WarningStateMapEntry[] CreateWarningStateMapEntries(SyntaxTree syntaxTree) 58private static void GetAllPragmaWarningDirectives(SyntaxTree syntaxTree, ArrayBuilder<DirectiveTriviaSyntax> directiveList)
Syntax\CSharpSyntaxNode.cs (5)
37internal CSharpSyntaxNode(GreenNode green, int position, SyntaxTree syntaxTree) 48internal new SyntaxTree SyntaxTree 58private static SyntaxTree ComputeSyntaxTree(CSharpSyntaxNode node) 61SyntaxTree? tree = null; 456protected override SyntaxTree SyntaxTreeCore
Syntax\CSharpSyntaxTree.cs (22)
29internal static readonly SyntaxTree Dummy = new DummySyntaxTree(); 110/// Ensure that <see cref="SyntaxTree.HasCompilationUnitRoot"/> is true for this tree prior to invoking this method. 112/// <exception cref="InvalidCastException">Throws this exception if <see cref="SyntaxTree.HasCompilationUnitRoot"/> is false.</exception> 126public override bool IsEquivalentTo(SyntaxTree tree, bool topLevel = false) 314public static SyntaxTree Create(CSharpSyntaxNode root, CSharpParseOptions? options = null, string? path = "", Encoding? encoding = null) 330public static SyntaxTree Create( 357internal static SyntaxTree Create( 380internal static SyntaxTree CreateForDebugger(CSharpSyntaxNode root, SourceText text, CSharpParseOptions options) 395internal static SyntaxTree CreateWithoutClone(CSharpSyntaxNode root) 415internal static SyntaxTree ParseTextLazy( 430public static SyntaxTree ParseText( 451public static SyntaxTree ParseText( 470public static SyntaxTree ParseText( 490public static SyntaxTree ParseText( 534public override SyntaxTree WithChangedText(SourceText newText) 553private SyntaxTree WithChanges(SourceText newText, IReadOnlyList<TextChangeRange> changes) 597public override IList<TextSpan> GetChangedSpans(SyntaxTree oldTree) 612public override IList<TextChange> GetChanges(SyntaxTree oldTree) 658/// otherwise it's <see cref="SyntaxTree.FilePath"/>. 910public static SyntaxTree ParseText( 921public static SyntaxTree ParseText( 933public static SyntaxTree Create(
Syntax\CSharpSyntaxTree.Dummy.cs (2)
94public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 97public override SyntaxTree WithFilePath(string path)
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (4)
70var tree = SyntaxFactory.ParseSyntaxTree(_text, _options, _path, cancellationToken); 109public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 128public override SyntaxTree WithFilePath(string path) 155public override SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (3)
123public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 142public override SyntaxTree WithFilePath(string path) 162public override SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Syntax\NullableContextStateMap.cs (2)
44internal static NullableContextStateMap Create(SyntaxTree tree) 136private static ImmutableArray<NullableContextState> GetContexts(SyntaxTree tree)
Syntax\SimpleSyntaxReference.cs (1)
22public override SyntaxTree SyntaxTree
Syntax\SyntaxEquivalence.cs (2)
19internal static bool AreEquivalent(SyntaxTree? before, SyntaxTree? after, Func<SyntaxKind, bool>? ignoreChildNode, bool topLevel)
Syntax\SyntaxExtensions.cs (1)
177internal static bool ReportDocumentationCommentDiagnostics(this SyntaxTree tree)
Syntax\SyntaxFactory.cs (10)
1547public static SyntaxTree SyntaxTree(SyntaxNode root, ParseOptions? options = null, string path = "", Encoding? encoding = null) 1555public static SyntaxTree ParseSyntaxTree( 1567public static SyntaxTree ParseSyntaxTree( 1938public static bool AreEquivalent(SyntaxTree? oldTree, SyntaxTree? newTree, bool topLevel) 2315public static bool IsCompleteSubmission(SyntaxTree tree) 2782public static SyntaxTree ParseSyntaxTree( 2796public static SyntaxTree ParseSyntaxTree( 2809public static SyntaxTree ParseSyntaxTree( 2824public static SyntaxTree ParseSyntaxTree(
Syntax\SyntaxTreeDiagnosticEnumerator.cs (2)
16private readonly SyntaxTree? _syntaxTree; 22internal SyntaxTreeDiagnosticEnumerator(SyntaxTree syntaxTree, GreenNode? node, int position)
Microsoft.CodeAnalysis.CSharp.CodeStyle (65)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
35var syntaxTree = namespaceDeclaration.SyntaxTree;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
66var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
130var tree = context.SemanticModel.SyntaxTree; 175var tree = syntaxContext.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
51IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
60var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (3)
187public static SyntaxTreeState Create(bool defaultCompleted, NullableContextOptions compilationOptions, SyntaxTree tree, CancellationToken cancellationToken) 267private readonly ConcurrentDictionary<SyntaxTree, SyntaxTreeState> _codeBlockIntervals = []; 324private SyntaxTreeState GetOrCreateSyntaxTreeState(SyntaxTree tree, bool defaultCompleted, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
29protected override bool SupportsDiscard(SyntaxTree tree)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (3)
38var syntaxTree = semanticModel.SyntaxTree; 141var syntaxTree = semanticModel.SyntaxTree; 205SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, NotificationOption2 notification, ExpressionSyntax expression, bool changesSemantics)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
29var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
42var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
44var syntaxTree = semanticModel.SyntaxTree; 86var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
41var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
40var syntaxTree = context.SemanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
41var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (1)
44var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
59var syntaxTree = expression.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
57var syntaxTree = node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
83SyntaxTree? currentSyntaxTree = null; 102var fieldSyntaxTree = fieldSyntaxReference.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
20public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var syntaxTree = genericIdentifier.SyntaxTree!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (29)
17public static ISet<SyntaxKind> GetPrecedingModifiers(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 21this SyntaxTree syntaxTree, 42this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 48this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 54this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 80this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 92public static bool IsRightOfDotOrArrowOrColonColon(this SyntaxTree syntaxTree, int position, SyntaxToken targetToken, CancellationToken cancellationToken) 99public static bool IsRightOfDotOrArrow(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 102public static bool IsRightOfDot(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken) 119public static bool IsRightOfNumericLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 125public static bool IsAfterKeyword(this SyntaxTree syntaxTree, int position, SyntaxKind kind, CancellationToken cancellationToken) 133public static bool IsEntirelyWithinNonUserCodeComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 145public static bool IsEntirelyWithinComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 155public static bool IsCrefContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 168public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 180this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 224this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 242this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 259this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 273this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 297this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 382this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 389public static bool IsEntirelyWithinStringLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 393this SyntaxTree syntaxTree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken) 442this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 470this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 532public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 540public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
154this SyntaxTrivia trivia, SyntaxTree syntaxTree, CancellationToken cancellationToken, bool findInsideTrivia = false)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
120public bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 124public bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken) 1103public TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1536public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
298var tree = token1.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
184var tree = semanticModel.SyntaxTree; 195var newTree = tree.WithRootAndOptions(newRoot, tree.Options);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (84)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
214SyntaxTree tree, SyntaxNode root, string indentation, TextLine textLine, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
43protected override async Task<Tuple<SyntaxTree, SyntaxNode>?> GetRootInOtherSyntaxTreeAsync(
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
535var syntaxTree = group.Key;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (3)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options); 202var contextTree = contextLocation != null && contextLocation.IsInSource
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (7)
185var syntaxTree = semanticModel.SyntaxTree; 355var modifiers = SyntaxTree.GetPrecedingModifiers(positionBeforeRecordKeyword, cancellationToken); 377if (SyntaxTree.IsMemberDeclarationContext( 427=> IsGlobalStatementContext && SyntaxTree.Options.Kind is SourceCodeKind.Regular; 462return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken); 464else if (SyntaxTree.IsScript() 469return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (63)
28public static bool IsAttributeNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 77this SyntaxTree syntaxTree, 137this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 239this SyntaxTree syntaxTree, 319this SyntaxTree syntaxTree, 335public static bool IsLocalFunctionDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 339this SyntaxTree syntaxTree, 368this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 528this SyntaxTree syntaxTree, 614this SyntaxTree syntaxTree, 668public static bool IsNamespaceDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 685public static bool IsPartialTypeDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, [NotNullWhen(true)] out TypeDeclarationSyntax? declarationSyntax) 707public static bool IsDefinitelyNotTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 718this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 768public static bool IsBaseClassOrInterfaceContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 786public static bool IsUsingAliasTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 802public static bool IsUsingStaticContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 814this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 842this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 860public static bool IsTypeParameterConstraintContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 891public static bool IsTypeOfExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 903public static bool IsDefaultExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 916this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 929this SyntaxTree syntaxTree, 954public static bool IsGenericConstraintContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 959this SyntaxTree syntaxTree, 1047this SyntaxTree syntaxTree, 1137this SyntaxTree syntaxTree, 1165this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1180this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1194public static bool IsParameterTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1211public static bool IsPossibleExtensionMethodContext(this SyntaxTree syntaxTree, SyntaxToken tokenOnLeftOfPosition) 1223this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1255this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1282this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1307public static bool IsPossibleTupleContext(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1362public static bool IsAtStartOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1456public static bool IsAtEndOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1599public static bool IsPossibleDeconstructionDesignation(this SyntaxTree syntaxTree, 1709this SyntaxTree syntaxTree, 1749this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1766this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1880this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1897public static bool IsCatchVariableDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1914public static bool IsIsOrAsTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1926this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1944private static bool IsNonConstantExpressionContext(SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1951public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1958public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1976public static bool IsGlobalStatementContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1999public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2030this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 2043public static bool IsDefiniteCastTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2057public static bool IsConstantExpressionContext(this SyntaxTree syntaxTree, int position, 2137public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2163this SyntaxTree syntaxTree, 2741public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2808this SyntaxTree syntaxTree, 2928this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2963public static bool IsCatchFilterContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2988public static bool IsEnumBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3000public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 3055public static bool IsFunctionPointerCallingConventionContext(this SyntaxTree syntaxTree, SyntaxToken targetToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
15public static bool IsPrimaryFunctionExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 23public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 33this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 39this SyntaxTree syntaxTree, 48this SyntaxTree syntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
28public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
192var syntaxTree = SemanticModel.SyntaxTree;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
305var tree = comp.SyntaxTrees.Single(); 754var compilation = CreateCompilation(new SyntaxTree[0]); 878var compilation = CreateCompilation(new SyntaxTree[0]); 12228new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(analyzerSource) },
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (2)
138var tree = document.SyntaxTree; 173private static SyntaxNode? ParseNode(SyntaxTree tree, SyntaxNode owningNode, string textToParse)
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (1)
31var tree = SyntaxFactory.ParseSyntaxTree(SourceText.From(code, encoding: null, SourceHashAlgorithms.Default), options);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (503)
Debugging\ProximityExpressionsGetterTests.cs (3)
38private static SyntaxTree GetTree() 41private static SyntaxTree GetTreeFromCode(string code) 47var tree = GetTreeFromCode(@"using System;
Debugging\ProximityExpressionsGetterTests.Lines.cs (332)
22var tree = GetTree(); 33var tree = GetTree(); 44var tree = GetTree(); 55var tree = GetTree(); 66var tree = GetTree(); 77var tree = GetTree(); 88var tree = GetTree(); 99var tree = GetTree(); 110var tree = GetTree(); 121var tree = GetTree(); 132var tree = GetTree(); 144var tree = GetTree(); 156var tree = GetTree(); 168var tree = GetTree(); 179var tree = GetTree(); 190var tree = GetTree(); 201var tree = GetTree(); 213var tree = GetTree(); 225var tree = GetTree(); 237var tree = GetTree(); 249var tree = GetTree(); 261var tree = GetTree(); 272var tree = GetTree(); 284var tree = GetTree(); 296var tree = GetTree(); 308var tree = GetTree(); 320var tree = GetTree(); 332var tree = GetTree(); 344var tree = GetTree(); 356var tree = GetTree(); 368var tree = GetTree(); 380var tree = GetTree(); 392var tree = GetTree(); 404var tree = GetTree(); 416var tree = GetTree(); 428var tree = GetTree(); 439var tree = GetTree(); 450var tree = GetTree(); 462var tree = GetTree(); 474var tree = GetTree(); 486var tree = GetTree(); 498var tree = GetTree(); 510var tree = GetTree(); 521var tree = GetTree(); 533var tree = GetTree(); 545var tree = GetTree(); 557var tree = GetTree(); 569var tree = GetTree(); 581var tree = GetTree(); 593var tree = GetTree(); 605var tree = GetTree(); 617var tree = GetTree(); 629var tree = GetTree(); 641var tree = GetTree(); 653var tree = GetTree(); 665var tree = GetTree(); 677var tree = GetTree(); 689var tree = GetTree(); 701var tree = GetTree(); 713var tree = GetTree(); 725var tree = GetTree(); 737var tree = GetTree(); 749var tree = GetTree(); 761var tree = GetTree(); 773var tree = GetTree(); 785var tree = GetTree(); 797var tree = GetTree(); 809var tree = GetTree(); 821var tree = GetTree(); 833var tree = GetTree(); 845var tree = GetTree(); 857var tree = GetTree(); 869var tree = GetTree(); 881var tree = GetTree(); 893var tree = GetTree(); 905var tree = GetTree(); 917var tree = GetTree(); 929var tree = GetTree(); 941var tree = GetTree(); 953var tree = GetTree(); 965var tree = GetTree(); 977var tree = GetTree(); 989var tree = GetTree(); 1001var tree = GetTree(); 1013var tree = GetTree(); 1025var tree = GetTree(); 1037var tree = GetTree(); 1049var tree = GetTree(); 1061var tree = GetTree(); 1073var tree = GetTree(); 1085var tree = GetTree(); 1097var tree = GetTree(); 1109var tree = GetTree(); 1121var tree = GetTree(); 1133var tree = GetTree(); 1145var tree = GetTree(); 1157var tree = GetTree(); 1169var tree = GetTree(); 1181var tree = GetTree(); 1193var tree = GetTree(); 1205var tree = GetTree(); 1217var tree = GetTree(); 1229var tree = GetTree(); 1241var tree = GetTree(); 1252var tree = GetTree(); 1264var tree = GetTree(); 1276var tree = GetTree(); 1288var tree = GetTree(); 1300var tree = GetTree(); 1312var tree = GetTree(); 1323var tree = GetTree(); 1335var tree = GetTree(); 1347var tree = GetTree(); 1359var tree = GetTree(); 1371var tree = GetTree(); 1383var tree = GetTree(); 1394var tree = GetTree(); 1406var tree = GetTree(); 1418var tree = GetTree(); 1430var tree = GetTree(); 1441var tree = GetTree(); 1452var tree = GetTree(); 1464var tree = GetTree(); 1476var tree = GetTree(); 1488var tree = GetTree(); 1500var tree = GetTree(); 1512var tree = GetTree(); 1524var tree = GetTree(); 1536var tree = GetTree(); 1548var tree = GetTree(); 1560var tree = GetTree(); 1572var tree = GetTree(); 1584var tree = GetTree(); 1596var tree = GetTree(); 1608var tree = GetTree(); 1620var tree = GetTree(); 1632var tree = GetTree(); 1644var tree = GetTree(); 1656var tree = GetTree(); 1668var tree = GetTree(); 1680var tree = GetTree(); 1692var tree = GetTree(); 1704var tree = GetTree(); 1716var tree = GetTree(); 1728var tree = GetTree(); 1740var tree = GetTree(); 1752var tree = GetTree(); 1764var tree = GetTree(); 1776var tree = GetTree(); 1788var tree = GetTree(); 1800var tree = GetTree(); 1812var tree = GetTree(); 1824var tree = GetTree(); 1835var tree = GetTree(); 1846var tree = GetTree(); 1858var tree = GetTree(); 1870var tree = GetTree(); 1882var tree = GetTree(); 1894var tree = GetTree(); 1906var tree = GetTree(); 1918var tree = GetTree(); 1930var tree = GetTree(); 1942var tree = GetTree(); 1954var tree = GetTree(); 1966var tree = GetTree(); 1978var tree = GetTree(); 1990var tree = GetTree(); 2002var tree = GetTree(); 2014var tree = GetTree(); 2026var tree = GetTree(); 2038var tree = GetTree(); 2050var tree = GetTree(); 2062var tree = GetTree(); 2074var tree = GetTree(); 2086var tree = GetTree(); 2097var tree = GetTree(); 2108var tree = GetTree(); 2120var tree = GetTree(); 2132var tree = GetTree(); 2144var tree = GetTree(); 2156var tree = GetTree(); 2168var tree = GetTree(); 2180var tree = GetTree(); 2192var tree = GetTree(); 2204var tree = GetTree(); 2216var tree = GetTree(); 2228var tree = GetTree(); 2240var tree = GetTree(); 2252var tree = GetTree(); 2264var tree = GetTree(); 2276var tree = GetTree(); 2288var tree = GetTree(); 2300var tree = GetTree(); 2312var tree = GetTree(); 2324var tree = GetTree(); 2336var tree = GetTree(); 2348var tree = GetTree(); 2360var tree = GetTree(); 2371var tree = GetTree(); 2382var tree = GetTree(); 2394var tree = GetTree(); 2406var tree = GetTree(); 2418var tree = GetTree(); 2430var tree = GetTree(); 2442var tree = GetTree(); 2454var tree = GetTree(); 2466var tree = GetTree(); 2478var tree = GetTree(); 2490var tree = GetTree(); 2502var tree = GetTree(); 2514var tree = GetTree(); 2526var tree = GetTree(); 2538var tree = GetTree(); 2550var tree = GetTree(); 2562var tree = GetTree(); 2574var tree = GetTree(); 2586var tree = GetTree(); 2598var tree = GetTree(); 2609var tree = GetTree(); 2620var tree = GetTree(); 2632var tree = GetTree(); 2644var tree = GetTree(); 2656var tree = GetTree(); 2668var tree = GetTree(); 2680var tree = GetTree(); 2692var tree = GetTree(); 2704var tree = GetTree(); 2716var tree = GetTree(); 2728var tree = GetTree(); 2740var tree = GetTree(); 2752var tree = GetTree(); 2764var tree = GetTree(); 2776var tree = GetTree(); 2788var tree = GetTree(); 2800var tree = GetTree(); 2812var tree = GetTree(); 2824var tree = GetTree(); 2836var tree = GetTree(); 2848var tree = GetTree(); 2860var tree = GetTree(); 2871var tree = GetTree(); 2882var tree = GetTree(); 2894var tree = GetTree(); 2906var tree = GetTree(); 2918var tree = GetTree(); 2930var tree = GetTree(); 2942var tree = GetTree(); 2954var tree = GetTree(); 2966var tree = GetTree(); 2978var tree = GetTree(); 2990var tree = GetTree(); 3002var tree = GetTree(); 3014var tree = GetTree(); 3026var tree = GetTree(); 3038var tree = GetTree(); 3050var tree = GetTree(); 3062var tree = GetTree(); 3074var tree = GetTree(); 3086var tree = GetTree(); 3097var tree = GetTree(); 3108var tree = GetTree(); 3120var tree = GetTree(); 3132var tree = GetTree(); 3144var tree = GetTree(); 3156var tree = GetTree(); 3168var tree = GetTree(); 3180var tree = GetTree(); 3192var tree = GetTree(); 3204var tree = GetTree(); 3216var tree = GetTree(); 3228var tree = GetTree(); 3240var tree = GetTree(); 3252var tree = GetTree(); 3264var tree = GetTree(); 3276var tree = GetTree(); 3288var tree = GetTree(); 3300var tree = GetTree(); 3312var tree = GetTree(); 3324var tree = GetTree(); 3336var tree = GetTree(); 3348var tree = GetTree(); 3360var tree = GetTree(); 3372var tree = GetTree(); 3384var tree = GetTree(); 3397var tree = GetTree(); 3409var tree = GetTree(); 3421var tree = GetTree(); 3433var tree = GetTree(); 3445var tree = GetTree(); 3457var tree = GetTree(); 3469var tree = GetTree(); 3481var tree = GetTree(); 3493var tree = GetTree(); 3505var tree = GetTree(); 3517var tree = GetTree(); 3528var tree = GetTree(); 3539var tree = GetTree(); 3551var tree = GetTree(); 3563var tree = GetTree(); 3575var tree = GetTree(); 3587var tree = GetTree(); 3599var tree = GetTree(); 3611var tree = GetTree(); 3623var tree = GetTree(); 3635var tree = GetTree(); 3647var tree = GetTree(); 3659var tree = GetTree(); 3671var tree = GetTree(); 3683var tree = GetTree(); 3695var tree = GetTree(); 3707var tree = GetTree(); 3719var tree = GetTree(); 3731var tree = GetTree(); 3743var tree = GetTree(); 3755var tree = GetTree(); 3767var tree = GetTree(); 3779var tree = GetTree(); 3791var tree = GetTree(); 3803var tree = GetTree(); 3814var tree = GetTree(); 3825var tree = GetTree(); 3837var tree = GetTree(); 3849var tree = GetTree(); 3861var tree = GetTree(); 3873var tree = GetTree(); 3885var tree = GetTree(); 3897var tree = GetTree(); 3909var tree = GetTree(); 3921var tree = GetTree(); 3933var tree = GetTree(); 3944var tree = GetTree(); 3955var tree = GetTree();
Debugging\ProximityExpressionsGetterTests.Statements.cs (142)
25var tree = GetTree(); 39var tree = GetTree(); 53var tree = GetTree(); 67var tree = GetTree(); 81var tree = GetTree(); 95var tree = GetTree(); 109var tree = GetTree(); 123var tree = GetTree(); 137var tree = GetTree(); 151var tree = GetTree(); 165var tree = GetTree(); 179var tree = GetTree(); 193var tree = GetTree(); 207var tree = GetTree(); 221var tree = GetTree(); 235var tree = GetTree(); 249var tree = GetTree(); 263var tree = GetTree(); 277var tree = GetTree(); 291var tree = GetTree(); 305var tree = GetTree(); 319var tree = GetTree(); 333var tree = GetTree(); 347var tree = GetTree(); 361var tree = GetTree(); 375var tree = GetTree(); 389var tree = GetTree(); 403var tree = GetTree(); 417var tree = GetTree(); 431var tree = GetTree(); 445var tree = GetTree(); 459var tree = GetTree(); 473var tree = GetTree(); 487var tree = GetTree(); 501var tree = GetTree(); 515var tree = GetTree(); 529var tree = GetTree(); 543var tree = GetTree(); 557var tree = GetTree(); 571var tree = GetTree(); 585var tree = GetTree(); 599var tree = GetTree(); 613var tree = GetTree(); 627var tree = GetTree(); 641var tree = GetTree(); 655var tree = GetTree(); 669var tree = GetTree(); 683var tree = GetTree(); 697var tree = GetTree(); 711var tree = GetTree(); 725var tree = GetTree(); 739var tree = GetTree(); 753var tree = GetTree(); 767var tree = GetTree(); 781var tree = GetTree(); 795var tree = GetTree(); 809var tree = GetTree(); 823var tree = GetTree(); 837var tree = GetTree(); 851var tree = GetTree(); 865var tree = GetTree(); 879var tree = GetTree(); 893var tree = GetTree(); 907var tree = GetTree(); 921var tree = GetTree(); 935var tree = GetTree(); 949var tree = GetTree(); 963var tree = GetTree(); 977var tree = GetTree(); 991var tree = GetTree(); 1005var tree = GetTree(); 1019var tree = GetTree(); 1033var tree = GetTree(); 1047var tree = GetTree(); 1061var tree = GetTree(); 1075var tree = GetTree(); 1089var tree = GetTree(); 1103var tree = GetTree(); 1117var tree = GetTree(); 1131var tree = GetTree(); 1145var tree = GetTree(); 1159var tree = GetTree(); 1173var tree = GetTree(); 1187var tree = GetTree(); 1201var tree = GetTree(); 1215var tree = GetTree(); 1229var tree = GetTree(); 1243var tree = GetTree(); 1257var tree = GetTree(); 1271var tree = GetTree(); 1285var tree = GetTree(); 1299var tree = GetTree(); 1313var tree = GetTree(); 1327var tree = GetTree(); 1341var tree = GetTree(); 1355var tree = GetTree(); 1369var tree = GetTree(); 1383var tree = GetTree(); 1397var tree = GetTree(); 1411var tree = GetTree(); 1425var tree = GetTree(); 1439var tree = GetTree(); 1453var tree = GetTree(); 1467var tree = GetTree(); 1481var tree = GetTree(); 1495var tree = GetTree(); 1509var tree = GetTree(); 1523var tree = GetTree(); 1537var tree = GetTree(); 1551var tree = GetTree(); 1565var tree = GetTree(); 1579var tree = GetTree(); 1593var tree = GetTree(); 1607var tree = GetTree(); 1621var tree = GetTree(); 1635var tree = GetTree(); 1649var tree = GetTree(); 1663var tree = GetTree(); 1677var tree = GetTree(); 1691var tree = GetTree(); 1705var tree = GetTree(); 1719var tree = GetTree(); 1733var tree = GetTree(); 1747var tree = GetTree(); 1761var tree = GetTree(); 1775var tree = GetTree(); 1789var tree = GetTree(); 1803var tree = GetTree(); 1817var tree = GetTree(); 1831var tree = GetTree(); 1845var tree = GetTree(); 1859var tree = GetTree(); 1873var tree = GetTree(); 1887var tree = GetTree(); 1901var tree = GetTree(); 1915var tree = GetTree(); 1929var tree = GetTree(); 1943var tree = GetTree(); 1957var tree = GetTree(); 1971var tree = GetTree(); 1985var tree = GetTree(); 1999var tree = GetTree();
Extensions\ContextQuery\AbstractContextTests.cs (4)
14protected abstract void CheckResult(bool validLocation, int position, SyntaxTree syntaxTree); 39var tree = SyntaxFactory.ParseSyntaxTree(text, options: options); 61var tree = SyntaxFactory.ParseSyntaxTree(text, options: options); 88var tree = SyntaxFactory.ParseSyntaxTree(text, options: options);
Extensions\ContextQuery\IsPossibleDeconstructionDesignationTests.cs (1)
18protected override void CheckResult(bool expected, int position, SyntaxTree syntaxTree)
Extensions\ContextQuery\NamespaceContextTests.cs (1)
17protected override void CheckResult(bool validLocation, int position, SyntaxTree syntaxTree)
Extensions\ContextQuery\PossibleTupleContextTests.cs (1)
18protected override void CheckResult(bool validLocation, int position, SyntaxTree syntaxTree)
Extensions\ContextQuery\TypeContextTests.cs (1)
17protected override void CheckResult(bool validLocation, int position, SyntaxTree syntaxTree)
Extensions\SyntaxTreeExtensionsTests.cs (5)
16private static void VerifyWholeLineIsActive(SyntaxTree tree, int lineNumber) 25private static void VerifyWholeLineIsInactive(SyntaxTree tree, int lineNumber) 44var tree = CSharpSyntaxTree.ParseText(code); 59var tree = CSharpSyntaxTree.ParseText(code); 74var tree = CSharpSyntaxTree.ParseText(code);
Formatting\CodeCleanupTests.TestFixers.cs (1)
34var sourceTree = diagnostic.Location.SourceTree;
Formatting\FormattingEngineTests.cs (2)
2219var tree = SyntaxFactory.ParseSyntaxTree(code, options: TestOptions.Script); 2537var syntaxTree = CSharpSyntaxTree.ParseText(text);
Semantics\SpeculationAnalyzerTests.cs (2)
521protected override SyntaxTree Parse(string text) 527protected override Compilation CreateCompilation(SyntaxTree tree)
SymbolKey\SymbolKeyCompilationsTests.cs (2)
344var src1 = SyntaxFactory.ParseSyntaxTree(""" 353var src2 = SyntaxFactory.ParseSyntaxTree("""
SymbolKey\SymbolKeyTestBase.cs (1)
250foreach (var tree in comp.SyntaxTrees)
SymbolKey\SymbolKeyTests.cs (1)
292var tree = bodyCompilation.SyntaxTrees.Single();
Utilities\CSharpServiceTestExtensions.cs (2)
43internal static T DigToFirstNodeOfType<T>(this SyntaxTree syntaxTree) 49internal static TypeDeclarationSyntax DigToFirstTypeDeclaration(this SyntaxTree syntaxTree)
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
250var tree = await currentSnapshot.Projects.First().Documents.First().GetSyntaxTreeAsync(); 707var syntaxTree = await doc.GetSyntaxTreeAsync(CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
63var tree = SyntaxFactory.ParseSyntaxTree(text, options: options);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (330)
BreakingChanges.cs (2)
197var tree = Parse(text, options: TestOptions.RegularWithDocumentationComments); 216var tree = Parse(text, options: TestOptions.RegularWithDocumentationComments);
CodeGen\CodeGenAsyncIteratorTests.cs (2)
8745var tree = comp.SyntaxTrees.Single(); 8811var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (2)
893var tree = compilation.SyntaxTrees.Single(); 945var tree = compilation.SyntaxTrees.Single();
CodeGen\CodeGenAwaitForeachTests.cs (31)
934var tree = comp.SyntaxTrees.Single(); 1659var tree = comp.SyntaxTrees.Single(); 1719var tree = comp.SyntaxTrees.Single(); 1863var tree = comp.SyntaxTrees.Single(); 1900var tree = comp.SyntaxTrees.Single(); 1940var tree = comp.SyntaxTrees.Single(); 1977var tree = comp.SyntaxTrees.Single(); 2011var tree = comp.SyntaxTrees.Single(); 2967var tree = comp.SyntaxTrees.Single(); 3032var tree = comp.SyntaxTrees.First(); 3117var tree = comp.SyntaxTrees.First(); 3235var tree = comp.SyntaxTrees.First(); 3290var tree = comp.SyntaxTrees.Single(); 3348var tree = comp.SyntaxTrees.Single(); 3544var tree = comp.SyntaxTrees.Single(); 3592var tree = comp.SyntaxTrees.Single(); 3713var tree = comp.SyntaxTrees.First(); 4237var tree = comp.SyntaxTrees.Single(); 4460var tree = comp.SyntaxTrees.Single(); 4534var tree = comp.SyntaxTrees.Single(); 4644var tree = comp.SyntaxTrees.Single(); 4743var tree = comp.SyntaxTrees.Single(); 5047var tree = comp.SyntaxTrees.Single(); 5128var tree = comp.SyntaxTrees.Single(); 5354var tree = comp.SyntaxTrees.Single(); 6437var tree = comp.SyntaxTrees.Single(); 9105var tree = comp.SyntaxTrees.First(); 9181var tree = comp.SyntaxTrees.First(); 9259var tree = comp.SyntaxTrees.First(); 9320var tree = comp.SyntaxTrees.First(); 9391var tree = comp.SyntaxTrees.First();
CodeGen\CodeGenCheckedTests.cs (2)
2913var tree = comp.SyntaxTrees.Single(); 2945var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenDeconstructTests.cs (90)
93var tree = compilation.SyntaxTrees.First(); 253var tree = comp.Compilation.SyntaxTrees.First(); 309var tree = comp.SyntaxTrees.First(); 1109var tree = comp.Compilation.SyntaxTrees.First(); 1364var tree = compilation.SyntaxTrees.First(); 1421var tree = compilation.SyntaxTrees.First(); 1465var tree = comp.SyntaxTrees.First(); 1506var tree = comp.SyntaxTrees.First(); 1559var tree = comp.SyntaxTrees.First(); 1666var tree = compilation.SyntaxTrees.First(); 2285var tree = comp.Compilation.SyntaxTrees.First(); 2685var tree = compilation.SyntaxTrees.First(); 3127var tree = compilation.SyntaxTrees.First(); 3175var tree = compilation.SyntaxTrees.First(); 3239var tree = compilation.SyntaxTrees.First(); 3277var tree = compilation.SyntaxTrees.First(); 3327var tree = compilation.SyntaxTrees.First(); 3365var tree = compilation.SyntaxTrees.First(); 3440var tree = compilation.SyntaxTrees.First(); 3476var tree = compilation.SyntaxTrees.First(); 3541var tree = compilation.SyntaxTrees.First(); 3633private static SingleVariableDesignationSyntax GetDeconstructionVariable(SyntaxTree tree, string name) 3638private static IEnumerable<DiscardDesignationSyntax> GetDiscardDesignations(SyntaxTree tree) 3643private static IEnumerable<IdentifierNameSyntax> GetDiscardIdentifiers(SyntaxTree tree) 3648private static IdentifierNameSyntax GetReference(SyntaxTree tree, string name) 3653private static IdentifierNameSyntax[] GetReferences(SyntaxTree tree, string name, int count) 3660private static IEnumerable<IdentifierNameSyntax> GetReferences(SyntaxTree tree, string name) 3687var tree = compilation.SyntaxTrees.First(); 3732var tree = compilation.SyntaxTrees.First(); 3789var tree = compilation.SyntaxTrees.First(); 3839var tree = compilation.SyntaxTrees.First(); 3885var tree = compilation.SyntaxTrees.First(); 3929var tree = compilation.SyntaxTrees.First(); 3975var tree = compilation.SyntaxTrees.First(); 4024var tree = compilation.SyntaxTrees.First(); 4130var tree = compilation.SyntaxTrees.First(); 4215var tree = compilation.SyntaxTrees.First(); 4326var tree = compilation.SyntaxTrees.First(); 4402var tree = compilation.SyntaxTrees.First(); 4435var tree = compilation.SyntaxTrees.First(); 4589var tree = compilation.SyntaxTrees.First(); 5018var tree = compilation.SyntaxTrees.First(); 5170var tree = compilation.SyntaxTrees.First(); 5307var tree = compilation.SyntaxTrees.First(); 5343var tree = compilation.SyntaxTrees.First(); 5398var tree = comp.SyntaxTrees.First(); 5431var tree = comp.SyntaxTrees.First(); 5469var tree = comp.SyntaxTrees.First(); 5501var tree = comp.SyntaxTrees.First(); 5532var tree = comp.SyntaxTrees.First(); 5561var tree = comp.SyntaxTrees.First(); 5601var tree = comp.SyntaxTrees.First(); 5640var tree = comp.SyntaxTrees.First(); 5684var tree = comp.SyntaxTrees.First(); 5723var tree = comp.SyntaxTrees.First(); 5765var tree = comp.SyntaxTrees.First(); 5801var tree = comp.SyntaxTrees.First(); 5851var tree = comp.SyntaxTrees.First(); 5905var tree = comp.SyntaxTrees.First(); 5996var tree = comp.SyntaxTrees.First(); 6028var tree = comp.SyntaxTrees.First(); 6081var tree = comp.SyntaxTrees.First(); 6130var tree = comp.SyntaxTrees.First(); 6179var tree = comp.SyntaxTrees.First(); 6209var tree = comp.SyntaxTrees.First(); 6251var tree = comp.SyntaxTrees.First(); 6302var tree = comp.SyntaxTrees.First(); 6334var tree = comp.SyntaxTrees.First(); 6364var tree = comp.SyntaxTrees.First(); 6391var tree = comp.SyntaxTrees.First(); 6436var tree = compilation.SyntaxTrees.First(); 6559var tree = comp.SyntaxTrees.First(); 6857var tree = compilation.SyntaxTrees.First(); 6929var tree = compilation.SyntaxTrees.First(); 6972var tree = comp.SyntaxTrees.First(); 7065var tree = comp.SyntaxTrees.Single(); 7120var tree = compilation.SyntaxTrees.First(); 7173var tree = compilation.SyntaxTrees.First(); 7228var tree = compilation.SyntaxTrees.First(); 7266var tree = compilation.SyntaxTrees.First(); 7303var tree = compilation.SyntaxTrees.First(); 7351var tree = compilation.SyntaxTrees.First(); 7390var tree = compilation.SyntaxTrees.First(); 7426var tree = compilation.SyntaxTrees.First(); 7503var tree = compilation.SyntaxTrees.First(); 7560var tree = compilation.SyntaxTrees.First(); 8357var tree = comp.SyntaxTrees.Single(); 8584var tree = compilation.SyntaxTrees.Single(); 8628var tree = compilation.SyntaxTrees.Single(); 9008var tree = comp.SyntaxTrees.First();
CodeGen\CodeGenExprLambdaTests.cs (2)
1847var tree = comp.SyntaxTrees.Single(); 1884var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenFieldInitTests.cs (1)
650var trees = new List<SyntaxTree>();
CodeGen\CodeGenForEachTests.cs (1)
1756var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenFunctionPointersTests.cs (17)
3059var syntaxTree = comp.SyntaxTrees[0]; 3111var syntaxTree = comp.SyntaxTrees[0]; 3336var syntaxTree = comp.SyntaxTrees[0]; 3407var syntaxTree = comp.SyntaxTrees[0]; 3454var syntaxTree = comp.SyntaxTrees[0]; 3565var tree = comp.SyntaxTrees[0]; 3617var tree = comp.SyntaxTrees[0]; 3668var tree = comp.SyntaxTrees[0]; 3707var tree = comp.SyntaxTrees[0]; 4112var syntaxTree = comp.SyntaxTrees[0]; 4914var syntaxTree = comp.SyntaxTrees[0]; 7412var tree = comp.SyntaxTrees[0]; 7514var tree = comp.SyntaxTrees[0]; 7570var tree = allInCoreLib.SyntaxTrees[0]; 7639var tree = allInCoreLib.SyntaxTrees[0]; 7726var tree = comp1.SyntaxTrees[0]; 10801var tree = comp.SyntaxTrees[0];
CodeGen\CodeGenInterpolatedString.cs (1)
36var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenLocalFunctionTests.cs (5)
144var tree = comp.SyntaxTrees.Single(); 5745var syntaxTree = comp.SyntaxTrees.Single(); 5820var syntaxTree = comp.SyntaxTrees.Single(); 5895var syntaxTree = comp.SyntaxTrees.Single(); 6160var tree = comp.SyntaxTrees[0];
CodeGen\CodeGenOperators.cs (3)
5406var tree = result.Compilation.SyntaxTrees.Single(); 5694var tree = compilation.SyntaxTrees.Single(); 5732var tree = compilation.SyntaxTrees.Single();
CodeGen\CodeGenRefLocalTests.cs (3)
4030var tree = comp.SyntaxTrees.Single(); 4067var tree = comp.SyntaxTrees.Single(); 4101var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenScriptTests.cs (9)
25var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 44var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 62var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 88var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 113var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 138var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 169var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 197var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 636var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script);
CodeGen\CodeGenTests.cs (1)
475var tree = Parse(source);
CodeGen\CodeGenTupleEqualityTests.cs (36)
358var tree = comp.Compilation.SyntaxTrees.First(); 679var tree = comp.Compilation.SyntaxTrees.First(); 710var tree = comp.Compilation.SyntaxTrees.First(); 767var tree = comp.SyntaxTrees.First(); 789var tree = comp.SyntaxTrees[0]; 851var tree = comp.SyntaxTrees[0]; 899var tree = comp.SyntaxTrees[0]; 948var tree = comp.SyntaxTrees[0]; 998var tree = comp.SyntaxTrees[0]; 1052var tree = comp.SyntaxTrees[0]; 1086var tree = comp.SyntaxTrees[0]; 1118var tree = comp.SyntaxTrees[0]; 1149var tree = comp.SyntaxTrees[0]; 1209var tree = comp.SyntaxTrees[0]; 1309var tree = comp.SyntaxTrees[0]; 1395var tree = comp.SyntaxTrees[0]; 1460var tree = comp.SyntaxTrees[0]; 1493var tree = comp.SyntaxTrees[0]; 1554var tree = comp.SyntaxTrees[0]; 1591var tree = comp.SyntaxTrees[0]; 1616var tree = comp.SyntaxTrees[0]; 1671var tree = comp.SyntaxTrees[0]; 1773var tree = comp.SyntaxTrees[0]; 1915var tree = comp.SyntaxTrees[0]; 2570var tree = comp.SyntaxTrees.First(); 2638var tree = comp.SyntaxTrees.First(); 3275var tree = comp.SyntaxTrees.First(); 3681var tree = comp.SyntaxTrees.First(); 3805var tree = comp.SyntaxTrees.First(); 3908var tree = comp.SyntaxTrees.First(); 4033var tree = comp.SyntaxTrees.First(); 4080var tree = comp.SyntaxTrees.First(); 4181var tree = comp.SyntaxTrees[0]; 4274var tree = comp.SyntaxTrees.First(); 5119var tree = comp.SyntaxTrees.First(); 5155var tree = comp.SyntaxTrees.First();
CodeGen\CodeGenTupleTest.cs (108)
1600var tree = Parse(source, options: TestOptions.Regular); 3216var tree = compilation.SyntaxTrees.First(); 3249var tree = compilation.SyntaxTrees.First(); 3462var tree = compilation.SyntaxTrees.First(); 3633var tree = compilation.SyntaxTrees.First(); 3684var tree = compilation.SyntaxTrees.First(); 3930var tree = compilation.SyntaxTrees.First(); 3987var tree = compilation.SyntaxTrees.First(); 4020var tree = compilation.SyntaxTrees.First(); 4152var tree = compilation.SyntaxTrees.First(); 4837var tree = comp.SyntaxTrees.Single(); 5073var tree = comp.SyntaxTrees.Single(); 5117var tree = comp.SyntaxTrees.Single(); 5158var tree = comp.SyntaxTrees.Single(); 5202var tree = comp.SyntaxTrees.Single(); 5469var tree = Parse(source); 5798var tree = CSharpSyntaxTree.ParseText("class C { }"); 5909var tree = CSharpSyntaxTree.ParseText("class C { }"); 6350var syntaxTree = CSharpSyntaxTree.ParseText("class C { }"); 6386var syntaxTree = CSharpSyntaxTree.ParseText("class C { }"); 7495var tree = comp.SyntaxTrees.Single(); 7528var tree = comp.SyntaxTrees.Single(); 7565var tree = comp.SyntaxTrees.Single(); 7628var tree = comp.SyntaxTrees.Single(); 8287var tree = Parse(source, options: TestOptions.Regular); 8318var tree = Parse(source, options: TestOptions.Regular); 8373var tree = Parse(source, options: TestOptions.Regular); 8402var tree = Parse(source, options: TestOptions.Regular); 8431var tree = Parse(source, options: TestOptions.Regular); 8479var tree = Parse(source, options: TestOptions.Regular); 8513var tree = Parse(source, options: TestOptions.Regular); 8546var tree = Parse(source, options: TestOptions.Regular); 8575var tree = Parse(source, options: TestOptions.Regular); 8622var tree = Parse(source, options: TestOptions.Regular); 8657var tree = Parse(source, options: TestOptions.Regular); 8686var tree = Parse(source, options: TestOptions.Regular); 8715var tree = Parse(source, options: TestOptions.Regular); 8745var tree = Parse(source, options: TestOptions.Regular); 8800var tree = Parse(source, options: TestOptions.Regular); 8830var tree = Parse(source, options: TestOptions.Regular); 8889var tree = Parse(source, options: TestOptions.Regular); 8936var tree = Parse(source, options: TestOptions.Regular); 9007var tree = Parse(source, options: TestOptions.Regular); 9059var tree = Parse(source, options: TestOptions.Regular); 9136var tree = Parse(source, options: TestOptions.Regular); 9217var tree = Parse(source, options: TestOptions.Regular); 9300var tree = Parse(source, options: TestOptions.Regular); 9354var tree = Parse(source, options: TestOptions.Regular); 9852var tree = comp.SyntaxTrees.First(); 9903var tree = comp.SyntaxTrees.First(); 9945var tree = comp.SyntaxTrees.First(); 9991var tree = comp.SyntaxTrees.First(); 10057var tree = comp.SyntaxTrees.First(); 10096var tree = comp.SyntaxTrees.First(); 10130var tree = comp.SyntaxTrees.First(); 12690var tree = c.SyntaxTrees.Single(); 13971var tree = c.SyntaxTrees.Single(); 14242var tree = c.SyntaxTrees.Single(); 14430var tree = comp.SyntaxTrees.Single(); 16537var tree = comp.SyntaxTrees.Single(); 16562var tree = Parse(source, options: TestOptions.Regular); 16599var tree = Parse(source, options: TestOptions.Regular); 17205var tree = Parse(source, options: TestOptions.Regular); 17266var tree = Parse(source, options: TestOptions.Regular); 17325var tree = Parse(source, options: TestOptions.Regular); 17364var tree = Parse(source, options: TestOptions.Regular); 17396var tree = Parse(source, options: TestOptions.Regular7_1); 17429var tree = Parse(source, options: TestOptions.Regular7_1); 19058var tree = Parse(text); 19097var tree = Parse(text); 19136var tree = Parse(text); 19175var tree = Parse(text); 19227var tree = comp.SyntaxTrees.First(); 19289var tree = comp.SyntaxTrees.First(); 19392var tree = comp.SyntaxTrees.First(); 19423var tree = comp.SyntaxTrees.First(); 19477var tree = comp.SyntaxTrees.First(); 19535var tree = comp.SyntaxTrees.First(); 19658var tree = comp.SyntaxTrees.First(); 19702var tree = comp.SyntaxTrees.First(); 19733var tree = comp.SyntaxTrees.First(); 20355var tree = comp.SyntaxTrees.First(); 21348var tree = comp.SyntaxTrees.First(); 22613var startTree = SyntaxFactory.ParseSyntaxTree(text); 22618var newTree = startTree.WithChangedText(newText); 22853var tree = compilation.SyntaxTrees.First(); 24009var tree = SyntaxFactory.ParseSyntaxTree(text, CSharpParseOptions.Default); 24178var tree = compilation.SyntaxTrees.First(); 24257var tree = comp.SyntaxTrees.Single(); 24320var tree = comp.SyntaxTrees.Single(); 24384var tree = comp.SyntaxTrees.Single(); 24457var tree = comp.SyntaxTrees.Single(); 24530var tree = comp.SyntaxTrees.Single(); 24604var tree = comp.SyntaxTrees.Single(); 25022var tree = comp.SyntaxTrees.Single(); 25050var tree = comp.SyntaxTrees.Single(); 25081var tree = comp.SyntaxTrees.Single(); 25701var tree = comp.SyntaxTrees.Single(); 25772var tree = comp.SyntaxTrees.Single(); 25837var tree = comp.SyntaxTrees.Single(); 25879var tree = comp.SyntaxTrees.Single(); 25909var tree = comp.SyntaxTrees.Single(); 26220var tree = comp.SyntaxTrees[0]; 26293var tree = comp.SyntaxTrees.First(); 26326var tree = comp.SyntaxTrees.First(); 26359var tree = comp.SyntaxTrees.First(); 26392var tree = comp.SyntaxTrees.First(); 27565var tree = comp.SyntaxTrees.Single();
CodeGen\ForeachTest.cs (1)
1685var tree = comp.SyntaxTrees[0];
CodeGen\GotoTest.cs (2)
1146var tree = Parse(source, options: TestOptions.Script); 1159var tree = Parse(source, options: TestOptions.Script);
CodeGen\IndexAndRangeTests.cs (2)
30var syntaxTree = comp.SyntaxTrees[0]; 3856var tree = comp.SyntaxTrees.First();
CodeGen\ObjectAndCollectionInitializerTests.cs (2)
1105var tree = comp.SyntaxTrees.Single(); 3587var tree = comp.SyntaxTrees.First();
CodeGen\PatternTests.cs (3)
5001var tree = compilation.SyntaxTrees[0]; 5127var tree = compilation.SyntaxTrees[0]; 5276var tree = compilation.SyntaxTrees[0];
Emit\DeterministicTests.cs (1)
264var tree = CSharpSyntaxTree.ParseText("class Program { static void Main() { } }");
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (1)
3654var trees = ArrayBuilder<SyntaxTree>.GetInstance();
Emit\EmitMetadataTests.cs (2)
2230var syntax = SyntaxFactory.ParseSyntaxTree(@"class C {}", TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 2419var syntax = SyntaxFactory.ParseSyntaxTree(@"class C { static void Main() { } }", TestOptions.Regular.WithNoRefSafetyRulesAttribute());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (72)
CodeGen\IndexAndRangeTests.cs (18)
89var tree = comp.SyntaxTrees.Single(); 330var tree = comp.SyntaxTrees.Single(); 417var tree = comp.SyntaxTrees.Single(); 504var tree = comp.SyntaxTrees.Single(); 622var tree = comp.SyntaxTrees.Single(); 1571var tree = comp.SyntaxTrees.Single(); 1806var tree = comp.SyntaxTrees.Single(); 2261var tree = comp.SyntaxTrees.Single(); 2676var tree = comp.SyntaxTrees.First(); 2839var tree = comp.SyntaxTrees.First(); 3017var tree = comp.SyntaxTrees.Single(); 3131var tree = comp.SyntaxTrees.Single(); 3302var tree = comp.SyntaxTrees.First(); 3453var tree = comp.SyntaxTrees.First(); 3639var tree = comp.SyntaxTrees.First(); 3729var tree = comp.SyntaxTrees.First(); 3815var tree = comp.SyntaxTrees.First(); 3888var tree = comp.SyntaxTrees.First();
Emit\EditAndContinue\EditAndContinueTest.cs (1)
33protected override Compilation CreateCompilation(SyntaxTree tree)
Emit\EditAndContinue\EditAndContinueTestBase.cs (4)
86var tree1 = method1.Locations[0].SourceTree; 87var tree0 = method0.Locations[0].SourceTree; 270internal static CSharpCompilation WithSource(this CSharpCompilation compilation, SyntaxTree newTree) 275internal static CSharpCompilation WithSource(this CSharpCompilation compilation, SyntaxTree[] newTrees)
Emit\EditAndContinue\LocalSlotMappingTests.cs (2)
751var asyncStreamsTree = Parse(AsyncStreamsTypes, options: (CSharpParseOptions)source0.Tree.Options); 842var asyncStreamsTree = Parse(AsyncStreamsTypes, options: (CSharpParseOptions)source0.Tree.Options);
Emit\NumericIntPtrTests.cs (15)
697var tree = comp.SyntaxTrees[0]; 1915var tree = comp.SyntaxTrees[0]; 1967var tree = comp.SyntaxTrees[0]; 6007var tree = comp.SyntaxTrees[0]; 6243var tree = comp.SyntaxTrees[0]; 6616var tree = comp.SyntaxTrees[0]; 6850var tree = comp.SyntaxTrees[0]; 8124var tree = comp.SyntaxTrees[0]; 10545var tree = comp.SyntaxTrees[0]; 10684var tree = comp.SyntaxTrees[0]; 11171var tree = comp.SyntaxTrees.Single(); 11194var tree = comp.SyntaxTrees.Single(); 11222var tree = comp.SyntaxTrees.Single(); 11247var tree = comp.SyntaxTrees.Single(); 11292var tree = comp.SyntaxTrees.Single();
PDB\CheckSumTest.cs (2)
34var tree1 = SyntaxFactory.ParseSyntaxTree(StringText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), path: "sha1.cs"); 35var tree256 = SyntaxFactory.ParseSyntaxTree(StringText.From(source256, Encoding.UTF8, SourceHashAlgorithm.Sha256), path: "sha256.cs");
PDB\CSharpDeterministicBuildCompilationTests.cs (10)
55SyntaxTree[] syntaxTrees, 99var sourceOne = Parse(@" 111var sourceTwo = Parse(@" 116var sourceThree = Parse(@" 159var sourceOne = Parse(@" 171var sourceTwo = Parse(@" 176var sourceThree = Parse(@" 223var sourceOne = Parse(@" 235var sourceTwo = Parse(@" 240var sourceThree = Parse(@"
PDB\PDBEmbeddedSourceTests.cs (3)
42var tree1 = Parse(source1, "f:/build/goo.cs"); 43var tree2 = Parse(source2, "f:/build/nocode.cs"); 103var tree = Parse(source, "f:/build/goo.cs");
PDB\PDBTests.cs (17)
45var tree1 = SyntaxFactory.ParseSyntaxTree("class A { }", encoding: null, path: "Foo.cs"); 46var tree2 = SyntaxFactory.ParseSyntaxTree("class B { }", encoding: null, path: ""); 47var tree3 = SyntaxFactory.ParseSyntaxTree(SourceText.From("class C { }", encoding: null), path: "Bar.cs"); 48var tree4 = SyntaxFactory.ParseSyntaxTree("class D { }", encoding: Encoding.UTF8, path: "Baz.cs"); 65var tree1 = SyntaxFactory.ParseSyntaxTree("class A { public void F() { } }", encoding: Encoding.Unicode, path: "Foo.cs"); 66var tree2 = SyntaxFactory.ParseSyntaxTree("class B { public void F() { } }", encoding: null, path: ""); 67var tree3 = SyntaxFactory.ParseSyntaxTree("class C { public void F() { } }", encoding: new UTF8Encoding(true, false), path: "Bar.cs"); 68var tree4 = SyntaxFactory.ParseSyntaxTree(SourceText.From("class D { public void F() { } }", new UTF8Encoding(false, false)), path: "Baz.cs"); 132var tree1 = SyntaxFactory.ParseCompilationUnit(@" 136var tree2 = SyntaxFactory.ParseCompilationUnit(@" 608var tree1 = Parse(source1, @"foo.cs"); 609var tree2 = Parse(source2, @"foo.cs"); 4966var compilation = CreateCompilation(new SyntaxTree[] { Parse(text1, "a.cs"), Parse(text2, "b.cs") }); 12307var tree = SyntaxFactory.ParseSyntaxTree(source, encoding: Encoding.UTF8, path: "HIDDEN.cs"); 12909var tree1 = Parse(source1, "f:/build/goo.cs"); 12910var tree2 = Parse(source2, "f:/build/nocode.cs"); 12948var tree = Parse(source, "f:/build/nocode.cs");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1229)
Attributes\AttributeTests.cs (9)
705var tree = comp.SyntaxTrees[0]; 746var tree = comp.SyntaxTrees[0]; 810var tree = comp.SyntaxTrees[0]; 852var tree = comp.SyntaxTrees[0]; 893var tree = comp.SyntaxTrees[0]; 932var tree = comp.SyntaxTrees[0]; 7534var tree = compilation.SyntaxTrees.Single(); 7575var tree = compilation.SyntaxTrees.Single(); 11634var tree = comp.SyntaxTrees[0];
Attributes\AttributeTests_CallerInfoAttributes.cs (1)
5292var compilation = CreateCompilationWithMscorlib461(new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular7, path: @"C:\filename") }).VerifyDiagnostics(
Attributes\AttributeTests_Conditional.cs (2)
251var syntaxTree = SyntaxFactory.SyntaxTree(root); 462var syntaxTree = SyntaxFactory.SyntaxTree(root);
Attributes\AttributeTests_MarshalAs.cs (2)
31var compilation = CreateEmptyCompilation(new SyntaxTree[0], new[] { assembly.GetReference() }, 64new SyntaxTree[0],
Attributes\AttributeTests_RefReadOnly.cs (4)
1376var tree = compilation.SyntaxTrees.Single(); 1418var tree = compilation.SyntaxTrees.Single(); 1447var tree = compilation.SyntaxTrees.Single(); 1474var tree = compilation.SyntaxTrees.Single();
Attributes\AttributeTests_Security.cs (2)
1501var syntaxTree = Parse(source); 1619var syntaxTree = Parse(source);
Attributes\AttributeTests_Synthesized.cs (1)
1959var comp = CreateEmptyCompilation(new SyntaxTree[] { Parse("", options: parseOptions) }, references: new[] { diagLibRef, mslibNoStringRef });
Attributes\AttributeTests_WellKnownAttributes.cs (9)
5103var syntaxTree = Parse(source, filename: "test.cs"); 5142var syntaxTree = Parse(source, filename: "test.cs", options: parseOptions); 5765var tree = compilation.SyntaxTrees.Single(); 9547var tree = comp.SyntaxTrees.Single(); 9596var tree = comp.SyntaxTrees.Single(); 9652var tree = comp2.SyntaxTrees.Single(); 11396var tree = comp.SyntaxTrees[0]; 11421var tree = comp.SyntaxTrees[0]; 11452var tree = comp.SyntaxTrees[0];
Attributes\InternalsVisibleToAndStrongNameTests.cs (5)
138var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs", parseOptions); 167var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs", parseOptions); 227var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs", TestOptions.RegularWithLegacyStrongName); 295var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs"); 337var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs");
Diagnostics\DiagnosticAnalyzerTests.cs (63)
1012var treeInAnotherCompilation = anotherCompilation.SyntaxTrees.Single(); 1102var treeInAnotherCompilation = compilation.SyntaxTrees.Single(); 1474var builder = ImmutableArray.CreateBuilder<SyntaxTree>(); 1478var tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: "SourceFileRegular.cs"); 1570var tree = CSharpSyntaxTree.ParseText(source, path: "SourceFileRegular.cs"); 1612var tree1 = CSharpSyntaxTree.ParseText(source1, path: "SourceFileRegular.cs"); 1613var tree2 = CSharpSyntaxTree.ParseText(source2, path: "SourceFileRegular.Designer.cs"); 1905var tree1 = CSharpSyntaxTree.ParseText(source1, path: "Source1_File1.cs"); 1906var tree2 = CSharpSyntaxTree.ParseText(source1, path: "Source1_File2.cs"); 1907var tree3 = CSharpSyntaxTree.ParseText(source2, path: "Source2_File3.cs"); 1908var tree4 = CSharpSyntaxTree.ParseText(source3, path: "Source3_File4.generated.cs"); 1909var tree5 = CSharpSyntaxTree.ParseText(source3, path: "Source3_File5.designer.cs"); 1943var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 1964var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 1987var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2008var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2033var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2053var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2072var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2095var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2116var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2142var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2175var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2240var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs"); 2532var tree = CSharpSyntaxTree.ParseText(source); 2561var tree = CSharpSyntaxTree.ParseText(source); 2589var tree = CSharpSyntaxTree.ParseText(source); 2607var tree = CSharpSyntaxTree.ParseText(source); 2625var tree = CSharpSyntaxTree.ParseText(source); 2653var tree = CSharpSyntaxTree.ParseText(source); 2849var tree = CSharpSyntaxTree.ParseText(source); 3345var tree1 = compilation.SyntaxTrees[0]; 3369var tree1 = Parse("partial class A { }"); 3370var tree2 = Parse("partial class A { private class B { } }"); 3412var tree1 = Parse("partial class A { }"); 3413var tree2 = Parse("partial class A { private class B { } }"); 3465var tree1 = Parse("partial class A { }"); 3466var tree2 = Parse("partial class A { private class B { } }"); 3516var tree1 = Parse("partial class A { }"); 3517var tree2 = Parse("partial class A { private class B { } }"); 3591var tree = CSharpSyntaxTree.ParseText(source); 3621var tree = CSharpSyntaxTree.ParseText(source); 3642var tree = CSharpSyntaxTree.ParseText(source); 3681var tree1 = compilation.SyntaxTrees[0]; 3748var tree = compilation.SyntaxTrees[0]; 3810var tree = compilation.SyntaxTrees[0]; 3879var tree = CSharpSyntaxTree.ParseText(string.Empty); 3914var tree = CSharpSyntaxTree.ParseText(string.Empty); 4037var tree = CSharpSyntaxTree.ParseText(@"class C { }"); 4054private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _cache = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 4056public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options) 4061public void VerifyCachedModel(SyntaxTree tree, SemanticModel model) 4150var tree = compilation.SyntaxTrees[0]; 4183var tree1 = compilation.SyntaxTrees[0]; 4192var tree2 = compilation.SyntaxTrees[1]; 4193var tree3 = compilation.SyntaxTrees[2]; 4255var tree = compilation.SyntaxTrees[0]; 4265public override GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken cancellationToken) 4271public override bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken cancellationToken, out ReportDiagnostic severity) 4309var tree = compilation.SyntaxTrees[0]; 4393var tree = CSharpSyntaxTree.ParseText(@"class C { }"); 4418var tree = CSharpSyntaxTree.ParseText(source);
Diagnostics\DiagnosticSuppressorTests.cs (1)
716var tree = compilation.SyntaxTrees[0];
Diagnostics\GetDiagnosticsTests.cs (28)
166var tree1 = CSharpSyntaxTree.ParseText(source1, path: "file1"); 167var tree2 = CSharpSyntaxTree.ParseText(source2, path: "file2"); 215var tree1 = CSharpSyntaxTree.ParseText(source1, path: "file1"); 216var tree2 = CSharpSyntaxTree.ParseText(source2, path: "file2"); 267var tree1 = CSharpSyntaxTree.ParseText(source1, path: "file1"); 268var tree2 = CSharpSyntaxTree.ParseText(source2, path: "file2"); 319var tree = CSharpSyntaxTree.ParseText(source, path: "file1"); 429var syntaxTree1 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" })); 430var syntaxTree2 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "2" })); 431var syntaxTree3 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "3" })); 458var syntaxTree1 = Parse(string.Empty, options: parseOptions1); 459var syntaxTree2 = Parse(string.Empty, options: parseOptions2); 460var syntaxTree3 = Parse(string.Empty, options: parseOptions2); 482var tree1 = Parse(string.Empty, options: parseOptions); 483var tree2 = Parse("ref struct X {}", options: parseOptions); 670var tree = compilation.SyntaxTrees.First(); 723var tree = compilation.SyntaxTrees.First(); 741var tree = compilation.SyntaxTrees.First(); 778var syntaxTree = compilation.SyntaxTrees[0]; 835var syntaxTree = compilation.SyntaxTrees[0]; 1057var syntaxTree = compilation.SyntaxTrees[0]; 1121var tree1 = compilation.SyntaxTrees[0]; 1122var tree2 = compilation.SyntaxTrees[1]; 1514var tree1 = compilation.SyntaxTrees[0]; 1515var tree2 = compilation.SyntaxTrees[1]; 1527var analyzedTree = Assert.Single(analyzer.AnalyzedTrees); 1567var expectedSemanticModelTreeCallbacks = new HashSet<SyntaxTree>(); 1696var tree = compilation.SyntaxTrees[0];
FieldKeywordTests.cs (7)
1273var tree = comp.SyntaxTrees.Single(); 1331var tree = comp.SyntaxTrees.Single(); 9471static (object, string, string)[] getInitializerValues(CSharpCompilation comp, SyntaxTree tree) 10488var tree = comp.SyntaxTrees.Single(); 10492var modifiedTree = SyntaxFactory.ParseSyntaxTree(source.Replace("return null;", "return field;"), parseOptions); 10522var tree = comp.SyntaxTrees.Single(); 10526var modifiedTree = SyntaxFactory.ParseSyntaxTree(source.Replace("return null;", "return field;"), parseOptions);
FirstClassSpanTests.cs (3)
2821var tree = comp.SyntaxTrees.Single(); 2854var tree = comp.SyntaxTrees.Single(); 4999var tree = comp.SyntaxTrees.Single();
FlowAnalysis\FlowTestBase.cs (6)
120var tree = comp.SyntaxTrees[0]; 141var tree = comp.SyntaxTrees[0]; 173var tree = comp.SyntaxTrees[0]; 194var tree = comp.SyntaxTrees[0]; 215protected T GetFirstNode<T>(SyntaxTree tree, int offset) 221protected T GetLastNode<T>(SyntaxTree tree, int offset)
FlowAnalysis\FlowTests.cs (1)
5839var tree = compilation.SyntaxTrees[0];
FlowAnalysis\IterationJumpYieldStatementTests.cs (1)
900var tree = SyntaxFactory.ParseSyntaxTree(@"
FlowAnalysis\RegionAnalysisTests.cs (21)
4425var tree = compilation.SyntaxTrees.First(); 4523var tree = compilation.SyntaxTrees[0]; 5483var tree = SyntaxFactory.ParseSyntaxTree(source); 5532var tree = comp.SyntaxTrees.Single(); 5576var tree = comp.SyntaxTrees.Single(); 5619var tree = comp.SyntaxTrees.Single(); 6214var tree = comp.SyntaxTrees.Single(); 6312var tree = compilation.SyntaxTrees[0]; 6351var tree = compilation.SyntaxTrees[0]; 6378var tree = compilation.SyntaxTrees[0]; 6416var tree = compilation.SyntaxTrees[0]; 6444var tree = compilation.SyntaxTrees[0]; 6479var tree = compilation.SyntaxTrees[0]; 7905var tree = compilation.SyntaxTrees[0]; 8097var tree = compilation.SyntaxTrees[0]; 8125var tree = compilation.SyntaxTrees[0]; 14119var tree = comp.CommonSyntaxTrees[0]; 14142var tree = comp.CommonSyntaxTrees[0]; 14166var tree = comp.CommonSyntaxTrees[0]; 14204var tree = comp.CommonSyntaxTrees[0]; 14249var tree = comp.CommonSyntaxTrees[0];
OverloadResolutionPriorityTests.cs (8)
442var tree = comp.SyntaxTrees[0]; 698var tree = comp3.SyntaxTrees[0]; 758var tree = comp3.SyntaxTrees[0]; 806var tree = comp3.SyntaxTrees[0]; 977var tree = comp.SyntaxTrees[0]; 2311var tree = comp.SyntaxTrees[0]; 2409var tree = comp.SyntaxTrees[0]; 2581var tree = comp.SyntaxTrees[0];
RefReadonlyParameterTests.cs (3)
1523var tree = comp.SyntaxTrees[0]; 7100var tree = comp.SyntaxTrees.Single(); 7128var tree = comp.SyntaxTrees.Single();
RefStructInterfacesTests.cs (65)
6628var tree = comp.SyntaxTrees.Single(); 6765var tree = comp.SyntaxTrees.Single(); 6881var tree = comp.SyntaxTrees.Single(); 7013var tree = comp.SyntaxTrees.Single(); 7142var tree = comp.SyntaxTrees.Single(); 7472var tree = comp.SyntaxTrees.Single(); 7662var tree = comp.SyntaxTrees.Single(); 7881var tree = comp.SyntaxTrees.Single(); 8075var tree = comp.SyntaxTrees.Single(); 8268var tree = comp.SyntaxTrees.Single(); 8441var tree = comp.SyntaxTrees.Single(); 8547var tree = comp.SyntaxTrees.Single(); 8931var tree = comp.SyntaxTrees.Single(); 9135var tree = comp.SyntaxTrees.Single(); 9331var tree = comp.SyntaxTrees.Single(); 9499var tree = comp.SyntaxTrees.Single(); 9714var tree = comp.SyntaxTrees.Single(); 9935var tree = comp.SyntaxTrees.Single(); 10150var tree = comp.SyntaxTrees.Single(); 10347var tree = comp.SyntaxTrees.Single(); 10442var tree = comp.SyntaxTrees.Single(); 10542var tree = comp.SyntaxTrees.Single(); 10739var tree = comp.SyntaxTrees.Single(); 10979var tree = comp.SyntaxTrees.Single(); 11198var tree = comp.SyntaxTrees.Single(); 11422var tree = comp.SyntaxTrees.Single(); 11605var tree = comp.SyntaxTrees.Single(); 11700var tree = comp.SyntaxTrees.Single(); 12148var tree = comp1.SyntaxTrees.Single(); 12416var tree = comp1.SyntaxTrees.Single(); 12661var tree = comp1.SyntaxTrees.Single(); 12924var tree = comp1.SyntaxTrees.Single(); 13191var tree = comp1.SyntaxTrees.Single(); 13453var tree = comp1.SyntaxTrees.Single(); 14151var tree = comp.SyntaxTrees.Single(); 14492var tree = comp.SyntaxTrees.Single(); 14854var tree = comp.SyntaxTrees.Single(); 15205var tree = comp.SyntaxTrees.Single(); 15553var tree = comp.SyntaxTrees.Single(); 15732var tree = comp.SyntaxTrees.Single(); 15987var tree = comp.SyntaxTrees.Single(); 16758var tree = comp.SyntaxTrees.Single(); 16823var tree = comp.SyntaxTrees.Single(); 16888var tree = comp.SyntaxTrees.Single(); 16972var tree = comp.SyntaxTrees.Single(); 17060var tree = comp.SyntaxTrees.Single(); 17153var tree = comp.SyntaxTrees.Single(); 17250var tree = comp.SyntaxTrees.Single(); 17334var tree = comp.SyntaxTrees.Single(); 17655var tree = comp.SyntaxTrees.Single(); 17852var tree = comp.SyntaxTrees.Single(); 18075var tree = comp.SyntaxTrees.Single(); 18275var tree = comp.SyntaxTrees.Single(); 18476var tree = comp.SyntaxTrees.Single(); 18652var tree = comp.SyntaxTrees.Single(); 18760var tree = comp.SyntaxTrees.Single(); 19128var tree = comp.SyntaxTrees.Single(); 19299var tree = comp.SyntaxTrees.Single(); 19472var tree = comp.SyntaxTrees.Single(); 19624var tree = comp.SyntaxTrees.Single(); 19862var tree = comp.SyntaxTrees.Single(); 19966var tree = comp.SyntaxTrees.Single(); 21236var tree = comp2.SyntaxTrees.Single(); 21304var tree = comp.SyntaxTrees.Single(); 21706var tree = comp.SyntaxTrees.Single();
Semantics\CollectionExpressionTests.cs (58)
199var tree = comp.SyntaxTrees[0]; 234var tree = comp.SyntaxTrees[0]; 4769var tree = comp.SyntaxTrees.First(); 7533var tree = comp.SyntaxTrees[0]; 8256var tree = comp.SyntaxTrees[0]; 8327var tree = comp.SyntaxTrees[0]; 8411var tree = comp.SyntaxTrees[0]; 8496var tree = comp.SyntaxTrees[0]; 14232var tree = comp.SyntaxTrees.First(); 14308var tree = comp.SyntaxTrees.First(); 14381var tree = comp.SyntaxTrees.First(); 14443var tree = comp.SyntaxTrees.First(); 14567var tree = comp.SyntaxTrees.First(); 14650var tree = comp.SyntaxTrees.First(); 14739var tree = comp.SyntaxTrees.First(); 15078var tree = comp.SyntaxTrees[0]; 26012var tree = comp.SyntaxTrees[0]; 26138var tree = comp.SyntaxTrees[0]; 26252var tree = comp.SyntaxTrees[0]; 26310var tree = comp.SyntaxTrees[0]; 26381var tree = comp.SyntaxTrees[0]; 26463var tree = comp.SyntaxTrees[0]; 26529var tree = comp.SyntaxTrees[0]; 26590var tree = comp.SyntaxTrees[0]; 26660var tree = comp.SyntaxTrees[0]; 26835var tree = comp.SyntaxTrees[0]; 26900var tree = comp.SyntaxTrees[0]; 26956var tree = comp.SyntaxTrees[0]; 28618var tree = comp.SyntaxTrees.First(); 28662var tree = comp.SyntaxTrees.First(); 28708var tree = comp.SyntaxTrees.First(); 28752var tree = comp.SyntaxTrees.First(); 28795var tree = comp.SyntaxTrees.First(); 28838var tree = comp.SyntaxTrees.First(); 28877var tree = comp.SyntaxTrees.First(); 28910var tree = comp.SyntaxTrees.First(); 28944var tree = comp.SyntaxTrees.First(); 28997var tree = comp.SyntaxTrees.First(); 29063var tree = comp.SyntaxTrees.First(); 29124var tree = comp.SyntaxTrees.First(); 29200var tree = comp.SyntaxTrees.First(); 29243var tree = comp.SyntaxTrees.First(); 29290var tree = comp.SyntaxTrees.First(); 31479var tree = comp.SyntaxTrees.Single(); 31527var tree = comp.SyntaxTrees.Single(); 31585var tree = comp.SyntaxTrees.Single(); 31683var tree = comp.SyntaxTrees.Single(); 32297var tree = comp.SyntaxTrees.First(); 32333var tree = comp.SyntaxTrees.First(); 32365var tree = comp.SyntaxTrees.First(); 32393var tree = comp.SyntaxTrees.First(); 32435var tree = comp.SyntaxTrees.First(); 32480var tree = comp.SyntaxTrees.First(); 32544var tree = comp.SyntaxTrees.First(); 32640var tree = comp.SyntaxTrees.First(); 33035var tree = comp.SyntaxTrees.First(); 33463var tree = compilation.SyntaxTrees[0]; 33504var tree = compilation.SyntaxTrees[0];
Semantics\InlineArrayTests.cs (16)
2356var tree = comp.SyntaxTrees.First(); 2391var tree = comp.SyntaxTrees.First(); 2425var tree = comp.SyntaxTrees.First(); 2505var tree = comp.SyntaxTrees.First(); 6030var tree = comp.SyntaxTrees.First(); 6196var tree = comp.SyntaxTrees.First(); 8115var tree = comp.SyntaxTrees.First(); 8832var tree = comp.SyntaxTrees.First(); 9200var tree = comp.SyntaxTrees.First(); 10544var tree = comp.SyntaxTrees.First(); 11288var tree = comp.SyntaxTrees.First(); 15205var tree = comp.SyntaxTrees.First(); 16492var tree = comp.SyntaxTrees.First(); 18580var tree = comp.SyntaxTrees.First(); 18906var tree = comp.SyntaxTrees.First(); 19243var tree = comp.SyntaxTrees.First();
Semantics\OutVarTests.cs (465)
56var tree = compilation.SyntaxTrees.Single(); 100var tree = compilation.SyntaxTrees.Single(); 216var tree = compilation.SyntaxTrees.Single(); 269var tree = compilation.SyntaxTrees.Single(); 332var tree = compilation.SyntaxTrees.Single(); 819private static IdentifierNameSyntax GetReference(SyntaxTree tree, string name) 824private static IdentifierNameSyntax[] GetReferences(SyntaxTree tree, string name, int count) 831internal static IEnumerable<IdentifierNameSyntax> GetReferences(SyntaxTree tree, string name) 836private static IEnumerable<DeclarationExpressionSyntax> GetDeclarations(SyntaxTree tree, string name) 842private static DeclarationExpressionSyntax GetDeclaration(SyntaxTree tree, string name) 847internal static DeclarationExpressionSyntax GetOutVarDeclaration(SyntaxTree tree, string name) 852private static IEnumerable<DeclarationExpressionSyntax> GetOutVarDeclarations(SyntaxTree tree, string name) 858private static IEnumerable<DiscardDesignationSyntax> GetDiscardDesignations(SyntaxTree tree) 863private static IEnumerable<IdentifierNameSyntax> GetDiscardIdentifiers(SyntaxTree tree) 868private static IEnumerable<DeclarationExpressionSyntax> GetOutVarDeclarations(SyntaxTree tree) 907var tree = compilation.SyntaxTrees.Single(); 1404var tree = compilation.SyntaxTrees.Single(); 1462var tree = compilation.SyntaxTrees.Single(); 1496var tree = compilation.SyntaxTrees.Single(); 1531var tree = compilation.SyntaxTrees.Single(); 1565var tree = compilation.SyntaxTrees.Single(); 1599var tree = compilation.SyntaxTrees.Single(); 1639var tree = compilation.SyntaxTrees.Single(); 1677var tree = compilation.SyntaxTrees.Single(); 1714var tree = compilation.SyntaxTrees.Single(); 1750var tree = compilation.SyntaxTrees.Single(); 1883var tree = compilation.SyntaxTrees.Single(); 2004var tree = compilation.SyntaxTrees.Single(); 2114var tree = compilation.SyntaxTrees.Single(); 2225var tree = compilation.SyntaxTrees.Single(); 2335var tree = compilation.SyntaxTrees.Single(); 2470var tree = compilation.SyntaxTrees.Single(); 2637var tree = compilation.SyntaxTrees.Single(); 2854var tree = compilation.SyntaxTrees.Single(); 2949var tree = compilation.SyntaxTrees.Single(); 3201var tree = compilation.SyntaxTrees.Single(); 3303var tree = compilation.SyntaxTrees.Single(); 3375var tree = compilation.SyntaxTrees.Single(); 3427var tree = compilation.SyntaxTrees.Single(); 3461var tree = compilation.SyntaxTrees.Single(); 3502var tree = compilation.SyntaxTrees.Single(); 3643var tree = compilation.SyntaxTrees.Single(); 3864var tree = compilation.SyntaxTrees.Single(); 3961var tree = compilation.SyntaxTrees.Single(); 3997var tree = compilation.SyntaxTrees.Single(); 4052var tree = compilation.SyntaxTrees.Single(); 4096var tree = compilation.SyntaxTrees.Single(); 4147var tree = compilation.SyntaxTrees.Single(); 4207var tree = compilation.SyntaxTrees.Single(); 4273var tree = compilation.SyntaxTrees.Single(); 4496var tree = compilation.SyntaxTrees.Single(); 4675var tree = compilation.SyntaxTrees.Single(); 4916var tree = compilation.SyntaxTrees.Single(); 5018var tree = compilation.SyntaxTrees.Single(); 5065var tree = compilation.SyntaxTrees.Single(); 5103var tree = compilation.SyntaxTrees.Single(); 5180var tree = compilation.SyntaxTrees.Single(); 5283var tree = compilation.SyntaxTrees.Single(); 5410var tree = compilation.SyntaxTrees.Single(); 5512var tree = compilation.SyntaxTrees.Single(); 5576var tree = compilation.SyntaxTrees.Single(); 5708var tree = compilation.SyntaxTrees.Single(); 5748var tree = compilation.SyntaxTrees.Single(); 5909var tree = compilation.SyntaxTrees.Single(); 6050var tree = compilation.SyntaxTrees.Single(); 6327var tree = compilation.SyntaxTrees.Single(); 6562var tree = compilation.SyntaxTrees.Single(); 6818var tree = compilation.SyntaxTrees.Single(); 7064var tree = compilation.SyntaxTrees.Single(); 7302var tree = compilation.SyntaxTrees.Single(); 7624var tree = compilation.SyntaxTrees.Single(); 7773var tree = compilation.SyntaxTrees.Single(); 7833var tree = compilation.SyntaxTrees.Single(); 7895var tree = compilation.SyntaxTrees.Single(); 7961var tree = compilation.SyntaxTrees.Single(); 8025var tree = compilation.SyntaxTrees.Single(); 8092var tree = compilation.SyntaxTrees.Single(); 8154var tree = compilation.SyntaxTrees.Single(); 8209var tree = compilation.SyntaxTrees.Single(); 8387var tree = compilation.SyntaxTrees.Single(); 8487var tree = compilation.SyntaxTrees.Single(); 8659var tree = compilation.SyntaxTrees.Single(); 8761var tree = compilation.SyntaxTrees.Single(); 8797var tree = compilation.SyntaxTrees.Single(); 8869var tree = compilation.SyntaxTrees.Single(); 8919var tree = compilation.SyntaxTrees.Single(); 9161var tree = compilation.SyntaxTrees.Single(); 9263var tree = compilation.SyntaxTrees.Single(); 9334var tree = compilation.SyntaxTrees.Single(); 9427var tree = compilation.SyntaxTrees.Single(); 9507var tree = compilation.SyntaxTrees.Single(); 9583var tree = compilation.SyntaxTrees.Single(); 9636var tree = compilation.SyntaxTrees.Single(); 9693var tree = compilation.SyntaxTrees.Single(); 9758var tree = compilation.SyntaxTrees.Single(); 9815var tree = compilation.SyntaxTrees.Single(); 9890var tree = compilation.SyntaxTrees.Single(); 9985var tree = compilation.SyntaxTrees.Single(); 10067var tree = compilation.SyntaxTrees.Single(); 10148var tree = compilation.SyntaxTrees.Single(); 10204var tree = compilation.SyntaxTrees.Single(); 10260var tree = compilation.SyntaxTrees.Single(); 10327var tree = compilation.SyntaxTrees.Single(); 10386var tree = compilation.SyntaxTrees.Single(); 10458var tree = compilation.SyntaxTrees.Single(); 10542var tree = compilation.SyntaxTrees.Single(); 10720var tree = compilation.SyntaxTrees.Single(); 10817var tree = compilation.SyntaxTrees.Single(); 10853var tree = compilation.SyntaxTrees.Single(); 10908var tree = compilation.SyntaxTrees.Single(); 10958var tree = compilation.SyntaxTrees.Single(); 11046var tree = compilation.SyntaxTrees.Single(); 11183var tree = compilation.SyntaxTrees.Single(); 11265var tree = compilation.SyntaxTrees.Single(); 11334var tree = compilation.SyntaxTrees.Single(); 11427var tree = compilation.SyntaxTrees.Single(); 11467var tree = compilation.SyntaxTrees.Single(); 11715var tree = compilation.SyntaxTrees.Single(); 11972var tree = compilation.SyntaxTrees.Single(); 12124var tree = compilation.SyntaxTrees.Single(); 12274var tree = compilation.SyntaxTrees.Single(); 12351var tree = compilation.SyntaxTrees.Single(); 12420var tree = compilation.SyntaxTrees.Single(); 12496var tree = compilation.SyntaxTrees.Single(); 12658var tree = compilation.SyntaxTrees.Single(); 12778var tree = compilation.SyntaxTrees.Single(); 12865var tree = compilation.SyntaxTrees.Single(); 12920var tree = compilation.SyntaxTrees.Single(); 12962var tree = compilation.SyntaxTrees.Single(); 13017var tree = compilation.SyntaxTrees.Single(); 13201var tree = compilation.SyntaxTrees.Single(); 13295var tree = compilation.SyntaxTrees.Single(); 13333var tree = compilation.SyntaxTrees.Single(); 13385var tree = compilation.SyntaxTrees.Single(); 13439var tree = compilation.SyntaxTrees.Single(); 13605var tree = compilation.SyntaxTrees.Single(); 13696var tree = compilation.SyntaxTrees.Single(); 13732var tree = compilation.SyntaxTrees.Single(); 13796var tree = compilation.SyntaxTrees.Single(); 13846var tree = compilation.SyntaxTrees.Single(); 14127var tree = compilation.SyntaxTrees.Single(); 14256var tree = compilation.SyntaxTrees.Single(); 14303var tree = compilation.SyntaxTrees.Single(); 14352var tree = compilation.SyntaxTrees.Single(); 14394var tree = compilation.SyntaxTrees.Single(); 14436var tree = compilation.SyntaxTrees.Single(); 14481var tree = compilation.SyntaxTrees.Single(); 14523var tree = compilation.SyntaxTrees.Single(); 14568var tree = compilation.SyntaxTrees.Single(); 14617var tree = compilation.SyntaxTrees.Single(); 14671var tree = compilation.SyntaxTrees.Single(); 14730var tree = compilation.SyntaxTrees.Single(); 14777var tree = compilation.SyntaxTrees.Single(); 14827var tree = compilation.SyntaxTrees.Single(); 14942var tree = compilation.SyntaxTrees.Single(); 15122var tree = compilation.SyntaxTrees.Single(); 15215var tree = compilation.SyntaxTrees.Single(); 15253var tree = compilation.SyntaxTrees.Single(); 15311var tree = compilation.SyntaxTrees.Single(); 15369var tree = compilation.SyntaxTrees.Single(); 15530var tree = compilation.SyntaxTrees.Single(); 15743var tree = compilation.SyntaxTrees.Single(); 15956var tree = compilation.SyntaxTrees.Single(); 16071var tree = compilation.SyntaxTrees.Single(); 16158var tree = compilation.SyntaxTrees.Single(); 16399var tree = compilation.SyntaxTrees.Single(); 16495var tree = compilation.SyntaxTrees.Single(); 16531var tree = compilation.SyntaxTrees.Single(); 16588var tree = compilation.SyntaxTrees.Single(); 16642var tree = compilation.SyntaxTrees.Single(); 16702var tree = compilation.SyntaxTrees.Single(); 16762var tree = compilation.SyntaxTrees.Single(); 16825var tree = compilation.SyntaxTrees.Single(); 16959var tree = compilation.SyntaxTrees.Single(); 17051var tree = compilation.SyntaxTrees.Single(); 17090var tree = compilation.SyntaxTrees.Single(); 17148var tree = compilation.SyntaxTrees.Single(); 17202var tree = compilation.SyntaxTrees.Single(); 17386var tree = compilation.SyntaxTrees.Single(); 17488var tree = compilation.SyntaxTrees.Single(); 17526var tree = compilation.SyntaxTrees.Single(); 17589var tree = compilation.SyntaxTrees.Single(); 17642var tree = compilation.SyntaxTrees.Single(); 17677var tree = compilation.SyntaxTrees.Single(); 17710var tree = compilation.SyntaxTrees.Single(); 17743var tree = compilation.SyntaxTrees.Single(); 17782var tree = compilation.SyntaxTrees.Single(); 17829var tree = compilation.SyntaxTrees.Single(); 17859var tree = compilation.SyntaxTrees.Single(); 17890var tree = compilation.SyntaxTrees.Single(); 17919var tree = compilation.SyntaxTrees.Single(); 17951var tree = compilation.SyntaxTrees.Single(); 17993var tree = compilation.SyntaxTrees.Single(); 18030var tree = compilation.SyntaxTrees.Single(); 18067var tree = compilation.SyntaxTrees.Single(); 18102var tree = compilation.SyntaxTrees.Single(); 18141var tree = compilation.SyntaxTrees.Single(); 18182var tree = compilation.SyntaxTrees.Single(); 18225var tree = compilation.SyntaxTrees.Single(); 18268var tree = compilation.SyntaxTrees.Single(); 18307var tree = compilation.SyntaxTrees.Single(); 18348var tree = compilation.SyntaxTrees.Single(); 18383var tree = compilation.SyntaxTrees.Single(); 18429var tree = compilation.SyntaxTrees.Single(); 18493var tree = compilation.SyntaxTrees.Single(); 18542var tree = compilation.SyntaxTrees.Single(); 18587var tree = compilation.SyntaxTrees.Single(); 18639var tree = compilation.SyntaxTrees.Single(); 18683var tree = compilation.SyntaxTrees.Single(); 18725var tree = compilation.SyntaxTrees.Single(); 18779var tree = compilation.SyntaxTrees.Single(); 18812var tree = context.Node.SyntaxTree; 18872var tree = compilation.SyntaxTrees.Single(); 18916var tree = compilation.SyntaxTrees.Single(); 18958var tree = compilation.SyntaxTrees.Single(); 19011var tree = compilation.SyntaxTrees.Single(); 19056var tree = compilation.SyntaxTrees.Single(); 19099var tree = compilation.SyntaxTrees.Single(); 19153var tree = compilation.SyntaxTrees.Single(); 19202var tree = compilation.SyntaxTrees.Single(); 19249var tree = compilation.SyntaxTrees.Single(); 19287var tree = compilation.SyntaxTrees.Single(); 19328var tree = compilation.SyntaxTrees.Single(); 19362var tree = compilation.SyntaxTrees.Single(); 19423var tree = compilation.SyntaxTrees.Single(); 19468var tree = compilation.SyntaxTrees.Single(); 19506var tree = compilation.SyntaxTrees.Single(); 19545var tree = compilation.SyntaxTrees.Single(); 19589var tree = compilation.SyntaxTrees.Single(); 19658var tree = compilation.SyntaxTrees.Single(); 19686var tree = compilation.SyntaxTrees.Single(); 19729var tree = compilation.SyntaxTrees.Single(); 19767var tree = compilation.SyntaxTrees.Single(); 19840var tree = compilation.SyntaxTrees.Single(); 19873var tree = compilation.SyntaxTrees.Single(); 19906var tree = compilation.SyntaxTrees.Single(); 19941var tree = compilation.SyntaxTrees.Single(); 19976var tree = compilation.SyntaxTrees.Single(); 20014var tree = compilation.SyntaxTrees.Single(); 20046var tree = compilation.SyntaxTrees.Single(); 20220var tree = compilation.SyntaxTrees.Single(); 20248var tree = compilation.SyntaxTrees.Single(); 20356var tree = compilation.SyntaxTrees[0]; 20613var tree = compilation.SyntaxTrees.Single(); 20656var tree = compilation.SyntaxTrees.Single(); 20773var tree = compilation.SyntaxTrees.Single(); 20826var tree = compilation.SyntaxTrees.Single(); 20917var tree = compilation.SyntaxTrees.Single(); 21036var tree = compilation.SyntaxTrees.Single(); 21131var tree = compilation.SyntaxTrees.Single(); 21235var tree = compilation.SyntaxTrees.Single(); 21292var tree = compilation.SyntaxTrees.Single(); 21360var tree = compilation.SyntaxTrees.Single(); 21410var tree = compilation.SyntaxTrees.Single(); 21644var tree = compilation.SyntaxTrees.Single(); 21817var tree = compilation.SyntaxTrees.Single(); 22011var tree = compilation.SyntaxTrees.Single(); 22138var tree = compilation.SyntaxTrees.Single(); 22236var tree = compilation.SyntaxTrees.Single(); 22424var tree = compilation.SyntaxTrees.Single(); 22579var tree = compilation.SyntaxTrees.Single(); 22658var tree = compilation.SyntaxTrees.Single(); 22781var tree = compilation.SyntaxTrees.Single(); 22863var tree = compilation.SyntaxTrees.Single(); 22947var tree = compilation.SyntaxTrees.Single(); 23014var tree = compilation.SyntaxTrees.Single(); 23053var tree = compilation.SyntaxTrees.Single(); 23209var tree = compilation.SyntaxTrees.Single(); 23303var tree = compilation.SyntaxTrees.Single(); 23393var tree = compilation.SyntaxTrees.Single(); 23441var tree = compilation.SyntaxTrees.Single(); 23474var tree = compilation.SyntaxTrees.Single(); 23525var tree = compilation.SyntaxTrees.Single(); 23669var tree = compilation.SyntaxTrees.Single(); 23767var tree = compilation.SyntaxTrees.Single(); 23865var tree = compilation.SyntaxTrees.Single(); 24007var tree = compilation.SyntaxTrees.Single(); 24111var tree = compilation.SyntaxTrees.Single(); 24206var tree = compilation.SyntaxTrees.Single(); 24294var tree = compilation.SyntaxTrees.Single(); 24400var tree = compilation.SyntaxTrees.Single(); 24493var tree = compilation.SyntaxTrees.Single(); 24524var tree = compilation.SyntaxTrees.Single(); 24726var tree = compilation.SyntaxTrees.Single(); 24985var tree = compilation.SyntaxTrees.Single(); 25176var tree = compilation.SyntaxTrees.Single(); 25289var tree = compilation.SyntaxTrees.Single(); 25388var tree = compilation.SyntaxTrees.Single(); 25567var tree = compilation.SyntaxTrees.Single(); 25611var tree = compilation.SyntaxTrees.Single(); 25692var tree = compilation.SyntaxTrees.Single(); 25736var tree = compilation.SyntaxTrees.Single(); 25791var tree = compilation.SyntaxTrees.Single(); 25872var tree = compilation.SyntaxTrees.Single(); 25932var tree = compilation.SyntaxTrees.Single(); 26029var tree = compilation.SyntaxTrees.Single(); 26086var tree = compilation.SyntaxTrees.Single(); 26153var tree = compilation.SyntaxTrees.Single(); 26201var tree = compilation.SyntaxTrees.Single(); 26282var tree = compilation.SyntaxTrees.Single(); 26329var tree = compilation.SyntaxTrees.Single(); 26424var tree = compilation.SyntaxTrees.Single(); 26472var tree = compilation.SyntaxTrees.Single(); 26556var tree = compilation.SyntaxTrees.Single(); 26616var tree = compilation.SyntaxTrees.Single(); 26700var tree = compilation.SyntaxTrees.Single(); 26760var tree = compilation.SyntaxTrees.Single(); 26821var tree = compilation.SyntaxTrees.Single(); 26891var tree = compilation.SyntaxTrees.Single(); 26935var tree = compilation.SyntaxTrees.Single(); 27021var tree = compilation.SyntaxTrees.Single(); 27066var tree = compilation.SyntaxTrees.Single(); 27158var tree = compilation.SyntaxTrees.Single(); 27212var tree = compilation.SyntaxTrees.Single(); 27311var tree = compilation.SyntaxTrees.Single(); 27365var tree = compilation.SyntaxTrees.Single(); 27434var tree = compilation.SyntaxTrees.Single(); 27511var tree = compilation.SyntaxTrees.Single(); 27584var tree = compilation.SyntaxTrees.Single(); 27688var tree = compilation.SyntaxTrees.Single(); 27761var tree = compilation.SyntaxTrees.Single(); 27824var tree = compilation.SyntaxTrees.Single(); 27901var tree = compilation.SyntaxTrees.Single(); 27974var tree = compilation.SyntaxTrees.Single(); 28079var tree = compilation.SyntaxTrees.Single(); 28152var tree = compilation.SyntaxTrees.Single(); 28225var tree = compilation.SyntaxTrees.Single(); 28300var tree = compilation.SyntaxTrees.Single(); 28354var tree = compilation.SyntaxTrees.Single(); 28451var tree = compilation.SyntaxTrees.Single(); 28505var tree = compilation.SyntaxTrees.Single(); 28572var tree = compilation.SyntaxTrees.Single(); 28620var tree = compilation.SyntaxTrees.Single(); 28704var tree = compilation.SyntaxTrees.Single(); 28765var tree = compilation.SyntaxTrees.Single(); 28872var tree = compilation.SyntaxTrees.Single(); 28928var tree = compilation.SyntaxTrees.Single(); 29023var tree = compilation.SyntaxTrees.Single(); 29079var tree = compilation.SyntaxTrees.Single(); 29144var tree = compilation.SyntaxTrees.Single(); 29230var tree = compilation.SyntaxTrees.Single(); 29297var tree = compilation.SyntaxTrees.Single(); 29406var tree = compilation.SyntaxTrees.Single(); 29473var tree = compilation.SyntaxTrees.Single(); 29546var tree = compilation.SyntaxTrees.Single(); 29595var tree = compilation.SyntaxTrees.Single(); 29693var tree = compilation.SyntaxTrees.Single(); 29769var tree = compilation.SyntaxTrees.Single(); 29894var tree = compilation.SyntaxTrees.Single(); 29970var tree = compilation.SyntaxTrees.Single(); 30048var tree = compilation.SyntaxTrees.Single(); 30134var tree = compilation.SyntaxTrees.Single(); 30195var tree = compilation.SyntaxTrees.Single(); 30306var tree = compilation.SyntaxTrees.Single(); 30367var tree = compilation.SyntaxTrees.Single(); 30431var tree = compilation.SyntaxTrees.Single(); 30486var tree = compilation.SyntaxTrees.Single(); 30530var tree = compilation.SyntaxTrees.Single(); 30574var tree = compilation.SyntaxTrees.Single(); 30615var tree = compilation.SyntaxTrees.Single(); 30695var tree = compilation.SyntaxTrees.Single(); 30764var tree = compilation.SyntaxTrees.Single(); 30866var tree = compilation.SyntaxTrees.Single(); 30935var tree = compilation.SyntaxTrees.Single(); 30999var tree = compilation.SyntaxTrees.Single(); 31054var tree = compilation.SyntaxTrees.Single(); 31098var tree = compilation.SyntaxTrees.Single(); 31142var tree = compilation.SyntaxTrees.Single(); 31226var tree = compilation.SyntaxTrees.Single(); 31285var tree = compilation.SyntaxTrees.Single(); 31399var tree = compilation.SyntaxTrees.Single(); 31458var tree = compilation.SyntaxTrees.Single(); 31527var tree = compilation.SyntaxTrees.Single(); 31582var tree = compilation.SyntaxTrees.Single(); 31626var tree = compilation.SyntaxTrees.Single(); 31670var tree = compilation.SyntaxTrees.Single(); 31711var tree = compilation.SyntaxTrees.Single(); 31765var tree = compilation.SyntaxTrees.Single(); 31799var tree = compilation.SyntaxTrees.Single(); 31852var tree = compilation.SyntaxTrees.Single(); 31892var tree = compilation.SyntaxTrees.Single(); 31942var tree = compilation.SyntaxTrees.Single(); 31976var tree = compilation.SyntaxTrees.Single(); 32032var tree = compilation.SyntaxTrees.Single(); 32072var tree = compilation.SyntaxTrees.Single(); 32117var tree = compilation.SyntaxTrees.Single(); 32161var tree = compilation.SyntaxTrees.Single(); 32195var tree = compilation.SyntaxTrees.Single(); 32229var tree = compilation.SyntaxTrees.Single(); 32269var tree = compilation.SyntaxTrees.Single(); 32309var tree = compilation.SyntaxTrees.Single(); 32364var tree = compilation.SyntaxTrees.Single(); 32433var tree = compilation.SyntaxTrees.Single(); 32480var tree = compilation.SyntaxTrees.Single(); 32511var tree = node1.SyntaxTree; 32546var tree = compilation.SyntaxTrees.Single(); 32574var tree = compilation.SyntaxTrees.Single(); 32602var tree = compilation.SyntaxTrees.Single(); 32628var tree = compilation.SyntaxTrees.Single(); 32666var tree = compilation.SyntaxTrees.Single(); 32702var tree = compilation.SyntaxTrees.Single(); 32946var tree = compilation.SyntaxTrees.Single(); 32975var tree = comp.Compilation.SyntaxTrees.Single(); 33060var tree = comp.SyntaxTrees.Single(); 33129var tree = comp.SyntaxTrees.Single(); 33174var tree = comp.SyntaxTrees.Single(); 33238var tree = comp.SyntaxTrees.Single(); 33504var tree = comp.SyntaxTrees[0]; 33545var tree = comp.SyntaxTrees[0]; 33608var tree = compilation.SyntaxTrees[0]; 33691var tree = compilation.SyntaxTrees[0]; 33779var tree = compilation.SyntaxTrees.Single(); 33877var tree = compilation.SyntaxTrees.Single(); 33976var tree = compilation.SyntaxTrees.Single(); 34074var tree = compilation.SyntaxTrees.Single(); 34147var tree = compilation.SyntaxTrees.Single(); 34203var tree = compilation.SyntaxTrees.Single(); 34269var tree = compilation.SyntaxTrees.Single(); 34326var syntaxTree = Parse(source, filename: "file.cs"); 34396var tree = compilation.SyntaxTrees.Single(); 34487var tree = compilation.SyntaxTrees.Single(); 34540var syntaxTree = Parse(source, filename: "file.cs"); 34594var tree = compilation.SyntaxTrees.Single(); 34715var tree = compilation.SyntaxTrees.Single(); 34755var tree = compilation.SyntaxTrees[0]; 34831var tree = compilation.SyntaxTrees[0]; 34886var tree = compilation.SyntaxTrees[0]; 34940var tree = compilation.SyntaxTrees[0]; 34998var tree = compilation.SyntaxTrees[0]; 35048var tree = compilation.SyntaxTrees[0]; 35102var tree = compilation.SyntaxTrees[0]; 35142var tree = compilation.SyntaxTrees[0]; 35176var tree = compilation.SyntaxTrees.First(); 35215var tree = compilation.SyntaxTrees.First(); 35259var tree = compilation.SyntaxTrees.First(); 35290var tree = compilation.SyntaxTrees.First(); 35329var tree = compilation.SyntaxTrees.First(); 35361var tree = compilation.SyntaxTrees.First(); 35397var tree = compilation.SyntaxTrees.First(); 35436var tree = compilation.SyntaxTrees.First(); 35466var tree = compilation.SyntaxTrees.First(); 35503var tree = compilation.SyntaxTrees.First(); 35555var tree = compilation.SyntaxTrees.Single(); 35660var tree = comp.SyntaxTrees.Single(); 35695var tree = comp.SyntaxTrees.Single(); 35774var tree = compilation.SyntaxTrees.Single(); 35816var tree = compilation.SyntaxTrees.Single(); 35845var tree = compilation.SyntaxTrees.Single(); 35891var tree = compilation.SyntaxTrees.Single(); 35979var tree = compilation.SyntaxTrees.Single(); 36119var tree = compilation.SyntaxTrees.Single(); 36227var tree = compilation.SyntaxTrees.Single(); 36320var tree = compilation.SyntaxTrees.Single(); 36359var tree = comp.SyntaxTrees.Single(); 36362var tree2 = CSharpSyntaxTree.ParseText(source); 36405var tree = comp.SyntaxTrees.Single(); 36408var tree2 = CSharpSyntaxTree.ParseText(source); 36445var tree = comp.SyntaxTrees.Single(); 36448var tree2 = CSharpSyntaxTree.ParseText(source); 36487var tree = comp.SyntaxTrees.Single(); 36490var tree2 = CSharpSyntaxTree.ParseText(source); 36522var tree = comp.SyntaxTrees.Single(); 36525var tree2 = CSharpSyntaxTree.ParseText(source); 36560var tree = comp.SyntaxTrees.Single(); 36563var tree2 = CSharpSyntaxTree.ParseText(source);
Semantics\ParamsCollectionTests.cs (17)
118var tree = comp.SyntaxTrees.Single(); 217var tree = comp.SyntaxTrees.Single(); 333var tree = comp.SyntaxTrees.Single(); 516var tree = comp.SyntaxTrees.Single(); 661var tree = comp.SyntaxTrees.Single(); 1405var tree = comp.SyntaxTrees.Single(); 2529var tree = comp.SyntaxTrees.Single(); 2665var tree = comp.SyntaxTrees.Single(); 2754var tree = comp.SyntaxTrees.Single(); 2952var tree = comp.SyntaxTrees.Single(); 3595var tree = comp.SyntaxTrees.Single(); 3885var tree = comp.SyntaxTrees.Single(); 4337var tree = comp2.SyntaxTrees.Single(); 5891var tree = comp.SyntaxTrees.Single(); 5973var tree = comp.SyntaxTrees.Single(); 9070var tree = comp.SyntaxTrees.Single(); 12532var tree = comp.SyntaxTrees.Single();
Semantics\PatternMatchingTestBase.cs (10)
25protected IEnumerable<SingleVariableDesignationSyntax> GetPatternDeclarations(SyntaxTree tree, string v) 30protected SingleVariableDesignationSyntax GetPatternDeclaration(SyntaxTree tree, string v) 35protected IEnumerable<SingleVariableDesignationSyntax> GetPatternDeclarations(SyntaxTree tree) 40protected IEnumerable<VariableDeclaratorSyntax> GetVariableDeclarations(SyntaxTree tree, string v) 45protected IEnumerable<VariableDeclaratorSyntax> GetVariableDeclarations(SyntaxTree tree) 50protected static IEnumerable<DiscardDesignationSyntax> GetDiscardDesignations(SyntaxTree tree) 55protected static IdentifierNameSyntax GetReference(SyntaxTree tree, string name) 60protected static IEnumerable<IdentifierNameSyntax> GetReferences(SyntaxTree tree, string name) 426protected static void AssertNoGlobalStatements(SyntaxTree tree) 458var tree = comp.SyntaxTrees.First();
Semantics\PatternMatchingTests.cs (53)
692var tree = compilation.SyntaxTrees.Single(); 736var tree = compilation.SyntaxTrees.Single(); 776var tree = compilation.SyntaxTrees.Single(); 842var tree = compilation.SyntaxTrees.Single(); 889var tree = compilation.SyntaxTrees.Single(); 1151var tree = compilation.SyntaxTrees.Single(); 1220var tree = compilation.SyntaxTrees.Single(); 1270var tree = compilation.SyntaxTrees.Single(); 1314var tree = compilation.SyntaxTrees.Single(); 1429var tree = compilation.SyntaxTrees.Single(); 1479var tree = compilation.SyntaxTrees.Single(); 1536var tree = compilation.SyntaxTrees.Single(); 1588var tree = compilation.SyntaxTrees.Single(); 1653var tree = compilation.SyntaxTrees.Single(); 1730var tree = compilation.SyntaxTrees.Single(); 1783var tree = compilation.SyntaxTrees.Single(); 1827var tree = compilation.SyntaxTrees.Single(); 1881var tree = compilation.SyntaxTrees.Single(); 1935var tree = compilation.SyntaxTrees.Single(); 1992var tree = compilation.SyntaxTrees.Single(); 2030var tree = compilation.SyntaxTrees.Single(); 2076var tree = compilation.SyntaxTrees.Single(); 2130var tree = compilation.SyntaxTrees.Single(); 2178var tree = compilation.SyntaxTrees.Single(); 2234var tree = compilation.SyntaxTrees.Single(); 2294var tree = compilation.SyntaxTrees.Single(); 2352var tree = compilation.SyntaxTrees.Single(); 2413var tree = compilation.SyntaxTrees.Single(); 2458var tree = compilation.SyntaxTrees.Single(); 2497var tree = compilation.SyntaxTrees.Single(); 2541var tree = compilation.SyntaxTrees.Single(); 2613var tree = compilation.SyntaxTrees.Single(); 2661var tree = compilation.SyntaxTrees.Single(); 2699var tree = compilation.SyntaxTrees.Single(); 2744var tree = compilation.SyntaxTrees.Single(); 2788var tree = compilation.SyntaxTrees.Single(); 2840var tree = compilation.SyntaxTrees.Single(); 2882var tree = compilation.SyntaxTrees.Single(); 3037var tree = compilation.SyntaxTrees.Single(); 3084var tree = compilation.SyntaxTrees.Single(); 3263var tree = compilation.SyntaxTrees[0]; 3441var tree = compilation.SyntaxTrees[0]; 3477var tree = compilation.SyntaxTrees.Single(); 3576var tree = compilation.SyntaxTrees.Single(); 4247var tree = compilation.SyntaxTrees.Single(); 4288var tree = compilation.SyntaxTrees.Single(); 4789var tree = compilation.SyntaxTrees.Single(); 4827var tree = compilation.SyntaxTrees.Single(); 6572var tree = compilation.SyntaxTrees.Single(); 11363var tree = comp.SyntaxTrees.Single(); 11387var tree = comp.SyntaxTrees.Single(); 11408var tree = comp.SyntaxTrees.Single(); 11465var tree = comp.SyntaxTrees.Single();
Semantics\PatternMatchingTests_Global.cs (123)
76var tree = compilation.SyntaxTrees.Single(); 120var tree = compilation.SyntaxTrees.Single(); 198var tree = compilation.SyntaxTrees.Single(); 242var tree = compilation.SyntaxTrees.Single(); 292var tree = compilation.SyntaxTrees.Single(); 368var tree = compilation.SyntaxTrees.Single(); 428var tree = compilation.SyntaxTrees.Single(); 520var tree = compilation.SyntaxTrees.Single(); 577var tree = compilation.SyntaxTrees.Single(); 639var tree = compilation.SyntaxTrees.Single(); 681var tree = compilation.SyntaxTrees.Single(); 757var tree = compilation.SyntaxTrees.Single(); 804var tree = compilation.SyntaxTrees.Single(); 894var tree = compilation.SyntaxTrees.Single(); 942var tree = compilation.SyntaxTrees.Single(); 1021var tree = compilation.SyntaxTrees.Single(); 1074var tree = compilation.SyntaxTrees.Single(); 1153var tree = compilation.SyntaxTrees.Single(); 1206var tree = compilation.SyntaxTrees.Single(); 1262var tree = compilation.SyntaxTrees.Single(); 1327var tree = compilation.SyntaxTrees.Single(); 1371var tree = compilation.SyntaxTrees.Single(); 1452var tree = compilation.SyntaxTrees.Single(); 1497var tree = compilation.SyntaxTrees.Single(); 1584var tree = compilation.SyntaxTrees.Single(); 1638var tree = compilation.SyntaxTrees.Single(); 1732var tree = compilation.SyntaxTrees.Single(); 1786var tree = compilation.SyntaxTrees.Single(); 1850var tree = compilation.SyntaxTrees.Single(); 1924var tree = compilation.SyntaxTrees.Single(); 1994var tree = compilation.SyntaxTrees.Single(); 2095var tree = compilation.SyntaxTrees.Single(); 2165var tree = compilation.SyntaxTrees.Single(); 2224var tree = compilation.SyntaxTrees.Single(); 2298var tree = compilation.SyntaxTrees.Single(); 2368var tree = compilation.SyntaxTrees.Single(); 2470var tree = compilation.SyntaxTrees.Single(); 2540var tree = compilation.SyntaxTrees.Single(); 2609var tree = compilation.SyntaxTrees.Single(); 2679var tree = compilation.SyntaxTrees.Single(); 2733var tree = compilation.SyntaxTrees.Single(); 2825var tree = compilation.SyntaxTrees.Single(); 2879var tree = compilation.SyntaxTrees.Single(); 2941var tree = compilation.SyntaxTrees.Single(); 2987var tree = compilation.SyntaxTrees.Single(); 3068var tree = compilation.SyntaxTrees.Single(); 3127var tree = compilation.SyntaxTrees.Single(); 3227var tree = compilation.SyntaxTrees.Single(); 3283var tree = compilation.SyntaxTrees.Single(); 3373var tree = compilation.SyntaxTrees.Single(); 3429var tree = compilation.SyntaxTrees.Single(); 3489var tree = compilation.SyntaxTrees.Single(); 3570var tree = compilation.SyntaxTrees.Single(); 3637var tree = compilation.SyntaxTrees.Single(); 3741var tree = compilation.SyntaxTrees.Single(); 3808var tree = compilation.SyntaxTrees.Single(); 3872var tree = compilation.SyntaxTrees.Single(); 3966var tree = compilation.SyntaxTrees.Single(); 4042var tree = compilation.SyntaxTrees.Single(); 4164var tree = compilation.SyntaxTrees.Single(); 4240var tree = compilation.SyntaxTrees.Single(); 4311var tree = compilation.SyntaxTrees.Single(); 4392var tree = compilation.SyntaxTrees.Single(); 4453var tree = compilation.SyntaxTrees.Single(); 4559var tree = compilation.SyntaxTrees.Single(); 4620var tree = compilation.SyntaxTrees.Single(); 4675var tree = compilation.SyntaxTrees.Single(); 4721var tree = compilation.SyntaxTrees.Single(); 4760var tree = compilation.SyntaxTrees.Single(); 4799var tree = compilation.SyntaxTrees.Single(); 4831var tree = compilation.SyntaxTrees.Single(); 4906var tree = compilation.SyntaxTrees.Single(); 4975var tree = compilation.SyntaxTrees.Single(); 5072var tree = compilation.SyntaxTrees.Single(); 5141var tree = compilation.SyntaxTrees.Single(); 5196var tree = compilation.SyntaxTrees.Single(); 5242var tree = compilation.SyntaxTrees.Single(); 5281var tree = compilation.SyntaxTrees.Single(); 5320var tree = compilation.SyntaxTrees.Single(); 5399var tree = compilation.SyntaxTrees.Single(); 5475var tree = compilation.SyntaxTrees.Single(); 5584var tree = compilation.SyntaxTrees.Single(); 5660var tree = compilation.SyntaxTrees.Single(); 5725var tree = compilation.SyntaxTrees.Single(); 5776var tree = compilation.SyntaxTrees.Single(); 5815var tree = compilation.SyntaxTrees.Single(); 5854var tree = compilation.SyntaxTrees.Single(); 5891var tree = compilation.SyntaxTrees.Single(); 5937var tree = compilation.SyntaxTrees.Single(); 5975var tree = compilation.SyntaxTrees.Single(); 6025var tree = compilation.SyntaxTrees.Single(); 6062var tree = compilation.SyntaxTrees.Single(); 6109var tree = compilation.SyntaxTrees.Single(); 6141var tree = compilation.SyntaxTrees.Single(); 6195var tree = compilation.SyntaxTrees.Single(); 6233var tree = compilation.SyntaxTrees.Single(); 6268var tree = compilation.SyntaxTrees.Single(); 6297var tree = compilation.SyntaxTrees.Single(); 6319var tree = compilation.SyntaxTrees.Single(); 6348var tree = compilation.SyntaxTrees.Single(); 6372var tree = compilation.SyntaxTrees.Single(); 6395var tree = compilation.SyntaxTrees.Single(); 6512var tree = compilation.SyntaxTrees.Single(); 6600var tree = compilation.SyntaxTrees.Single(); 6684var tree = compilation.SyntaxTrees.Single(); 6727var tree = compilation.SyntaxTrees.Single(); 6760var tree = compilation.SyntaxTrees.Single(); 6802var tree = compilation.SyntaxTrees.Single(); 6940var tree = compilation.SyntaxTrees.Single(); 7038var tree = compilation.SyntaxTrees.Single(); 7130var tree = compilation.SyntaxTrees.Single(); 7257var tree = compilation.SyntaxTrees.Single(); 7361var tree = compilation.SyntaxTrees.Single(); 7450var tree = compilation.SyntaxTrees.Single(); 7526var tree = compilation.SyntaxTrees.Single(); 7620var tree = compilation.SyntaxTrees.Single(); 7707var tree = compilation.SyntaxTrees.Single(); 7732var tree = compilation.SyntaxTrees.Single(); 7928var tree = compilation.SyntaxTrees.Single(); 8187var tree = compilation.SyntaxTrees.Single(); 8372var tree = compilation.SyntaxTrees.Single(); 8479var tree = compilation.SyntaxTrees.Single(); 8578var tree = compilation.SyntaxTrees.Single();
Semantics\PatternMatchingTests_ListPatterns.cs (10)
3317var tree = compilation.SyntaxTrees.First(); 3617var tree = compilation.SyntaxTrees[0]; 3674var tree = compilation.SyntaxTrees[0]; 3718var tree = compilation.SyntaxTrees.First(); 4083var tree = compilation.SyntaxTrees.First(); 4170var tree = compilation.SyntaxTrees.First(); 4247var tree = compilation.SyntaxTrees.First(); 4361var tree = compilation.SyntaxTrees.First(); 4403var tree = compilation.SyntaxTrees.Single(); 4554var tree = compilation.SyntaxTrees.First();
Semantics\PatternMatchingTests_Scope.cs (121)
202var tree = compilation.SyntaxTrees.Single(); 283var tree = compilation.SyntaxTrees.Single(); 329var tree = compilation.SyntaxTrees.Single(); 370var tree = compilation.SyntaxTrees.Single(); 400var tree = compilation.SyntaxTrees.Single(); 587var tree = compilation.SyntaxTrees.Single(); 675var tree = compilation.SyntaxTrees.Single(); 705var tree = compilation.SyntaxTrees.Single(); 857var tree = compilation.SyntaxTrees.Single(); 944var tree = compilation.SyntaxTrees.Single(); 974var tree = compilation.SyntaxTrees.Single(); 1155var tree = compilation.SyntaxTrees.Single(); 1248var tree = compilation.SyntaxTrees.Single(); 1278var tree = compilation.SyntaxTrees.Single(); 1518var tree = compilation.SyntaxTrees.Single(); 1818var tree = compilation.SyntaxTrees.Single(); 2069var tree = compilation.SyntaxTrees.Single(); 2215var tree = compilation.SyntaxTrees.Single(); 2351var tree = compilation.SyntaxTrees.Single(); 2416var tree = compilation.SyntaxTrees.Single(); 2479var tree = compilation.SyntaxTrees.Single(); 2549var tree = compilation.SyntaxTrees.Single(); 2705var tree = compilation.SyntaxTrees.Single(); 2788var tree = compilation.SyntaxTrees.Single(); 2984var tree = compilation.SyntaxTrees.Single(); 3153var tree = compilation.SyntaxTrees.Single(); 3268var tree = compilation.SyntaxTrees.Single(); 3357var tree = compilation.SyntaxTrees.Single(); 3445var tree = compilation.SyntaxTrees.Single(); 3532var tree = compilation.SyntaxTrees.Single(); 3608var tree = compilation.SyntaxTrees.Single(); 3705var tree = compilation.SyntaxTrees.Single(); 3796var tree = compilation.SyntaxTrees.Single(); 3886var tree = compilation.SyntaxTrees.Single(); 3978var tree = compilation.SyntaxTrees.Single(); 4074var tree = compilation.SyntaxTrees.Single(); 4220var tree = compilation.SyntaxTrees.Single(); 4502var tree = compilation.SyntaxTrees.Single(); 4902var tree = compilation.SyntaxTrees.Single(); 5211var tree = compilation.SyntaxTrees.Single(); 5304var tree = compilation.SyntaxTrees.Single(); 5334var tree = compilation.SyntaxTrees.Single(); 5499var tree = compilation.SyntaxTrees.Single(); 5706var tree = compilation.SyntaxTrees.Single(); 5913var tree = compilation.SyntaxTrees.Single(); 6022var tree = compilation.SyntaxTrees.Single(); 6103var tree = compilation.SyntaxTrees.Single(); 6186var tree = compilation.SyntaxTrees.Single(); 6273var tree = compilation.SyntaxTrees.Single(); 6347var tree = compilation.SyntaxTrees.Single(); 6417var tree = compilation.SyntaxTrees.Single(); 6464var tree = compilation.SyntaxTrees.Single(); 6517var tree = compilation.SyntaxTrees.Single(); 6587var tree = compilation.SyntaxTrees.Single(); 6676var tree = compilation.SyntaxTrees.Single(); 6752var tree = compilation.SyntaxTrees.Single(); 6827var tree = compilation.SyntaxTrees.Single(); 6877var tree = compilation.SyntaxTrees.Single(); 6927var tree = compilation.SyntaxTrees.Single(); 7084var tree = compilation.SyntaxTrees.Single(); 7174var tree = compilation.SyntaxTrees.Single(); 7204var tree = compilation.SyntaxTrees.Single(); 7406var tree = compilation.SyntaxTrees.Single(); 7497var tree = compilation.SyntaxTrees.Single(); 7527var tree = compilation.SyntaxTrees.Single(); 7721var tree = compilation.SyntaxTrees.Single(); 7950var tree = compilation.SyntaxTrees.Single(); 8200var tree = compilation.SyntaxTrees.Single(); 8440var tree = compilation.SyntaxTrees.Single(); 8672var tree = compilation.SyntaxTrees.Single(); 8988var tree = compilation.SyntaxTrees.Single(); 9131var tree = compilation.SyntaxTrees.Single(); 9303var tree = compilation.SyntaxTrees.Single(); 9512var tree = compilation.SyntaxTrees.Single(); 9603var tree = compilation.SyntaxTrees.Single(); 9633var tree = compilation.SyntaxTrees.Single(); 9798var tree = compilation.SyntaxTrees.Single(); 9927var tree = compilation.SyntaxTrees.Single(); 10075var tree = compilation.SyntaxTrees.Single(); 10163var tree = compilation.SyntaxTrees.Single(); 10196var tree = compilation.SyntaxTrees.Single(); 10365var tree = compilation.SyntaxTrees.Single(); 10586var tree = compilation.SyntaxTrees.Single(); 10682var tree = compilation.SyntaxTrees.Single(); 10712var tree = compilation.SyntaxTrees.Single(); 10999var tree = compilation.SyntaxTrees.Single(); 11129var tree = compilation.SyntaxTrees.Single(); 11177var tree = compilation.SyntaxTrees.Single(); 11227var tree = compilation.SyntaxTrees.Single(); 11270var tree = compilation.SyntaxTrees.Single(); 11313var tree = compilation.SyntaxTrees.Single(); 11359var tree = compilation.SyntaxTrees.Single(); 11402var tree = compilation.SyntaxTrees.Single(); 11448var tree = compilation.SyntaxTrees.Single(); 11494var tree = compilation.SyntaxTrees.Single(); 11546var tree = compilation.SyntaxTrees.Single(); 11609var tree = compilation.SyntaxTrees.Single(); 11664var tree = compilation.SyntaxTrees.Single(); 11724var tree = compilation.SyntaxTrees.Single(); 11804var tree = compilation.SyntaxTrees.Single(); 11901var tree = compilation.SyntaxTrees.Single(); 11990var tree = compilation.SyntaxTrees.Single(); 12088var tree = compilation.SyntaxTrees.Single(); 12139var tree = compilation.SyntaxTrees.Single(); 12201var tree = compilation.SyntaxTrees.Single(); 12245var tree = compilation.SyntaxTrees.Single(); 12474var tree = compilation.SyntaxTrees.Single(); 12641var tree = compilation.SyntaxTrees.Single(); 12832var tree = compilation.SyntaxTrees.Single(); 12953var tree = compilation.SyntaxTrees.Single(); 13045var tree = compilation.SyntaxTrees.Single(); 13227var tree = compilation.SyntaxTrees.Single(); 13370var tree = compilation.SyntaxTrees.Single(); 13444var tree = compilation.SyntaxTrees.Single(); 13532var tree = compilation.SyntaxTrees.Single(); 13609var tree = compilation.SyntaxTrees.Single(); 13688var tree = compilation.SyntaxTrees.Single(); 13755var tree = compilation.SyntaxTrees.Single(); 13785var tree = compilation.SyntaxTrees.Single(); 13820var tree = comp.SyntaxTrees.First(); 14017var tree = compilation.SyntaxTrees.Single();
Semantics\PatternMatchingTests2.cs (8)
719var tree = compilation.SyntaxTrees[0]; 2018var tree = compilation.SyntaxTrees[0]; 2059var tree = compilation.SyntaxTrees[0]; 2157var tree = compilation.SyntaxTrees[0]; 2249var tree = compilation.SyntaxTrees[0]; 2293var tree = compilation.SyntaxTrees[0]; 2339var tree = compilation.SyntaxTrees[0]; 2869var tree = comp.SyntaxTrees[0];
Semantics\PatternMatchingTests3.cs (12)
46var tree = compilation.SyntaxTrees[0]; 106var tree = compilation.SyntaxTrees[0]; 157var tree = compilation.SyntaxTrees[0]; 202var tree = compilation.SyntaxTrees[0]; 253var tree = compilation.SyntaxTrees[0]; 296var tree = compilation.SyntaxTrees[0]; 343var tree = compilation.SyntaxTrees[0]; 1610var tree = compilation.SyntaxTrees.Single(); 1886var tree = compilation.SyntaxTrees.Single(); 1934var tree = compilation.SyntaxTrees.Single(); 4104var tree = compilation.SyntaxTrees[0]; 4331var tree = compilation.SyntaxTrees[0];
Semantics\PatternMatchingTests4.cs (13)
1008var tree = compilation.SyntaxTrees[0]; 4016var tree = comp.SyntaxTrees.Single(); 4085var tree = comp.SyntaxTrees.Single(); 4158var tree = comp.SyntaxTrees.First(); 4230var tree = comp.SyntaxTrees.First(); 4274var tree = comp.SyntaxTrees.First(); 4321var tree = comp.SyntaxTrees.First(); 4403var tree = comp.SyntaxTrees.First(); 4485var tree = comp.SyntaxTrees.First(); 4567var tree = comp.SyntaxTrees.First(); 4649var tree = comp.SyntaxTrees.First(); 4733var tree = comp.SyntaxTrees.First(); 4826var tree = comp.SyntaxTrees.First();
Semantics\PatternMatchingTests5.cs (9)
425var tree = comp.SyntaxTrees.Single(); 562var tree = comp.SyntaxTrees.Single(); 793var tree = comp.SyntaxTrees.Single(); 839var tree = comp.SyntaxTrees.Single(); 893var tree = comp.SyntaxTrees.Single(); 1103var tree = compilation.SyntaxTrees[0]; 1183var tree = compilation.SyntaxTrees[0]; 1234var tree = compilation.SyntaxTrees[0]; 1286var tree = compilation.SyntaxTrees[0];
Semantics\PatternSwitchTests.cs (5)
1513var tree = compilation.SyntaxTrees.Single(); 1896var tree = compilation.SyntaxTrees.Single(); 1931var tree = compilation.SyntaxTrees.Single(); 3250var tree = compilation.SyntaxTrees[0]; 3281var tree = compilation.SyntaxTrees[0];
Semantics\PrimaryConstructorTests.cs (35)
418var tree = comp.SyntaxTrees[0]; 959var tree = comp.SyntaxTrees[0]; 1001var tree = comp.SyntaxTrees[0]; 1069var tree = comp.SyntaxTrees.First(); 1291var tree = comp.SyntaxTrees.First(); 1362var tree = comp.SyntaxTrees.First(); 1408var tree = comp.SyntaxTrees.First(); 1464var tree = comp.SyntaxTrees.First(); 1523var tree = comp.SyntaxTrees.First(); 1612var tree = comp.SyntaxTrees.First(); 1811var tree = comp.SyntaxTrees.First(); 1851var tree = comp.SyntaxTrees.First(); 1894var tree = comp.SyntaxTrees.First(); 1964var tree = comp.SyntaxTrees.First(); 2111var tree = comp.SyntaxTrees.First(); 2293var tree = comp.SyntaxTrees.First(); 2422var tree = comp.SyntaxTrees.First(); 2470var tree = comp.SyntaxTrees.First(); 2638var tree = comp.SyntaxTrees.First(); 2676var tree = comp.SyntaxTrees.First(); 2713var tree = comp.SyntaxTrees.First(); 2749var tree = comp.SyntaxTrees.First(); 6089var tree = comp.SyntaxTrees.Single(); 6830var tree = comp.SyntaxTrees[0]; 6856var tree = comp.SyntaxTrees[0]; 7792var tree = comp.SyntaxTrees.Single(); 8754var tree = comp.SyntaxTrees[0]; 9160var tree = comp.SyntaxTrees[0]; 19783var tree = comp.SyntaxTrees[0]; 20608var tree = comp.SyntaxTrees.Single(); 20641var tree = comp.SyntaxTrees.Single(); 20685var tree = comp.SyntaxTrees.Single(); 20732var tree = comp.SyntaxTrees.Single(); 20782var tree = comp.SyntaxTrees.Single(); 21639var tree = comp.SyntaxTrees[1];
Semantics\RecordTests.cs (32)
280var tree = comp.SyntaxTrees.First(); 446var tree = comp.SyntaxTrees[0]; 478var tree = comp.SyntaxTrees[0]; 2487var tree = comp.SyntaxTrees[0]; 8087var tree = comp.SyntaxTrees.First(); 8600var tree = comp.SyntaxTrees[0]; 8715var tree = comp.SyntaxTrees[0]; 8860var tree = comp.SyntaxTrees[0]; 21186var tree = comp.SyntaxTrees.First(); 21410var tree = comp.SyntaxTrees.First(); 21481var tree = comp.SyntaxTrees.First(); 21527var tree = comp.SyntaxTrees.First(); 21583var tree = comp.SyntaxTrees.First(); 21642var tree = comp.SyntaxTrees.First(); 21731var tree = comp.SyntaxTrees.First(); 21930var tree = comp.SyntaxTrees.First(); 21967var tree = comp.SyntaxTrees.First(); 22007var tree = comp.SyntaxTrees.First(); 22042var tree = comp.SyntaxTrees.First(); 22121var tree = comp.SyntaxTrees.First(); 22268var tree = comp.SyntaxTrees.First(); 22450var tree = comp.SyntaxTrees.First(); 22959var tree = comp.SyntaxTrees.First(); 23413var tree = comp.SyntaxTrees.First(); 24685var tree = comp.SyntaxTrees.First(); 24720var tree = comp.SyntaxTrees.First(); 24754var tree = comp.SyntaxTrees.First(); 24789var tree = comp.SyntaxTrees.First(); 28230var tree = comp.SyntaxTrees.Single(); 28387var tree = comp.SyntaxTrees.Single(); 30414var tree = comp.SyntaxTrees[0]; 30438var tree = comp.SyntaxTrees[0];
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (4)
EndToEndTests.cs (4)
491var tree = comp.SyntaxTrees.Single(); 611var tree = comp.SyntaxTrees[0]; 698var tree = comp.SyntaxTrees.Single(); 879var tree = comp.SyntaxTrees[0];
Microsoft.CodeAnalysis.CSharp.Features (124)
BraceCompletion\AbstractCSharpBraceCompletionService.cs (1)
18protected static bool IsLegalExpressionLocation(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\AwaitCompletionProvider.cs (2)
127protected override SyntaxNode? GetExpressionToPlaceAwaitInFrontOf(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 143protected override SyntaxToken? GetDotTokenLeftOfPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\CompletionUtilities.cs (1)
46public static SyntaxToken? GetDotTokenLeftOfPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
106private static bool IsLambdaExpression(SemanticModel semanticModel, SyntaxTree tree, int position, SyntaxToken token, ITypeInferenceService typeInferrer, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
69protected override SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (3)
36SyntaxTree syntaxTree, 70if (!SyntaxTree.IsRightOfDot(Position, CancellationToken) || 77var targetToken = SyntaxTree
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (2)
105var tree = semanticModel.SyntaxTree; 169protected override HashSet<string> GetInitializedMembers(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
41protected override SyntaxNode? GetObjectCreationNewExpression(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\OverrideCompletionProvider.cs (2)
44protected override SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken) 186public override SyntaxToken FindStartingToken(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (3)
70protected override SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken) 88protected override bool IsPartialMethodCompletionContext(SyntaxTree tree, int position, CancellationToken cancellationToken, out DeclarationModifiers modifiers, out SyntaxToken token) 108private static bool VerifyModifiers(SyntaxTree tree, int position, CancellationToken cancellationToken, out DeclarationModifiers modifiers)
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
57protected override SyntaxNode? GetPartialTypeSyntaxNode(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
170private static (PropertyPatternClauseSyntax?, ExpressionSyntax?) TryGetPropertyPatternClause(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\Scripting\DirectiveCompletionProviderUtilities.cs (1)
12internal static bool TryGetStringLiteralToken(SyntaxTree tree, int position, SyntaxKind directiveKind, out SyntaxToken stringLiteral, CancellationToken cancellationToken)
Completion\CompletionProviders\Scripting\LoadDirectiveCompletionProvider.cs (1)
28protected override bool TryGetStringLiteralToken(SyntaxTree tree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken)
Completion\CompletionProviders\Scripting\ReferenceDirectiveCompletionProvider.cs (1)
27protected override bool TryGetStringLiteralToken(SyntaxTree tree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken)
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (4)
100private static bool IsStartOfSpeculativeTContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 111private static int WalkOutOfGenericType(SyntaxTree syntaxTree, int position, SemanticModel semanticModel, CancellationToken cancellationToken) 140private static int WalkOutOfRefType(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 153private static int WalkOutOfTupleType(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (1)
42var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\BoolKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ByteKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\CharKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
35var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DecimalKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DoubleKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
37var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
38var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (1)
52var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\FloatKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\FromKeywordRecommender.cs (1)
19var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\GlobalKeywordRecommender.cs (1)
21var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
22var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\IntKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\LoadKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\LongKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
22var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ObjectKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\OutKeywordRecommender.cs (1)
19var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ReferenceKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\RefKeywordRecommender.cs (2)
82var syntaxTree = context.SyntaxTree; 142private static bool IsValidNewByRefContext(SyntaxTree syntaxTree, int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
Completion\KeywordRecommenders\SByteKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ScopedKeywordRecommender.cs (1)
15var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ShortKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\StringKeywordRecommender.cs (1)
25var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UIntKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ULongKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UndefKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (1)
70var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UShortKeywordRecommender.cs (1)
30var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
39var syntaxTree = context.SyntaxTree;
Completion\Providers\ContextVariableArgumentProvider.cs (1)
28protected override bool IsInstanceContext(SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken)
Debugging\BreakpointResolver.cs (1)
36var tree = location.SourceTree;
Debugging\CSharpBreakpointResolutionService.cs (1)
35var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Debugging\CSharpProximityExpressionsService.cs (3)
94var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 103public static IList<string> GetProximityExpressions(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 107private static IList<string> Do(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
19internal class Worker(SyntaxTree syntaxTree, int position) 21private readonly SyntaxTree _syntaxTree = syntaxTree;
Debugging\LocationInfoGetter.cs (1)
24var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (3)
44protected override MemberDeclarationSyntax? GetContainingMember(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 229SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 241SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
EditAndContinue\BreakpointSpans.cs (1)
18public static bool TryGetBreakpointSpan(SyntaxTree tree, int position, CancellationToken cancellationToken, out TextSpan breakpointSpan)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
594internal override bool ExperimentalFeaturesEnabled(SyntaxTree tree)
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (1)
20public sealed override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (1)
30public override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\InstanceConstructorDeclarationBody.cs (1)
31public sealed override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (1)
61public sealed override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
26public override SyntaxTree SyntaxTree
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
118var testFileTree = SyntaxFactory.ParseSyntaxTree(testFileSourceText, semanticModel.SyntaxTree.Options, cancellationToken: cancellationToken);
FullyQualify\CSharpFullyQualifyService.cs (1)
51var syntaxTree = simpleName.SyntaxTree;
GenerateType\CSharpGenerateTypeService.cs (1)
182var syntaxTree = semanticModel.SyntaxTree;
LineSeparators\CSharpLineSeparatorService.cs (1)
327private static bool IsLegalSpanForLineSeparator(SyntaxTree syntaxTree, TextSpan textSpan, CancellationToken cancellationToken)
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
103var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
NavigationBar\CSharpNavigationBarItemService.cs (3)
57Solution solution, SyntaxTree tree, IEnumerable<INamedTypeSymbol> types, CancellationToken cancellationToken) 192Solution solution, ISymbol member, SyntaxTree tree, CancellationToken cancellationToken) 207Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
SemanticSearch\CSharpSemanticSearchService.cs (2)
27out SyntaxTree queryTree, 32var globalUsingsTree = syntaxTreeFactory.ParseSyntaxTree(
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
35var syntaxTree = namespaceDeclaration.SyntaxTree;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
66var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
130var tree = context.SemanticModel.SyntaxTree; 175var tree = syntaxContext.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
51IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
60var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (3)
187public static SyntaxTreeState Create(bool defaultCompleted, NullableContextOptions compilationOptions, SyntaxTree tree, CancellationToken cancellationToken) 267private readonly ConcurrentDictionary<SyntaxTree, SyntaxTreeState> _codeBlockIntervals = []; 324private SyntaxTreeState GetOrCreateSyntaxTreeState(SyntaxTree tree, bool defaultCompleted, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
29protected override bool SupportsDiscard(SyntaxTree tree)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (3)
38var syntaxTree = semanticModel.SyntaxTree; 141var syntaxTree = semanticModel.SyntaxTree; 205SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, NotificationOption2 notification, ExpressionSyntax expression, bool changesSemantics)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
29var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
42var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
44var syntaxTree = semanticModel.SyntaxTree; 86var syntaxTree = semanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
41var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
40var syntaxTree = context.SemanticModel.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
41var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (1)
44var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
59var syntaxTree = expression.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
57var syntaxTree = node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
83SyntaxTree? currentSyntaxTree = null; 102var fieldSyntaxTree = fieldSyntaxReference.SyntaxTree;
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (3)
111var syntaxTree = document.SyntaxTree; 197var syntaxTree = document.SyntaxTree; 214SyntaxTree tree, SyntaxNode root, string indentation, TextLine textLine, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
43protected override async Task<Tuple<SyntaxTree, SyntaxNode>?> GetRootInOtherSyntaxTreeAsync(
src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
42var syntaxTree = semanticDocument.SyntaxTree;
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
535var syntaxTree = group.Key;
Structure\Providers\DisabledTextTriviaStructureProvider.cs (2)
26SyntaxTree syntaxTree, SyntaxTrivia trivia, 68private static int GetEndPositionExludingLastNewLine(SyntaxTree syntaxTree, SyntaxTrivia trivia, CancellationToken cancellationToken)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (2)
67var syntaxTree = semanticModel.SyntaxTree; 242var updatedSyntaxTree = semanticModel.SyntaxTree.WithRootAndOptions(
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (10)
EditAndContinue\BreakpointSpansTests.cs (2)
39var tree = SyntaxFactory.ParseSyntaxTree(source, options); 75var tree = SyntaxFactory.ParseSyntaxTree(source);
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
50var tree = SyntaxFactory.ParseSyntaxTree(source); 747var newSyntaxTree = await newDocument.GetSyntaxTreeAsync().ConfigureAwait(false);
EditAndContinue\Helpers\EditingTestBase.cs (4)
129private static SyntaxTree ParseSource(string markedSource, int documentIndex = 0) 140var tree1 = ParseSource(src1, documentIndex); 141var tree2 = ParseSource(src2, documentIndex); 202var tree = ParseSource(source);
EditAndContinue\SyntaxUtilitiesTests.cs (2)
164var tree = SyntaxFactory.ParseSyntaxTree(@" 225var tree = SyntaxFactory.ParseSyntaxTree(@"
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (87)
IOperation\IOperationTests.cs (12)
241var tree = CSharpSyntaxTree.ParseText(@" 319var tree = CSharpSyntaxTree.ParseText(@" 412var tree = compilation.SyntaxTrees.Single(); 460var tree = compilation.SyntaxTrees.Single(); 490var tree = compilation.SyntaxTrees[0]; 508var tree = compilation.SyntaxTrees.Single(); 524var tree = compilation.SyntaxTrees[0]; 554var tree = comp.SyntaxTrees.Single(); 586var tree = compilation.SyntaxTrees[0]; 614var tree = compilation.SyntaxTrees[0]; 661var syntaxTree = compilation.SyntaxTrees[0]; 710var tree = comp.SyntaxTrees[0];
IOperation\IOperationTests_IAnonymousFunctionExpression.cs (4)
406var syntaxTree = compilation.SyntaxTrees[0]; 486var syntaxTree = compilation.SyntaxTrees[0]; 845var tree = compilation.SyntaxTrees.Single(); 900var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_ICoalesceAssignmentOperation.cs (1)
252var tree = comp.SyntaxTrees[0];
IOperation\IOperationTests_ICoalesceOperation.cs (11)
35var tree = compilation.SyntaxTrees.Single(); 146var tree = compilation.SyntaxTrees.Single(); 261var tree = compilation.SyntaxTrees.Single(); 376var tree = compilation.SyntaxTrees.Single(); 492var tree = compilation.SyntaxTrees.Single(); 605var tree = compilation.SyntaxTrees.Single(); 720var tree = compilation.SyntaxTrees.Single(); 836var tree = compilation.SyntaxTrees.Single(); 950var tree = compilation.SyntaxTrees.Single(); 1052var tree = compilation.SyntaxTrees.Single(); 1167var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (2)
43var syntaxTree = Parse(source); 79var syntaxTree = Parse(source);
IOperation\IOperationTests_IConstructorBodyOperation.cs (19)
37var tree = compilation.SyntaxTrees.Single(); 66var tree = compilation.SyntaxTrees.Single(); 122var tree = compilation.SyntaxTrees.Single(); 188var tree = compilation.SyntaxTrees.Single(); 256var tree = compilation.SyntaxTrees.Single(); 322var tree = compilation.SyntaxTrees.Single(); 397var tree = compilation.SyntaxTrees.Single(); 484var tree = compilation.SyntaxTrees.Single(); 513var tree = compilation.SyntaxTrees.Single(); 588var tree = compilation.SyntaxTrees.Single(); 650var tree = compilation.SyntaxTrees.Single(); 720var tree = compilation.SyntaxTrees.Single(); 795var tree = compilation.SyntaxTrees.Single(); 864var tree = compilation.SyntaxTrees.Single(); 954var tree = compilation.SyntaxTrees.Single(); 1069var tree = compilation.SyntaxTrees.Single(); 1089var tree = compilation.SyntaxTrees.Single(); 1122var tree = compilation.SyntaxTrees.Single(); 1160var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_IConversionExpression.cs (1)
5289var tree = compilation.SyntaxTrees[0];
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
704var syntaxTree = comp.SyntaxTrees[0];
IOperation\IOperationTests_IFixedStatement.cs (1)
691var tree = comp.SyntaxTrees[0];
IOperation\IOperationTests_ILocalFunctionStatement.cs (2)
1791var tree = compilation.SyntaxTrees.Single(); 1846var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_IMethodBodyOperation.cs (27)
32var tree = compilation.SyntaxTrees.Single(); 55var tree = compilation.SyntaxTrees.Single(); 108var tree = compilation.SyntaxTrees.Single(); 170var tree = compilation.SyntaxTrees.Single(); 242var tree = compilation.SyntaxTrees.Single(); 284var tree = compilation.SyntaxTrees.Single(); 332var tree = compilation.SyntaxTrees.Single(); 399var tree = compilation.SyntaxTrees.Single(); 443var tree = compilation.SyntaxTrees.Single(); 505var tree = compilation.SyntaxTrees.Single(); 559var tree = compilation.SyntaxTrees.Single(); 580var tree = compilation.SyntaxTrees.Single(); 612var tree = compilation.SyntaxTrees.Single(); 656var tree = compilation.SyntaxTrees.Single(); 701var tree = compilation.SyntaxTrees.Single(); 722var tree = compilation.SyntaxTrees.Single(); 754var tree = compilation.SyntaxTrees.Single(); 798var tree = compilation.SyntaxTrees.Single(); 843var tree = compilation.SyntaxTrees.Single(); 864var tree = compilation.SyntaxTrees.Single(); 896var tree = compilation.SyntaxTrees.Single(); 937var tree = compilation.SyntaxTrees.Single(); 975var tree = compilation.SyntaxTrees.Single(); 999var tree = compilation.SyntaxTrees.Single(); 1034var tree = compilation.SyntaxTrees.Single(); 1079var tree = compilation.SyntaxTrees.Single(); 1121var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_ISymbolInitializer.cs (1)
32var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_IVariableDeclaration.cs (5)
922var tree = Parse(source, options: TestOptions.Regular); 1214var syntaxTree = Parse(source, filename: "file.cs"); 2300var syntaxTree = Parse(source, filename: "file.cs"); 2361var syntaxTree = Parse(source, filename: "file.cs"); 2829var syntaxTree = Parse(source, filename: "file.cs");
Microsoft.CodeAnalysis.CSharp.Scripting (3)
CSharpScriptCompiler.cs (3)
28public override bool IsCompleteSubmission(SyntaxTree tree) => SyntaxFactory.IsCompleteSubmission(tree); 30public override SyntaxTree ParseSubmission(SourceText text, ParseOptions parseOptions, CancellationToken cancellationToken) 47var tree = SyntaxFactory.ParseSyntaxTree(script.SourceText, script.Options.ParseOptions ?? DefaultParseOptions, script.Options.FilePath);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionTests.cs (1)
1179var tree = compilation.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1234)
Semantics\AccessCheckTests.cs (2)
741var tree = c.SyntaxTrees.First(); 895var tree = c1.SyntaxTrees.First();
Semantics\AccessibilityTests.cs (1)
25var t = Parse(@"
Semantics\AnonymousFunctionTests.cs (2)
978var syntaxTree = compilation.SyntaxTrees.Single(); 1012var syntaxTree = compilation.SyntaxTrees.Single();
Semantics\ArglistTests.cs (1)
956var tree = Parse(text);
Semantics\AwaitExpressionTests.cs (4)
81var tree = csCompilation.SyntaxTrees.Single(); 154var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 155var comp = CreateCompilationWithMscorlib461(new SyntaxTree[] { tree }, new MetadataReference[] { SystemRef }); 292var tree = comp.SyntaxTrees[0];
Semantics\BindingAsyncTests.cs (4)
53var tree = SyntaxFactory.ParseSyntaxTree(source); 54var compilation = CreateCompilationWithMscorlib461(new SyntaxTree[] { tree }).VerifyDiagnostics(); 82var tree = SyntaxFactory.ParseSyntaxTree(source); 83var compilation = CreateCompilationWithMscorlib461(new SyntaxTree[] { tree }).VerifyDiagnostics();
Semantics\BindingAwaitTests.cs (2)
26var tree = SyntaxFactory.ParseSyntaxTree(" class C { void M() { await X() on "); 32var newTree = tree.WithChangedText(newText);
Semantics\BindingTests.cs (18)
2363var tree = comp.SyntaxTrees[0]; 2382var tree = comp.SyntaxTrees[0]; 2719var tree = compilation.SyntaxTrees.Single(); 2775var tree = compilation.SyntaxTrees.Single(); 2830var tree = compilation.SyntaxTrees.Single(); 2886var tree = compilation.SyntaxTrees[0]; 2923var tree = comp.SyntaxTrees[0]; 2965var tree = comp.SyntaxTrees[0]; 3034var tree = comp.SyntaxTrees[0]; 3114var tree = comp.SyntaxTrees[0]; 3187var tree = comp.SyntaxTrees[0]; 3272var tree = comp.SyntaxTrees[0]; 3377var tree = comp.SyntaxTrees[0]; 3729var tree = comp.SyntaxTrees[0]; 3910var tree = comp.SyntaxTrees[0]; 3936var tree = compilation.SyntaxTrees.Single(); 3983var tree = comp.SyntaxTrees[0]; 4024var tree = comp.SyntaxTrees[0];
Semantics\ColorColorTests.cs (15)
588var tree = Parse(text); 627var tree = Parse(text); 724var tree = Parse(text); 1057var tree = Parse(text); 1103var tree = Parse(text); 1149var tree = Parse(text); 1194var tree = Parse(text); 1235var tree = Parse(text); 1272var tree = Parse(text); 1812var syntaxTree = comp.SyntaxTrees[0]; 1837var tree = Parse(text); 1880var tree = compilation.SyntaxTrees[0]; 1937var tree = compilation.SyntaxTrees[0]; 1994var tree = compilation.SyntaxTrees[0]; 2044var tree = compilation.SyntaxTrees[0];
Semantics\ConditionalOperatorTests.cs (4)
1283var tree = Parse(source, options: parseOptions); 1345var tree = compilation.SyntaxTrees.Single(); 1399var tree = compilation.SyntaxTrees.Single(); 1446var tree = compilation.SyntaxTrees.Single();
Semantics\ConstantTests.cs (6)
2907var tree = SyntaxFactory.ParseSyntaxTree(@" 2934var tree = SyntaxFactory.ParseSyntaxTree(@" 2962var tree = SyntaxFactory.ParseSyntaxTree(@" 3519var tree = comp.SyntaxTrees[0]; 4079var tree = comp.SyntaxTrees.Single(); 4100var tree = comp.SyntaxTrees.Single();
Semantics\DeconstructionTests.cs (27)
1837var tree = comp.Compilation.SyntaxTrees.First(); 3763var tree = compilation.SyntaxTrees.First(); 3941var tree = comp.SyntaxTrees.First(); 4167var tree = comp.SyntaxTrees.First(); 4235var tree = comp.SyntaxTrees.First(); 4370var tree = comp.SyntaxTrees.First(); 4504var tree = comp.SyntaxTrees.First(); 4662var tree = comp.SyntaxTrees.First(); 4720var tree = comp1.SyntaxTrees.Single(); 4756var tree = comp.SyntaxTrees.First(); 4834var tree = comp.SyntaxTrees.First(); 4939var tree = comp.SyntaxTrees.First(); 4985var tree = comp.SyntaxTrees.First(); 5043var tree = comp.SyntaxTrees.First(); 5129var tree = comp1.SyntaxTrees.First(); 5184var tree = comp.SyntaxTrees.First(); 5328var tree = comp.SyntaxTrees.First(); 5475var tree = comp.SyntaxTrees.First(); 5652var tree = comp.SyntaxTrees.First(); 5762var tree = comp.SyntaxTrees.First(); 5875var tree = comp.SyntaxTrees.First(); 5984var tree = comp.SyntaxTrees[0]; 6027var tree = comp.SyntaxTrees[0]; 6067var tree = comp.SyntaxTrees[0]; 6109var tree = comp.SyntaxTrees[0]; 6149var tree = comp.SyntaxTrees[0]; 6552var tree = comp.SyntaxTrees[0];
Semantics\DelegateTypeTests.cs (58)
747var tree = comp.SyntaxTrees[0]; 793var tree = comp.SyntaxTrees[0]; 893var tree = comp.SyntaxTrees[0]; 936var tree = comp.SyntaxTrees[0]; 994var tree = comp.SyntaxTrees[0]; 1034var tree = comp.SyntaxTrees[0]; 1209var tree = comp.SyntaxTrees[0]; 1245var tree = comp.SyntaxTrees[0]; 1330var tree = comp.SyntaxTrees[0]; 1370var tree = comp.SyntaxTrees[0]; 1413var tree = comp.SyntaxTrees[0]; 1457var tree = comp.SyntaxTrees[0]; 1552var tree = comp.SyntaxTrees[0]; 1632var tree = comp.SyntaxTrees[0]; 1682var tree = comp.SyntaxTrees[0]; 1732var tree = comp.SyntaxTrees[0]; 1782var tree = comp.SyntaxTrees[0]; 1832var tree = comp.SyntaxTrees[0]; 1882var tree = comp.SyntaxTrees[0]; 1932var tree = comp.SyntaxTrees[0]; 1978var tree = comp.SyntaxTrees[0]; 2026var tree = comp.SyntaxTrees[0]; 2080var tree = comp.SyntaxTrees[0]; 2145var tree = comp.SyntaxTrees[0]; 2207var tree = comp.SyntaxTrees[0]; 2266var tree = comp.SyntaxTrees[0]; 2315var tree = comp.SyntaxTrees[0]; 2354var tree = comp.SyntaxTrees[0]; 2397var tree = comp.SyntaxTrees[0]; 2449var tree = comp.SyntaxTrees[0]; 2490var tree = comp.SyntaxTrees[0]; 2538var tree = comp.SyntaxTrees[0]; 2590var tree = comp.SyntaxTrees[0]; 2636var tree = comp.SyntaxTrees[0]; 2684var tree = comp.SyntaxTrees[0]; 2731var tree = comp.SyntaxTrees[0]; 2777var tree = comp.SyntaxTrees[0]; 2828var tree = comp.SyntaxTrees[0]; 2856var tree = comp.SyntaxTrees[0]; 2887var tree = comp.SyntaxTrees[0]; 2915var tree = comp.SyntaxTrees[0]; 2946var tree = comp.SyntaxTrees[0]; 2979var tree = comp.SyntaxTrees[0]; 3010var tree = comp.SyntaxTrees[0]; 3041var tree = comp.SyntaxTrees[0]; 3076var tree = comp.SyntaxTrees[0]; 3559var tree = comp.SyntaxTrees[0]; 3601var tree = comp.SyntaxTrees[0]; 8026var tree = comp.SyntaxTrees[0]; 8049var tree = comp.SyntaxTrees[0]; 10384var tree = comp.SyntaxTrees[0]; 11082var tree = comp.SyntaxTrees[0]; 11168var tree = comp.SyntaxTrees[0]; 12107var syntaxTree = comp.SyntaxTrees[0]; 14730var tree = comp.SyntaxTrees[0]; 14776var tree = comp.SyntaxTrees[0]; 19789var tree = comp.SyntaxTrees.Single(); 19831var tree = comp.SyntaxTrees.Single();
Semantics\DynamicTests.cs (85)
3857var tree = verifier.Compilation.SyntaxTrees.Single(); 3890var tree = verifier.Compilation.SyntaxTrees.Single(); 3918var tree = verifier.Compilation.SyntaxTrees.Single(); 3946var tree = verifier.Compilation.SyntaxTrees.Single(); 3997var tree = verifier.Compilation.SyntaxTrees.Single(); 4975var tree = comp1.SyntaxTrees.Single(); 5099var tree = comp1.SyntaxTrees.Single(); 5222var tree = comp1.SyntaxTrees.Single(); 5340var tree = comp1.SyntaxTrees.Single(); 5381var tree = comp1.SyntaxTrees.Single(); 5425var tree = comp1.SyntaxTrees.Single(); 5469var tree = comp1.SyntaxTrees.Single(); 5513var tree = comp1.SyntaxTrees.Single(); 5577var tree = comp.SyntaxTrees.Single(); 5615var tree = comp.SyntaxTrees.Single(); 5654var tree = comp.SyntaxTrees.Single(); 5690var tree = comp.SyntaxTrees.Single(); 5731var tree = comp1.SyntaxTrees.Single(); 5776var tree = comp1.SyntaxTrees.Single(); 5821var tree = comp1.SyntaxTrees.Single(); 5866var tree = comp1.SyntaxTrees.Single(); 5934var tree = comp.SyntaxTrees.Single(); 5973var tree = comp.SyntaxTrees.Single(); 6021var tree = comp.SyntaxTrees.Single(); 6144var tree = comp.SyntaxTrees.Single(); 6264var tree = comp.SyntaxTrees.Single(); 6376var tree = comp1.SyntaxTrees.Single(); 6418var tree = comp1.SyntaxTrees.Single(); 6465var tree = comp1.SyntaxTrees.Single(); 6509var tree = comp1.SyntaxTrees.Single(); 6551var tree = comp.SyntaxTrees.Single(); 6605var tree = comp.SyntaxTrees.Single(); 6670var tree = comp.SyntaxTrees.Single(); 6779var tree = comp.SyntaxTrees.Single(); 6889var tree = comp.SyntaxTrees.Single(); 6990var tree = comp.SyntaxTrees.Single(); 7058var tree = comp.SyntaxTrees.Single(); 7161var tree = comp.SyntaxTrees.Single(); 7274var tree = comp.SyntaxTrees.Single(); 7390var tree = comp.SyntaxTrees.Single(); 7503var tree = comp.SyntaxTrees.Single(); 7580var tree = comp.SyntaxTrees.Single(); 7685var tree = comp.SyntaxTrees.Single(); 7791var tree = comp.SyntaxTrees.Single(); 7894var tree = comp.SyntaxTrees.Single(); 7966var tree = comp.SyntaxTrees.Single(); 8072var tree = comp.SyntaxTrees.Single(); 8177var tree = comp.SyntaxTrees.Single(); 8282var tree = comp.SyntaxTrees.Single(); 8391var tree = comp.SyntaxTrees.Single(); 8500var tree = comp.SyntaxTrees.Single(); 8610var tree = comp.SyntaxTrees.Single(); 8723var tree = comp.SyntaxTrees.Single(); 8792var tree = comp.SyntaxTrees.Single(); 8860var tree = comp.SyntaxTrees.Single(); 8923var tree = comp.SyntaxTrees.Single(); 9013var tree = comp.SyntaxTrees.Single(); 9104var tree = comp.SyntaxTrees.Single(); 9194var tree = comp.SyntaxTrees.Single(); 9250var tree = comp.SyntaxTrees.Single(); 9311var tree = comp.SyntaxTrees.Single(); 9432var tree = comp.SyntaxTrees.Single(); 9552var tree = comp.SyntaxTrees.Single(); 9666var tree = comp.SyntaxTrees.Single(); 9777var tree = comp.SyntaxTrees.Single(); 9888var tree = comp.SyntaxTrees.Single(); 10008var tree = comp.SyntaxTrees.Single(); 10136var tree = comp.SyntaxTrees.Single(); 10264var tree = comp.SyntaxTrees.Single(); 10418var tree = comp.SyntaxTrees.Single(); 10552var tree = comp.SyntaxTrees.Single(); 10700var tree = comp.SyntaxTrees.Single(); 10970var tree = comp.SyntaxTrees.Single(); 11099var tree = comp.SyntaxTrees.Single(); 11183var tree = comp.SyntaxTrees.Single(); 11261var tree = comp.SyntaxTrees.Single(); 11316var tree = comp1.SyntaxTrees.Single(); 11369var tree = comp1.SyntaxTrees.Single(); 11416var tree = comp1.SyntaxTrees.Single(); 11449var tree = comp1.SyntaxTrees.Single(); 11493var tree = comp.SyntaxTrees.Single(); 11534var tree = comp1.SyntaxTrees.Single(); 11583var tree = comp.SyntaxTrees.Single(); 11635var tree = comp.SyntaxTrees.Single(); 11679var tree = comp1.SyntaxTrees.Single();
Semantics\ExpressionBodiedMemberTests.cs (18)
38var tree = comp.SyntaxTrees[0]; 113var tree = Parse(@" 423var tree = comp.SyntaxTrees[0]; 472var tree = comp.SyntaxTrees[0]; 503var tree = comp.SyntaxTrees[0]; 532var tree = comp.SyntaxTrees[0]; 572var tree = comp.SyntaxTrees[0]; 615var tree = comp.SyntaxTrees[0]; 646var tree = comp.SyntaxTrees[0]; 677var tree = comp.SyntaxTrees[0]; 708var tree = comp.SyntaxTrees[0]; 739var tree = comp.SyntaxTrees[0]; 774var tree = comp.SyntaxTrees[0]; 805var tree = comp.SyntaxTrees[0]; 836var tree = comp.SyntaxTrees[0]; 871var tree = comp.SyntaxTrees[0]; 910var tree = comp.SyntaxTrees[0]; 1018var tree = comp.SyntaxTrees[0];
Semantics\FieldInitializerBindingTests.cs (2)
246var syntaxTree = compilation.SyntaxTrees.First(); 256private static void CheckBoundInitializers(IEnumerable<ExpectedInitializer> expectedInitializers, SyntaxTree syntaxTree, ImmutableArray<BoundInitializer> boundInitializers, bool isStatic)
Semantics\ForEachTests.cs (7)
2126var tree = comp.SyntaxTrees.Single(); 2178var tree = comp.SyntaxTrees.Single(); 2882var tree = comp.SyntaxTrees.Single(); 3253var tree = Parse(text, options: options); 3324var tree = comp.SyntaxTrees.Single(); 3358var tree = comp.SyntaxTrees.Single(); 3420var tree = compilation.SyntaxTrees.Single();
Semantics\FunctionPointerTests.cs (45)
198var tree = comp.SyntaxTrees[0]; 290var tree = comp.SyntaxTrees[0]; 348var tree = comp.SyntaxTrees[0]; 399var tree = comp.SyntaxTrees[0]; 451var tree = comp.SyntaxTrees[0]; 499var tree = comp.SyntaxTrees[0]; 597var tree = comp.SyntaxTrees[0]; 836var tree = comp.SyntaxTrees[0]; 879var tree = comp.SyntaxTrees[0]; 939var tree = comp.SyntaxTrees[0]; 975var tree = comp.SyntaxTrees[0]; 1043var tree = comp.SyntaxTrees[0]; 1123var tree = comp.SyntaxTrees[0]; 1268var tree = comp.SyntaxTrees[0]; 1363var tree = comp.SyntaxTrees[0]; 1504var tree = comp.SyntaxTrees[0]; 1561var tree = comp.SyntaxTrees[0]; 1612var tree = comp.SyntaxTrees[0]; 1660var tree = comp.SyntaxTrees[0]; 1693var tree = comp.SyntaxTrees[0]; 1726var tree = comp.SyntaxTrees[0]; 1772var tree = comp.SyntaxTrees[0]; 1820var tree = comp.SyntaxTrees[0]; 1853var tree = comp.SyntaxTrees[0]; 1886var tree = comp.SyntaxTrees[0]; 1933var tree = comp.SyntaxTrees[0]; 2052var tree = comp.SyntaxTrees[0]; 2085var tree = comp.SyntaxTrees[0]; 2222var tree = comp.SyntaxTrees[0]; 2279var tree = comp.SyntaxTrees[0]; 2352var tree = comp.SyntaxTrees[0]; 2426var tree = comp.SyntaxTrees[0]; 2494var tree = comp.SyntaxTrees[0]; 2591var tree = comp.SyntaxTrees[0]; 2664var tree = comp.SyntaxTrees[0]; 3175var tree = comp.SyntaxTrees[0]; 3294var tree = comp.SyntaxTrees[0]; 3373var syntaxTree = comp.SyntaxTrees[0]; 3430var syntaxTree = comp.SyntaxTrees[0]; 3472var syntaxTree = comp.SyntaxTrees[0]; 3525var syntaxTree = comp.SyntaxTrees[0]; 3579var syntaxTree = comp.SyntaxTrees[0]; 3674var syntaxTree = comp.SyntaxTrees[0]; 3802var syntaxTree = comp.SyntaxTrees[0]; 3947var syntaxTree = comp.SyntaxTrees[0];
Semantics\FuzzTests.cs (1)
51var tree = compilation.SyntaxTrees[0];
Semantics\GenericConstraintsTests.cs (5)
2875var tree = compilation.SyntaxTrees.Single(); 3137var tree = compilation.SyntaxTrees.Single(); 3167var tree = compilation.SyntaxTrees.Single(); 3193var tree = compilation.SyntaxTrees.Single(); 3222var tree = compilation.SyntaxTrees.Single();
Semantics\GlobalUsingDirectiveTests.cs (3)
3840var tree = comp.SyntaxTrees[0]; 4242var tree = comp.SyntaxTrees[0]; 4977var tree = comp.SyntaxTrees[0];
Semantics\ImplicitlyTypeArraysTests.cs (2)
63var tree = Parse(text); 89var tree = Parse(text);
Semantics\ImplicitObjectCreationTests.cs (23)
54var tree = comp.SyntaxTrees.First(); 129var tree = comp.SyntaxTrees.First(); 176var tree = comp.SyntaxTrees.First(); 226var tree = comp.SyntaxTrees.First(); 840var tree = comp.SyntaxTrees.First(); 881var tree = comp.SyntaxTrees.First(); 1704var tree = comp.SyntaxTrees.First(); 1864var tree = comp.SyntaxTrees.First(); 1894var tree = comp.SyntaxTrees.First(); 1924var tree = comp.SyntaxTrees.First(); 1976var tree = comp.SyntaxTrees.First(); 2034var tree = comp.SyntaxTrees.First(); 2069var tree = comp.SyntaxTrees.First(); 2123var tree = comp.SyntaxTrees.First(); 2215var tree = comp.SyntaxTrees.First(); 2512var tree = comp.SyntaxTrees.First(); 2563var tree = comp.SyntaxTrees.First(); 2920var tree = comp.SyntaxTrees.First(); 3213var tree = comp.SyntaxTrees.First(); 4155var tree = comp.SyntaxTrees.First(); 4182var tree = comp.SyntaxTrees.First(); 4528var tree = compilation.SyntaxTrees.Single(); 4571var tree = compilation.SyntaxTrees.Single();
Semantics\ImportsTests.cs (1)
112var tree = comp.SyntaxTrees.Single();
Semantics\IndexAndRangeTests.cs (9)
895var tree = compilation.SyntaxTrees.Single(); 915var tree = compilation.SyntaxTrees.Single(); 936var tree = compilation.SyntaxTrees.Single(); 1119var tree = compilation.SyntaxTrees.Single(); 1248var tree = compilation.SyntaxTrees.Single(); 1281var tree = compilation.SyntaxTrees.Single(); 1314var tree = compilation.SyntaxTrees.Single(); 1338var tree = compilation.SyntaxTrees.Single(); 1381var tree = compilation.SyntaxTrees.Single();
Semantics\InitOnlyMemberTests.cs (4)
2517var tree = comp.SyntaxTrees[0]; 3136var tree = compilation.SyntaxTrees[0]; 3189var tree = comp.SyntaxTrees[0]; 4140var tree = comp.SyntaxTrees[0];
Semantics\InteractiveSemanticModelTests.cs (3)
39var tree = compilation.SyntaxTrees[0]; 273private List<ExpressionSyntax> GetExprSyntaxList(SyntaxTree syntaxTree) 358var tree = compilation.SyntaxTrees[0];
Semantics\InteractiveUsingTests.cs (4)
85var tree = sub.SyntaxTrees.Single(); 115var tree = sub4.SyntaxTrees.Single(); 582var tree = comp.SyntaxTrees.Single(); 592var tree = comp.SyntaxTrees.Single();
Semantics\InterceptorsTests.cs (64)
38private static readonly SyntaxTree s_attributesTree = CSharpTestSource.Parse(s_attributesSource.text, s_attributesSource.path, RegularWithInterceptors); 43var tree = comp.SyntaxTrees.Single(); 166var source = CSharpTestSource.Parse(""" 182var interceptors = CSharpTestSource.Parse($$""" 194var attributesTree = CSharpTestSource.Parse(s_attributesSource.text, s_attributesSource.path, options: options); 1358var source = CSharpTestSource.Parse(""" 1970var source = CSharpTestSource.Parse(""" 1987var interceptors = CSharpTestSource.Parse($$""" 2074var source = CSharpTestSource.Parse(""" 2103var interceptors = CSharpTestSource.Parse($$""" 2265var source = CSharpTestSource.Parse(""" 2290var interceptors = CSharpTestSource.Parse($$""" 3522var sourceTree = CSharpTestSource.Parse(""" 3553var interceptorTree = CSharpTestSource.Parse($$""" 3576var sourceTree = CSharpTestSource.Parse(""" 3603var interceptorTree = CSharpTestSource.Parse($$""" 6138var source = CSharpTestSource.Parse(""" 6155var interceptors = CSharpTestSource.Parse($$""" 7284var source = CSharpTestSource.Parse(""" 7301var interceptors = CSharpTestSource.Parse($$""" 7333var tree = CSharpTestSource.Parse(""" 7385var interceptors = CSharpTestSource.Parse($$""" 7417var interceptors = CSharpTestSource.Parse($$""" 7441var interceptors = CSharpTestSource.Parse($$""" 7463var interceptors = CSharpTestSource.Parse($$""" 7486var source = CSharpTestSource.Parse(""" 7503var interceptors = CSharpTestSource.Parse($$""" 7537var sourceTree1 = CSharpTestSource.Parse(source, path: "Program1.cs", options: RegularWithInterceptors); 7544var interceptors = CSharpTestSource.Parse($$""" 7571var source = CSharpTestSource.Parse(""" 7590var interceptors = CSharpTestSource.Parse($$""" 7612var source = CSharpTestSource.Parse(""" 7646var interceptors = CSharpTestSource.Parse($$""" 7669var tree = CSharpTestSource.Parse(""" 7694var source = CSharpTestSource.Parse(""" 7712var interceptors = CSharpTestSource.Parse($$""" 7736var source = CSharpTestSource.Parse(""" 7758var interceptors = CSharpTestSource.Parse($$""" 7781var source = CSharpTestSource.Parse(""" 7799var interceptors = CSharpTestSource.Parse($$""" 7822var source = CSharpTestSource.Parse(""" 7840var interceptors = CSharpTestSource.Parse($$""" 7863var source = CSharpTestSource.Parse(""" 7884var interceptors = CSharpTestSource.Parse($$""" 7906var source = CSharpTestSource.Parse($$""" 7927var interceptors = CSharpTestSource.Parse($$""" 7956var source = CSharpTestSource.Parse($$""" 7980var interceptors = CSharpTestSource.Parse($$""" 8007var source = CSharpTestSource.Parse(""" 8026var interceptors = CSharpTestSource.Parse($$""" 8061var source = CSharpTestSource.Parse(""" 8085var interceptors = CSharpTestSource.Parse($$""" 8120var source = CSharpTestSource.Parse(""" 8145var interceptors = CSharpTestSource.Parse($$""" 8176var source = CSharpTestSource.Parse(""" 8200var interceptors = CSharpTestSource.Parse($$""" 8231var source = CSharpTestSource.Parse(""" 8255var interceptors = CSharpTestSource.Parse($$""" 8286var source = CSharpTestSource.Parse(""" 8305var interceptors = CSharpTestSource.Parse($$""" 8336var source = CSharpTestSource.Parse(""" 8363var interceptors = CSharpTestSource.Parse($$""" 8401var source = CSharpTestSource.Parse(""" 8427var interceptors = CSharpTestSource.Parse($$"""
Semantics\InterpolationTests.cs (2)
4597var tree = comp.SyntaxTrees[0]; 4823var tree = comp.SyntaxTrees[0];
Semantics\IteratorTests.cs (5)
457var tree = comp.SyntaxTrees[0]; 480var tree = comp.SyntaxTrees[0]; 577var tree = comp.SyntaxTrees.Single(); 608var tree = comp.SyntaxTrees[0]; 646var tree = comp.SyntaxTrees[0];
Semantics\LambdaDiscardParametersTests.cs (7)
67var tree = comp.SyntaxTrees.Single(); 384var tree = comp.SyntaxTrees[0]; 416var tree = comp.SyntaxTrees.Single(); 446var tree = comp.SyntaxTrees.Single(); 480var tree = comp.SyntaxTrees.Single(); 511var tree = comp.SyntaxTrees.Single(); 565var tree = comp.SyntaxTrees.Single();
Semantics\LambdaTests.cs (61)
837var tree = SyntaxFactory.ParseSyntaxTree(source); 938var tree = compilation.SyntaxTrees.Single(); 1030var tree = compilation.SyntaxTrees.Single(); 1084var tree = compilation.SyntaxTrees.Single(); 1119var tree = compilation.SyntaxTrees.Single(); 1169var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular9); 1202var tree = SyntaxFactory.ParseSyntaxTree(source); 1234var tree = SyntaxFactory.ParseSyntaxTree(source); 1512var tree = compilation.SyntaxTrees.Single(); 1547var tree = compilation.SyntaxTrees.Single(); 1581var tree = compilation.SyntaxTrees.Single(); 1613var tree = compilation.SyntaxTrees.Single(); 1976var tree = compilation.SyntaxTrees[0]; 2118var tree = compilation.SyntaxTrees[0]; 2164var tree = compilation.SyntaxTrees[0]; 2210var tree = compilation.SyntaxTrees[0]; 2256var tree = compilation.SyntaxTrees[0]; 2302var tree = compilation.SyntaxTrees[0]; 2332var tree = compilation.SyntaxTrees[0]; 2359var tree = compilation.SyntaxTrees[0]; 2413var tree = compilation.SyntaxTrees[0]; 2459var tree = compilation.SyntaxTrees[0]; 2505var tree = compilation.SyntaxTrees[0]; 2538var tree = compilation.SyntaxTrees[0]; 2571var tree = compilation.SyntaxTrees[0]; 2608var tree = compilation.SyntaxTrees[0]; 2660var tree = compilation.SyntaxTrees[0]; 2994var tree = SyntaxFactory.ParseSyntaxTree(source); 3036var tree = SyntaxFactory.ParseSyntaxTree(source); 3610var tree = comp.SyntaxTrees[0]; 3891var tree = comp.SyntaxTrees[0]; 3935var tree = comp.SyntaxTrees.Single(); 3975var tree = comp.SyntaxTrees.Single(); 3985var newTree = SyntaxFactory.ParseSyntaxTree(source + " "); 4091var tree = comp.SyntaxTrees[0]; 4120var tree = comp.SyntaxTrees[0]; 4155var tree = comp.SyntaxTrees[0]; 4183var tree = comp.SyntaxTrees[0]; 4210var tree = comp.SyntaxTrees[0]; 4785var tree = comp.SyntaxTrees[0]; 4870var tree = comp.SyntaxTrees[0]; 4925var tree = comp.SyntaxTrees[0]; 4952var tree = comp.SyntaxTrees[0]; 4980var tree = comp.SyntaxTrees[0]; 5026var tree = comp.SyntaxTrees[0]; 5634var tree = comp.SyntaxTrees[0]; 6507var tree = comp.SyntaxTrees.Single(); 6817var tree = comp.SyntaxTrees.Single(); 6846var tree = comp.SyntaxTrees.Single(); 6895var tree = comp.SyntaxTrees[0]; 7010var syntaxTree = comp.SyntaxTrees[0]; 7104var syntaxTree = comp.SyntaxTrees[0]; 7634var tree = comp.SyntaxTrees[0]; 8008var tree = comp.SyntaxTrees[0]; 8056var tree = comp.SyntaxTrees[0]; 8080var tree = comp.SyntaxTrees.Single(); 8116var tree = comp.SyntaxTrees.Single(); 8153var tree = comp.SyntaxTrees.Single(); 8227var tree = Parse(source); 8358var tree = comp.SyntaxTrees[0]; 8391var tree = comp.SyntaxTrees[0];
Semantics\LocalFunctionTests.cs (53)
343var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular9); 347var newTree = SyntaxFactory.ParseSyntaxTree(text + " "); 391var tree = SyntaxFactory.ParseSyntaxTree(text); 403var newTree = SyntaxFactory.ParseSyntaxTree(text + " "); 438var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular9); 443var newTree = SyntaxFactory.ParseSyntaxTree(text + " ", options: TestOptions.Regular9); 449static void validate(SemanticModel model, SyntaxTree tree) 490var tree = comp.SyntaxTrees.Single(); 538var tree = comp.SyntaxTrees.Single(); 615var tree = comp.SyntaxTrees.Single(); 668var tree = comp.SyntaxTrees.Single(); 722var tree = comp.SyntaxTrees.Single(); 802var tree = comp.SyntaxTrees.Single(); 849var tree = comp.SyntaxTrees.Single(); 967var tree = comp.SyntaxTrees.Single(); 1019var tree = comp.SyntaxTrees.Single(); 1057var tree = comp.SyntaxTrees.Single(); 1679var tree = SyntaxFactory.ParseSyntaxTree(@" 1762var tree = comp.SyntaxTrees.First(); 1837var tree = comp.SyntaxTrees.First(); 1889var tree = SyntaxFactory.ParseSyntaxTree(@" 1945var tree = SyntaxFactory.ParseSyntaxTree(@" 2371var tree = comp.SyntaxTrees.Single(); 2585var tree = comp.SyntaxTrees[0]; 4684var tree = compilation.SyntaxTrees[0]; 4722var tree = compilation.SyntaxTrees[0]; 4959var tree = compilation.SyntaxTrees.Single(); 5102var tree = comp.SyntaxTrees.Single(); 6358var tree = comp.SyntaxTrees[0]; 6379var tree = comp.SyntaxTrees[0]; 6407var tree = comp.SyntaxTrees[0]; 6443var tree = comp.SyntaxTrees[0]; 6487var tree = comp.SyntaxTrees[0]; 6534var tree = comp.SyntaxTrees[0]; 6548private static ImmutableArray<ExpressionSyntax> GetNameOfExpressions(SyntaxTree tree) 7036var tree = comp.SyntaxTrees[0]; 7096var tree = comp.SyntaxTrees[0]; 7342var tree = comp.SyntaxTrees.Single(); 7430var tree = comp.SyntaxTrees.Single(); 7495var tree = comp.SyntaxTrees.Single(); 7569var tree = comp.SyntaxTrees.Single(); 7637var tree = comp.SyntaxTrees.First(); 8682var tree = comp.SyntaxTrees.First(); 8735var tree = comp.SyntaxTrees.Single(); 8738var tree2 = CSharpSyntaxTree.ParseText(source); 8777var tree = comp.SyntaxTrees.Single(); 8925var tree = comp.SyntaxTrees.Single(); 9429var tree = comp.SyntaxTrees.Single(); 9550var tree = comp.SyntaxTrees.First(); 9747var tree = comp.SyntaxTrees.Single(); 10170var tree = comp.SyntaxTrees.First(); 10382var tree = compilation.SyntaxTrees[0]; 10426var tree = comp.SyntaxTrees.Single();
Semantics\LockTests.cs (7)
42var tree = compilation.SyntaxTrees.Single(); 486var tree = compilation.SyntaxTrees.Single(); 548var tree = compilation.SyntaxTrees.Single(); 572var tree = compilation.SyntaxTrees.Single(); 602var tree = compilation.SyntaxTrees.Single(); 626var tree = compilation.SyntaxTrees.Single(); 696var tree = compilation.SyntaxTrees.Single();
Semantics\LookupPositionTests.cs (3)
2271var tree = compilation.SyntaxTrees.Single(); 2299var tree = compilation.SyntaxTrees.Single(); 3117var tree = compilation.SyntaxTrees[0];
Semantics\LookupTests.cs (24)
28var tree = compilation.SyntaxTrees.Single(); 36var tree = Parse(testSrc, options: isScript ? TestOptions.Script : TestOptions.Regular); 425var tree = comp.SyntaxTrees.Single(); 581var tree = comp.SyntaxTrees.Single(); 617var srcTrees = new SyntaxTree[] { Parse(testSrc) }; 621var tree = srcTrees[0]; 674var srcTrees = new SyntaxTree[] { Parse(testSrc) }; 678var tree = srcTrees[0]; 1366var tree = Parse(source); 1499var tree = compilation.SyntaxTrees[0]; 1560var tree = compilation.SyntaxTrees[0]; 1592var tree = compilation.SyntaxTrees[0]; 1640var tree = compilation.SyntaxTrees[0]; 1667var tree = compilation.SyntaxTrees[0]; 1722var tree = comp.SyntaxTrees.Single(); 1756var tree = comp.SyntaxTrees.Single(); 1787var tree = comp.SyntaxTrees.Single(); 1819var tree = comp.SyntaxTrees.Single(); 1980var tree = comp.SyntaxTrees.Single(); 2011var tree = comp.SyntaxTrees.Single(); 2041var tree = comp.SyntaxTrees.Single(); 2071var tree = comp.SyntaxTrees.Single(); 2097var tree = comp.SyntaxTrees.Single(); 2120var tree = comp.SyntaxTrees.Single();
Semantics\MethodBodyModelTests.cs (34)
54var tree = Parse(text); 76var tree = Parse(text); 99var tree = Parse(text); 122var tree = Parse(text); 162var tree = Parse(text); 202var tree = Parse(text); 242var tree = Parse(text); 265var tree = Parse(text); 293var tree = Parse(text); 324var tree = Parse(text); 369var tree = Parse(text); 393var tree = Parse(text); 416var tree = Parse(text); 440var tree = Parse(text); 463var tree = Parse(text); 486var tree = Parse(text); 509var tree = Parse(text); 532var tree = Parse(text); 563var tree = Parse(text); 615var tree = Parse(text); 639var tree = Parse(text); 666var tree = Parse(text); 698var tree = Parse(text); 725var tree = Parse(text); 750var tree = Parse(text); 770var tree = Parse(text); 795var tree = Parse(text); 832var tree = Parse(text); 859var tree = Parse(text); 884var tree = Parse(text); 911var tree = Parse(text); 932var tree = Parse(text); 953var tree = Parse(text); 992var tree = Parse(text);
Semantics\MethodTypeInferenceTests.cs (10)
699var tree = comp.SyntaxTrees.Single(); 754var tree = comp.SyntaxTrees.Single(); 800var tree = comp.SyntaxTrees.Single(); 857private static IEnumerable<DiscardDesignationSyntax> GetDiscardDesignations(SyntaxTree tree) 862private static IEnumerable<IdentifierNameSyntax> GetDiscardIdentifiers(SyntaxTree tree) 1044var tree = comp.SyntaxTrees.Single(); 1074var tree = comp.SyntaxTrees.Single(); 1116var tree = compilation.SyntaxTrees.Single(); 1157var tree = compilation.SyntaxTrees.Single(); 1198var tree = compilation.SyntaxTrees.Single();
Semantics\NameOfTests.cs (22)
683var tree = compilation.SyntaxTrees[0]; 709var tree = compilation.SyntaxTrees[0]; 744var tree = compilation.SyntaxTrees[0]; 791var tree = compilation.SyntaxTrees[0]; 828var tree = compilation.SyntaxTrees[0]; 864var tree = compilation.SyntaxTrees[0]; 910var tree = compilation.SyntaxTrees[0]; 943var tree = compilation.SyntaxTrees[0]; 974var tree = comp.SyntaxTrees.Single(); 975var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1015static ImmutableArray<InvocationExpressionSyntax> getNameOfCalls(SyntaxTree tree) 1046var tree = comp.SyntaxTrees.Single(); 1047var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1089static ImmutableArray<InvocationExpressionSyntax> getNameOfCalls(SyntaxTree tree) 1128var tree = comp.SyntaxTrees.Single(); 1129var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1172static ImmutableArray<InvocationExpressionSyntax> getNameOfCalls(SyntaxTree tree) 1209var tree = comp.SyntaxTrees.Single(); 1210var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1253static ImmutableArray<InvocationExpressionSyntax> getNameOfCalls(SyntaxTree tree) 1420var tree = compilation.SyntaxTrees[0]; 3038var tree = compilation.SyntaxTrees.Single();
Semantics\NativeIntegerTests.cs (19)
1787var tree = comp.SyntaxTrees[0]; 2344var tree = comp.SyntaxTrees[0]; 2464var tree = compB.SyntaxTrees[0]; 3633var tree = comp.SyntaxTrees[0]; 4073var tree = comp.SyntaxTrees.Single(); 4116var tree = comp.SyntaxTrees[0]; 6059var tree = comp.SyntaxTrees[0]; 6107var tree = comp.SyntaxTrees[0]; 9493var tree = comp.SyntaxTrees[0]; 9728var tree = comp.SyntaxTrees[0]; 10102var tree = comp.SyntaxTrees[0]; 10329var tree = comp.SyntaxTrees[0]; 12379var tree = comp.SyntaxTrees[0]; 15315var tree = comp.SyntaxTrees.Single(); 15336var tree = comp.SyntaxTrees.Single(); 15359var tree = comp.SyntaxTrees.Single(); 15387var tree = comp.SyntaxTrees.Single(); 15410var tree = comp.SyntaxTrees.Single(); 15440var tree = comp.SyntaxTrees.Single();
Semantics\NonTrailingNamedArgumentsTests.cs (15)
43var tree = verifier.Compilation.SyntaxTrees.First(); 365var tree = comp.SyntaxTrees.First(); 391var tree = verifier.Compilation.SyntaxTrees.First(); 421var tree = comp.SyntaxTrees.First(); 453var tree = comp.SyntaxTrees.First(); 482var tree = comp.SyntaxTrees.First(); 532var tree = comp.SyntaxTrees.First(); 567var tree = comp.SyntaxTrees.First(); 596var tree = comp.SyntaxTrees.First(); 650var tree = comp.SyntaxTrees.First(); 677var tree = comp.SyntaxTrees.First(); 708var tree = comp.SyntaxTrees.First(); 742var tree = verifier.Compilation.SyntaxTrees.First(); 774var tree = verifier.Compilation.SyntaxTrees.First(); 981var tree = comp.SyntaxTrees.First();
Semantics\NullableContextTests.cs (14)
64var syntaxTree = comp.SyntaxTrees[0]; 97var syntaxTree1 = comp.SyntaxTrees[0]; 99var syntaxTree2 = comp.SyntaxTrees[1]; 348var syntaxTree = comp.SyntaxTrees[0]; 387var syntaxTree = comp.SyntaxTrees[0]; 422var syntaxTree = comp.SyntaxTrees[0]; 1769var syntaxTree = comp.SyntaxTrees[0]; 1839var syntaxTree = comp.SyntaxTrees[0]; 1876var syntaxTree = comp.SyntaxTrees[0]; 1925var syntaxTree = comp.SyntaxTrees[0]; 1967var syntaxTree = comp.SyntaxTrees[0]; 2007var syntaxTree = comp.SyntaxTrees[0]; 2046var syntaxTree = comp.SyntaxTrees[0]; 2226var syntaxTree = comp.SyntaxTrees[0];
Semantics\NullableConversionTests.cs (1)
803var syntaxTree = compilation.SyntaxTrees.First();
Semantics\NullableReferenceTypesTests.cs (120)
1751var tree = comp.SyntaxTrees.Single(); 1785var tree = comp.SyntaxTrees.Single(); 1838var tree = comp.SyntaxTrees.Single(); 1865var tree = comp.SyntaxTrees.Single(); 1890var tree = comp.SyntaxTrees.Single(); 1960var tree = comp.SyntaxTrees.Single(); 2273var tree = comp.SyntaxTrees.Single(); 2312var tree = comp.SyntaxTrees.Single(); 2345var tree = comp.SyntaxTrees.Single(); 2378var tree = comp.SyntaxTrees.Single(); 2477var tree = comp.SyntaxTrees.Single(); 3332var tree = compilation.SyntaxTrees[0]; 3691var tree = comp.SyntaxTrees[0]; 4524var tree = comp.SyntaxTrees.Single(); 4560var tree = comp.SyntaxTrees.Single(); 4592var tree = comp.SyntaxTrees.Single(); 5168var syntaxTree = comp.SyntaxTrees[0]; 5753var source1 = CSharpSyntaxTree.ParseText(@" 5765var source2 = CSharpSyntaxTree.ParseText(@" 5779var source3 = CSharpSyntaxTree.ParseText( 5792var source4 = SyntaxFactory.ParseSyntaxTree(@" 7768var tree = Parse(source); 10532var tree = compilation.SyntaxTrees.Single(); 13509var tree = compilation.SyntaxTrees[0]; 34981var tree = compilation.SyntaxTrees.First(); 34998var tree = compilation.SyntaxTrees.First(); 56074var tree = comp.SyntaxTrees.Single(); 56104var tree = comp.SyntaxTrees.Single(); 56137var tree = comp.SyntaxTrees.Single(); 56174var tree = comp.SyntaxTrees.Single(); 56209var tree = comp.SyntaxTrees.Single(); 56243var tree = comp.SyntaxTrees.Single(); 56274var tree = comp.SyntaxTrees.Single(); 56302var tree = comp.SyntaxTrees.Single(); 56341var tree = comp.SyntaxTrees.Single(); 56375var tree = comp.SyntaxTrees.Single(); 56406var tree = comp.SyntaxTrees.Single(); 56435var tree = comp.SyntaxTrees.Single(); 56470var tree = comp.SyntaxTrees.Single(); 56506var tree = comp.SyntaxTrees.Single(); 56585var tree = comp.SyntaxTrees.Single(); 56617var tree = comp.SyntaxTrees.Single(); 59015var tree = comp.SyntaxTrees[0]; 59049var tree = comp.SyntaxTrees[0]; 59077var tree = comp.SyntaxTrees[0]; 59109var tree = comp.SyntaxTrees[0]; 59138var tree = comp.SyntaxTrees[0]; 59171var tree = comp.SyntaxTrees[0]; 59203var tree = comp.SyntaxTrees[0]; 59236var tree = comp.SyntaxTrees[0]; 59270var tree = comp.SyntaxTrees[0]; 59296var tree = comp.SyntaxTrees[0]; 59325var tree = comp.SyntaxTrees[0]; 59354var tree = comp.SyntaxTrees[0]; 62838var syntaxTree = comp.SyntaxTrees.Single(); 65887var tree1 = comp1.SyntaxTrees.Single(); 65893var tree2 = CSharpSyntaxTree.ParseText(source2); 71250var tree = comp.SyntaxTrees[0]; 71286var tree = comp.SyntaxTrees[0]; 71327var tree = comp.SyntaxTrees[0]; 71364var tree = comp.SyntaxTrees[0]; 71401var tree = comp.SyntaxTrees[0]; 71436var tree = comp.SyntaxTrees[0]; 71469var tree = comp.SyntaxTrees[0]; 71506var tree = comp.SyntaxTrees[0]; 71779var tree = comp.SyntaxTrees.Single(); 71872var tree = comp.SyntaxTrees.Single(); 71919var tree = comp.SyntaxTrees.Single(); 71958var tree = comp.SyntaxTrees.Single(); 73759var tree = comp.SyntaxTrees.Single(); 81257var tree = comp.SyntaxTrees[0]; 94279var syntaxTree = comp.SyntaxTrees[0]; 97754var tree = comp.SyntaxTrees.First(); 99083var tree = comp.SyntaxTrees.First(); 111767var tree = comp.SyntaxTrees.First(); 111821var tree = comp.SyntaxTrees.First(); 113190var tree = comp.SyntaxTrees.First(); 113591var tree = comp.SyntaxTrees.Single(); 113622var tree = comp.SyntaxTrees.Single(); 113800var tree = comp.SyntaxTrees.Single(); 114025var tree = comp.SyntaxTrees.Single(); 145374var tree = comp.SyntaxTrees.Single(); 145415var tree = comp.SyntaxTrees.Single(); 145455var tree = comp.SyntaxTrees.Single(); 145493var tree = comp.SyntaxTrees.Single(); 145531var tree = comp.SyntaxTrees.Single(); 145570var tree = comp.SyntaxTrees.Single(); 145603var tree = comp.SyntaxTrees.Single(); 145635var tree = comp.SyntaxTrees.Single(); 145674var tree = comp.SyntaxTrees.Single(); 145950var tree = comp.SyntaxTrees.Single(); 145981var tree = comp.SyntaxTrees.Single(); 146014var tree = comp.SyntaxTrees.Single(); 146297var tree = comp.SyntaxTrees.Single(); 146336var tree = comp.SyntaxTrees.Single(); 146376var tree = comp.SyntaxTrees.Single(); 146415var tree = comp.SyntaxTrees.Single(); 146450var tree = comp.SyntaxTrees.Single(); 154799var tree = comp.SyntaxTrees[0]; 154867var tree = comp.SyntaxTrees[0]; 155995var tree = comp.SyntaxTrees.Single(); 156744var tree = comp.SyntaxTrees.Single(); 157579var tree = comp.SyntaxTrees.Single(); 157627var tree = comp.SyntaxTrees.Single(); 158059var tree = comp.SyntaxTrees.Single(); 158095var tree = comp.SyntaxTrees.Single(); 158190var tree = comp.SyntaxTrees.Single(); 158228var tree = comp.SyntaxTrees.Single(); 158269var tree = comp.SyntaxTrees.Single(); 158309var tree = comp.SyntaxTrees.Single(); 158343var tree = comp.SyntaxTrees.Single(); 158380var tree = comp.SyntaxTrees.Single(); 158475var tree = comp.SyntaxTrees.Single(); 158523var tree = comp.SyntaxTrees.Single(); 158565var tree = comp.SyntaxTrees.Single(); 158602var tree = comp.SyntaxTrees.Single(); 158813var tree = comp.SyntaxTrees.Single(); 160688var tree = comp.SyntaxTrees.Single(); 161238var syntaxTree = comp.SyntaxTrees.Single(); 161284var syntaxTree = comp.SyntaxTrees.Single();
Semantics\NullCoalesceAssignmentTests.cs (5)
35var syntaxTree = comp.SyntaxTrees.Single(); 73var syntaxTree = comp.SyntaxTrees.Single(); 116var syntaxTree = comp.SyntaxTrees.Single(); 155var syntaxTree = comp.SyntaxTrees.Single(); 181var syntaxTree = comp.SyntaxTrees.Single();
Semantics\ObjectAndCollectionInitializerTests.cs (17)
3468var tree = compilation.SyntaxTrees.Single(); 3516var tree = compilation.SyntaxTrees.Single(); 3573var tree = compilation.SyntaxTrees.Single(); 3609var tree = compilation.SyntaxTrees.Single(); 3646var tree = compilation.SyntaxTrees.Single(); 3687var tree = compilation.SyntaxTrees.Single(); 3737var tree = compilation.SyntaxTrees.Single(); 3781var tree = compilation.SyntaxTrees.Single(); 3812var syntax = comp.SyntaxTrees[0]; 3835var syntax = comp.SyntaxTrees[0]; 3859var syntax = comp.SyntaxTrees[0]; 3932var tree = compilation.SyntaxTrees.Single(); 4014var tree = compilation.SyntaxTrees.Single(); 4056var tree = compilation.SyntaxTrees.Single(); 4134var tree = compilation.SyntaxTrees.Single(); 4224var tree = comp.SyntaxTrees.Single(); 4278var tree = comp.SyntaxTrees.Single();
Semantics\OperatorTests.cs (18)
44var tree = compilation.SyntaxTrees.Single(); 2982var tree = compilation.SyntaxTrees.Single(); 6936var tree = comp.SyntaxTrees.Single(); 7053var tree = comp.SyntaxTrees.Single(); 7208var tree = comp.SyntaxTrees.Single(); 7328var tree = comp.SyntaxTrees[0]; 7485var tree = compilation.SyntaxTrees.Single(); 7701var tree = compilation.SyntaxTrees.Single(); 7854var tree = compilation.SyntaxTrees.Single(); 8014var tree = compilation.SyntaxTrees.Single(); 8551var tree = compilation.SyntaxTrees.Single(); 8586var tree = compilation.SyntaxTrees.Single(); 8630var tree = compilation.SyntaxTrees.Single(); 8680var tree = compilation.SyntaxTrees.Single(); 8754var tree = compilation.SyntaxTrees.Single(); 8811var tree = compilation.SyntaxTrees[0]; 11336var tree = compilation.SyntaxTrees.Single(); 11415var tree = comp.SyntaxTrees[0];
Semantics\OverloadResolutionPerfTests.cs (2)
980var tree = comp.SyntaxTrees.Single(); 1058var tree = comp.SyntaxTrees.Single();
Semantics\OverloadResolutionTests.cs (9)
7146var tree = comp.SyntaxTrees.Single(); 7256var tree = comp.SyntaxTrees.Single(); 7430var tree = comp.SyntaxTrees.Single(); 7471var tree = comp.SyntaxTrees.Single(); 9068var tree = compilation.SyntaxTrees.Single(); 9416var tree = comp.SyntaxTrees.Single(); 11760static void verify(CSharpCompilation comp, SyntaxTree tree) 11809static void verify(CSharpCompilation comp, SyntaxTree tree) 11859static void verify(CSharpCompilation comp, SyntaxTree tree)
Semantics\QueryTests.cs (31)
1451var tree = compilation.SyntaxTrees[0]; 1660var tree = compilation.SyntaxTrees[0]; 1720var tree = compilation.SyntaxTrees[0]; 1758var tree = compilation.SyntaxTrees[0]; 2174var tree = compilation.SyntaxTrees[0]; 2204var tree = compilation.SyntaxTrees[0]; 2230var tree = compilation.SyntaxTrees[0]; 2269var tree = compilation.SyntaxTrees[0]; 2297var tree = compilation.SyntaxTrees[0]; 2322var tree = compilation.SyntaxTrees[0]; 2354var tree = compilation.SyntaxTrees[0]; 2381var tree = compilation.SyntaxTrees[0]; 2425var tree = compilation.SyntaxTrees[0]; 2481var tree = compilation.SyntaxTrees[0]; 2519var tree = compilation.SyntaxTrees[0]; 2545var tree = compilation.SyntaxTrees[0]; 2580var tree = compilation.SyntaxTrees[0]; 2660var tree = compilation.SyntaxTrees[0]; 2688var tree = compilation.SyntaxTrees[0]; 2714var tree = compilation.SyntaxTrees[0]; 2740var tree = compilation.SyntaxTrees[0]; 2895var tree = compilation.SyntaxTrees[0]; 2928var tree = compilation.SyntaxTrees[0]; 3132var tree = compilation.SyntaxTrees.First(); 3160var tree = compilation.SyntaxTrees.First(); 3373var tree = compilation.SyntaxTrees[0]; 3418var tree = compilation.SyntaxTrees[0]; 3462var tree = compilation.SyntaxTrees[0]; 3509var tree = compilation.SyntaxTrees[0]; 3548var tree = compilation.SyntaxTrees[0]; 3596var tree = compilation.SyntaxTrees[0];
Semantics\RawInterpolationTests_Handler.cs (2)
2898var tree = comp.SyntaxTrees[0]; 3124var tree = comp.SyntaxTrees[0];
Semantics\RecordStructTests.cs (20)
532var tree = comp.SyntaxTrees.First(); 552var tree = comp.SyntaxTrees.First(); 572var tree = comp.SyntaxTrees.First(); 594var tree = comp.SyntaxTrees.First(); 2305var tree = comp.SyntaxTrees.Single(); 2329var tree = comp.SyntaxTrees.Single(); 2591var tree = comp.SyntaxTrees.First(); 2626var tree = comp.SyntaxTrees.First(); 2660var tree = comp.SyntaxTrees.First(); 2695var tree = comp.SyntaxTrees.First(); 3241var tree = comp.SyntaxTrees.Single(); 3283var tree = comp.SyntaxTrees.Single(); 3331var tree = comp.SyntaxTrees.Single(); 3382var tree = comp.SyntaxTrees.Single(); 5847var tree = comp.SyntaxTrees[0]; 5889var tree = comp.SyntaxTrees[0]; 6923var tree = comp.SyntaxTrees.First(); 7604var tree = comp.SyntaxTrees.First(); 8809var tree = comp.SyntaxTrees.Single(); 10768var tree = comp.SyntaxTrees.First();
Semantics\RefEscapingTests.cs (20)
23var tree = SyntaxFactory.ParseSyntaxTree(@" 2612var tree = SyntaxFactory.ParseSyntaxTree(""" 2647var tree = SyntaxFactory.ParseSyntaxTree(""" 2676var tree = SyntaxFactory.ParseSyntaxTree(""" 2871var tree = SyntaxFactory.ParseSyntaxTree(""" 2928var tree = SyntaxFactory.ParseSyntaxTree(""" 2968var tree = SyntaxFactory.ParseSyntaxTree(""" 3178var tree = SyntaxFactory.ParseSyntaxTree(""" 3206var tree = SyntaxFactory.ParseSyntaxTree(""" 3288var tree = SyntaxFactory.ParseSyntaxTree(""" 3375var tree = SyntaxFactory.ParseSyntaxTree(""" 3752var tree = SyntaxFactory.ParseSyntaxTree(""" 3797var tree = SyntaxFactory.ParseSyntaxTree(""" 3900var tree = SyntaxFactory.ParseSyntaxTree(""" 4135var tree = SyntaxFactory.ParseSyntaxTree(""" 5781var tree = compilation.SyntaxTrees[0]; 5881var tree = compilation.SyntaxTrees[0]; 6782var tree = SyntaxFactory.ParseSyntaxTree(""" 10254var tree = SyntaxFactory.ParseSyntaxTree(""" 10290var tree = SyntaxFactory.ParseSyntaxTree("""
Semantics\RefExtensionMethodsTests.cs (4)
2142var tree = comp.SyntaxTrees.Single(); 2161var tree = comp.SyntaxTrees.Single(); 2180var tree = comp.SyntaxTrees.Single(); 2199var tree = comp.SyntaxTrees.Single();
Semantics\RefFieldTests.cs (57)
11023var tree = comp.SyntaxTrees[0]; 11097var tree = comp.SyntaxTrees[0]; 11219var tree = comp.SyntaxTrees[0]; 11387var tree = comp.SyntaxTrees[0]; 11979var tree = comp.SyntaxTrees[0]; 12059var tree = comp.SyntaxTrees[0]; 12128var tree = comp.SyntaxTrees[0]; 12196var tree = comp.SyntaxTrees[0]; 12378var tree = comp.SyntaxTrees[0]; 12565var tree = comp.SyntaxTrees[0]; 12791var tree = comp.SyntaxTrees[0]; 12974var tree = comp.SyntaxTrees[0]; 13149var tree = comp.SyntaxTrees[0]; 13204var tree = comp.SyntaxTrees[0]; 13263var tree = comp.SyntaxTrees[0]; 13306var tree = comp.SyntaxTrees[0]; 13335var tree = comp.SyntaxTrees[0]; 13360var tree = comp.SyntaxTrees[0]; 13380var tree = comp.SyntaxTrees[0]; 13402var tree = comp.SyntaxTrees[0]; 13437var tree = comp.SyntaxTrees[0]; 13501var tree = comp.SyntaxTrees[0]; 13577var tree = comp.SyntaxTrees[0]; 13648var tree = comp.SyntaxTrees[0]; 13712var tree = comp.SyntaxTrees[0]; 14353var tree = comp.SyntaxTrees[0]; 14395var tree = comp.SyntaxTrees[0]; 14520var tree = comp.SyntaxTrees[0]; 14596var tree = comp.SyntaxTrees[0]; 14841var tree = comp.SyntaxTrees[0]; 15049var tree = comp.SyntaxTrees[0]; 15075var tree = comp.SyntaxTrees[0]; 15130var tree = comp.SyntaxTrees[0]; 16548var tree = comp.SyntaxTrees.Single(); 16589var tree = comp.SyntaxTrees.Single(); 16628var tree = comp.SyntaxTrees.Single(); 16724var tree = comp.SyntaxTrees.Single(); 16771var syntaxTree = comp.SyntaxTrees[0]; 17944var tree = comp.SyntaxTrees[0]; 23382var tree = comp.SyntaxTrees[0]; 23450var tree = comp.SyntaxTrees[0]; 24452var tree = comp.SyntaxTrees[0]; 24488var tree = comp.SyntaxTrees[0]; 24525var tree = comp.SyntaxTrees[0]; 25292var tree = comp.SyntaxTrees[0]; 27347var tree = comp.SyntaxTrees[0]; 27399var tree = comp.SyntaxTrees[0]; 27451var tree = comp.SyntaxTrees[0]; 27608var tree = comp.SyntaxTrees[0]; 27698var tree = comp.SyntaxTrees[0]; 27818var tree = comp.SyntaxTrees[0]; 27919var tree = comp.SyntaxTrees[0]; 27964var tree = comp.SyntaxTrees[0]; 28024var tree = comp.SyntaxTrees[0]; 28254var tree = comp.SyntaxTrees[0]; 28302var tree = comp.SyntaxTrees[0]; 29392var tree = comp.SyntaxTrees[0];
Semantics\RefLocalsAndReturnsTests.cs (12)
539var tree = SyntaxFactory.ParseSyntaxTree(@" 1083var tree = SyntaxFactory.ParseSyntaxTree(@" 4749var tree = compilation.SyntaxTrees.Single(); 4777var tree = compilation.SyntaxTrees.Single(); 4805var tree = compilation.SyntaxTrees.Single(); 4833var tree = compilation.SyntaxTrees.Single(); 4861var tree = compilation.SyntaxTrees.Single(); 4889var tree = compilation.SyntaxTrees.Single(); 4923var tree = compilation.SyntaxTrees.Single(); 5208var tree = comp.SyntaxTrees[0]; 5252var tree = comp.SyntaxTrees[0]; 5291var tree = comp.SyntaxTrees[0];
Semantics\ScriptSemanticsTests.cs (18)
236var tree = compilation.SyntaxTrees.Single(); 263var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 286var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 365var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 396var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 443var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 485var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6)); 519var tree = Parse(source, options: TestOptions.Script); 535var tree = Parse(source, options: TestOptions.Script); 553var tree = compilation.SyntaxTrees.Single(); 589var tree = compilation.SyntaxTrees.Single(); 1134var tree = Parse(source, options: TestOptions.Script); 1154var tree = Parse(source, options: TestOptions.Script); 1180var syntaxTree = compilationUnit.SyntaxTree; 1268var syntaxTree1 = compilationUnit.SyntaxTree; 1269var syntaxTree2 = SyntaxFactory.ParseSyntaxTree("System.Console.WriteLine(2);", options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1307var syntaxTree = compilationUnit.SyntaxTree; 1387private static MemberAccessExpressionSyntax ErrorTestsGetNode(SyntaxTree syntaxTree)
Semantics\SemanticErrorTests.cs (4)
3322var tree = Parse(text); 7487var tree = compilation.SyntaxTrees.Single(); 13326var tree = compilation2.SyntaxTrees.Single(); 24223var tree = compilation.SyntaxTrees.Single();
Semantics\StackAllocInitializerTests.cs (9)
364var tree = comp.SyntaxTrees.Single(); 440var tree = comp.SyntaxTrees.Single(); 1042var tree = comp.SyntaxTrees.Single(); 1144var tree = comp.SyntaxTrees.Single(); 2356var tree = comp.SyntaxTrees.Single(); 2462var tree = comp.SyntaxTrees.Single(); 2562var tree = comp.SyntaxTrees.Single(); 2646var tree = comp.SyntaxTrees.Single(); 2716var tree = comp.SyntaxTrees[0];
Semantics\StackAllocSpanExpressionsTests.cs (2)
50var tree = comp.SyntaxTrees.Single(); 124var tree = comp.SyntaxTrees.Single();
Semantics\StructConstructorTests.cs (3)
1048var tree = comp.SyntaxTrees.Single(); 1143var tree = comp.SyntaxTrees.Single(); 1240var tree = comp.SyntaxTrees.Single();
Semantics\SuppressAccessibilityChecksTests.cs (4)
46var syntaxTree = compilationB.SyntaxTrees[0]; 119var tree = SyntaxFactory.ParseSyntaxTree(source); 166var syntaxTree = compilationB.SyntaxTrees[0]; 211var tree = compilation.SyntaxTrees[0];
Semantics\SwitchTests.cs (1)
1147var syntaxTree = SyntaxFactory.ParseSyntaxTree(source);
Semantics\SyntaxTreeRootTests.cs (13)
27var tree = SyntaxFactory.SyntaxTree(node); 35var tree = CSharpSyntaxTree.CreateWithoutClone(node); 42var tree = SyntaxFactory.ParseSyntaxTree(@"class Program { static void Main() { System.Console.WriteLine(""Wah""); } }"); 50var tree = SyntaxFactory.SyntaxTree(SyntaxFactory.FromClause("Nay", SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(823)))); 60var arbitraryTree = SyntaxFactory.SyntaxTree(SyntaxFactory.Attribute(SyntaxFactory.IdentifierName("Wooh"))); 61var parsedTree = SyntaxFactory.ParseSyntaxTree(""); 71var tree = SyntaxFactory.SyntaxTree( 81var syntaxTreeField = typeof(CSharpSyntaxNode).GetFields(BindingFlags.NonPublic | BindingFlags.Instance).Single(f => f.FieldType == typeof(SyntaxTree)); 89var tree = node.SyntaxTree; 98var childTree = node.Operand.SyntaxTree; 99var parentTree = node.SyntaxTree; 107var tree = SyntaxFactory.ParseSyntaxTree("class TheClass { }"); 111private void CheckTree(SyntaxTree tree)
Semantics\TargetTypedConditionalOperatorTests.cs (3)
331var tree = Parse(source, options: parseOptions); 666var tree = comp.SyntaxTrees[0]; 687var tree = comp.SyntaxTrees[0];
Semantics\TargetTypedDefaultTests.cs (32)
40var tree = comp.SyntaxTrees.First(); 140var tree = comp.SyntaxTrees.First(); 192var tree = comp.SyntaxTrees.First(); 240var tree = comp.SyntaxTrees.First(); 277var tree = comp.SyntaxTrees.First(); 322var tree = comp.SyntaxTrees.First(); 516var tree = comp.SyntaxTrees.First(); 562var tree = comp.SyntaxTrees.First(); 605var tree = comp.SyntaxTrees.First(); 663var tree = comp.SyntaxTrees.First(); 744var tree = comp.SyntaxTrees.First(); 833var tree = comp.SyntaxTrees.First(); 862var tree = comp.SyntaxTrees.First(); 1138var tree = comp.SyntaxTrees.First(); 1253var tree = comp.SyntaxTrees.First(); 1627var tree = comp.SyntaxTrees.First(); 1732var tree = comp.SyntaxTrees.First(); 1798var tree = comp.SyntaxTrees.First(); 1869var tree = comp.SyntaxTrees.First(); 1907var tree = comp.SyntaxTrees.First(); 2086var tree = comp.SyntaxTrees.First(); 2329var tree = comp.SyntaxTrees.First(); 2410var tree = comp.SyntaxTrees.First(); 2453var tree = comp.SyntaxTrees.First(); 2479var tree = comp.SyntaxTrees.First(); 3053var tree = comp.SyntaxTrees.First(); 3340var tree = comp.SyntaxTrees.Last(); 3379var tree = comp.SyntaxTrees.First(); 3510var tree = comp.SyntaxTrees.First(); 3572var tree = comp.SyntaxTrees.First(); 3669var tree = comp.SyntaxTrees.First(); 3709var tree = comp.SyntaxTrees.First();
Semantics\TopLevelStatementsTests.cs (55)
186static void verifyModel(CSharpCompilation comp, SyntaxTree tree1, bool nullableEnabled = false) 247static void verifyModelForGlobalStatements(SyntaxTree tree1, SemanticModel model1) 311static void verifyModel(CSharpCompilation comp, SyntaxTree tree1, SyntaxTree tree2, bool nullableEnabled = false) 398static void verifyModelForGlobalStatements(SyntaxTree tree1, SemanticModel model1) 476static void verifyModel(CSharpCompilation comp, SyntaxTree tree1, SyntaxTree tree2) 528var tree1 = comp.SyntaxTrees[0]; 568static void verifyModel(CSharpCompilation comp, SyntaxTree tree1) 696var tree = comp.SyntaxTrees.Single(); 869var tree1 = comp.SyntaxTrees[0]; 875var tree2 = comp.SyntaxTrees[1]; 983var tree1 = comp.SyntaxTrees[0]; 1038var tree1 = comp.SyntaxTrees[0]; 1405var tree2 = comp.SyntaxTrees[1]; 1519var tree = comp.SyntaxTrees.Single(); 1589var tree = comp.SyntaxTrees[0]; 1683var tree1 = comp.SyntaxTrees[0]; 1713var tree = comp.SyntaxTrees[0]; 1856var tree1 = comp.SyntaxTrees[0]; 1879var tree2 = comp.SyntaxTrees[1]; 2082var tree1 = comp.SyntaxTrees[0]; 2246var tree1 = comp.SyntaxTrees[0]; 2264var tree2 = comp.SyntaxTrees[1]; 2424var tree1 = comp.SyntaxTrees[0]; 2916var tree1 = comp.SyntaxTrees[0]; 2939var tree2 = comp.SyntaxTrees[1]; 3939var tree = comp.SyntaxTrees[0]; 4088var tree = comp.SyntaxTrees[1]; 4213var tree = comp.SyntaxTrees.Single(); 4508var tree1 = comp.SyntaxTrees[0]; 4514var tree2 = comp.SyntaxTrees[1]; 4572var tree1 = comp.SyntaxTrees[0]; 4621var tree1 = comp.SyntaxTrees[0]; 4891var tree = comp.SyntaxTrees.Single(); 4948var tree1 = comp.SyntaxTrees[0]; 4954var tree2 = comp.SyntaxTrees[1]; 4976var tree = comp.SyntaxTrees.Single(); 6027var tree1 = comp.SyntaxTrees[0]; 6084var syntaxTree = comp.SyntaxTrees.Single(); 6156var syntaxTree = comp.SyntaxTrees.Single(); 6231var syntaxTree = comp.SyntaxTrees.Single(); 6275var syntaxTree = comp.SyntaxTrees.Single(); 6315var syntaxTree1 = comp.SyntaxTrees.Single(); 6365var syntaxTree1 = comp.SyntaxTrees.First(); 6367var syntaxTree2 = comp.SyntaxTrees[1]; 8576var tree = comp.SyntaxTrees.Single(); 8649var tree = comp.SyntaxTrees.Single(); 8671var tree = comp.SyntaxTrees.Single(); 8693var tree = comp.SyntaxTrees.Single(); 8766var oldTree = Parse(text: text1, options: TestOptions.RegularDefault); 8794var tree = CSharpSyntaxTree.Create(compilationUnit, TestOptions.RegularDefault, path: "", Encoding.UTF8, SourceHashAlgorithms.Default); 8798var fullParseTree = Parse(text: text2, options: TestOptions.RegularDefault); 9676var tree = compilation.SyntaxTrees[0]; 9701var tree = compilation.SyntaxTrees[0];
Semantics\TryCatchTests.cs (1)
42var tree = compilation.SyntaxTrees.Single();
Semantics\TypeOfTests.cs (1)
31var tree = compilation.SyntaxTrees[0];
Semantics\UnsafeTests.cs (31)
5196var tree = compilation.SyntaxTrees.Single(); 5380var tree = compilation.SyntaxTrees.Single(); 6270var tree = SyntaxFactory.ParseSyntaxTree(@" 6366var tree = SyntaxFactory.ParseSyntaxTree(code, TestOptions.Regular); 7254var tree = compilation.SyntaxTrees.Single(); 7291var tree = compilation.SyntaxTrees.Single(); 7320var tree = compilation.SyntaxTrees.Single(); 7358var tree = compilation.SyntaxTrees.Single(); 7401var tree = compilation.SyntaxTrees.Single(); 7532var tree = compilation.SyntaxTrees.Single(); 7842var tree = compilation.SyntaxTrees.Single(); 7909var tree = compilation.SyntaxTrees.Single(); 8155var tree = compilation.SyntaxTrees.Single(); 8222var tree = compilation.SyntaxTrees.Single(); 8280var tree = compilation.SyntaxTrees.Single(); 8340var tree = compilation.SyntaxTrees.Single(); 8376var tree = compilation.SyntaxTrees.Single(); 8852var tree = compilation.SyntaxTrees.Single(); 8906var tree = compilation.SyntaxTrees.Single(); 9318var tree = compilation.SyntaxTrees.Single(); 10174var tree = compilation.SyntaxTrees.Single(); 10215var tree = compilation.SyntaxTrees.Single(); 10287var tree = compilation.SyntaxTrees.Single(); 10623var tree = compilation.SyntaxTrees.Single(); 10685var tree = compilation.SyntaxTrees.Single(); 10745var tree = compilation.SyntaxTrees.Single(); 11302var tree = compilation.SyntaxTrees.Single(); 11802var tree = Parse(sourceCode); 11834var tree = comp.SyntaxTrees.Single(); 11874var tree = compilation.SyntaxTrees.Single(); 11899var tree = Parse(sourceCode);
Semantics\UsingStatementTests.cs (7)
57var tree = compilation.SyntaxTrees.Single(); 1338var tree = compilation.SyntaxTrees.Single(); 1373var tree = compilation.SyntaxTrees.Single(); 1850var tree = compilation.SyntaxTrees.Single(); 1862var tree = compilation.SyntaxTrees.Single(); 1878var tree = compilation.SyntaxTrees.Single(); 1892var tree = compilation.SyntaxTrees.Single();
Semantics\Utf8StringsLiteralsTests.cs (14)
2968var tree = comp.SyntaxTrees.Single(); 2996var tree = comp.SyntaxTrees.Single(); 3024var tree = comp.SyntaxTrees.Single(); 3052var tree = comp.SyntaxTrees.Single(); 3080var tree = comp.SyntaxTrees.Single(); 3108var tree = comp.SyntaxTrees.Single(); 3136var tree = comp.SyntaxTrees.Single(); 3164var tree = comp.SyntaxTrees.Single(); 3192var tree = comp.SyntaxTrees.Single(); 3220var tree = comp.SyntaxTrees.Single(); 3248var tree = comp.SyntaxTrees.Single(); 3276var tree = comp.SyntaxTrees.Single(); 3304var tree = comp.SyntaxTrees.Single(); 4078var tree = comp.SyntaxTrees.Single();
SourceGeneration\GeneratorDriverTests.cs (16)
1142var tree = Assert.Single(results.GeneratedTrees); 1350var syntaxTree = compilation.SyntaxTrees.Single(); 1496var syntaxTree = compilation.SyntaxTrees.Single(); 2162var generatedTree = driver.GetRunResult().GeneratedTrees.Single(); 3617var syntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached"); 3649var validSyntaxTree = comp.SyntaxTrees.Single(); 3650var invalidSyntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached"); 3681var syntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached"); 3710var validSyntaxTree = ctx.Compilation.SyntaxTrees.Single(); 3711var invalidSyntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached"); 3743var syntaxTree = comp.SyntaxTrees.Single(); 3775var syntaxTree = comp.SyntaxTrees.Single(); 3806var syntaxTree = ctx.Compilation.SyntaxTrees.Single(); 3835var syntaxTree = ctx.Compilation.SyntaxTrees.Single(); 3867var syntaxTree = comp.SyntaxTrees.Single(); 3897var syntaxTree = ctx.Compilation.SyntaxTrees.Single();
SourceGeneration\SyntaxAwareGeneratorTests.cs (6)
1248var firstTree = compilation.SyntaxTrees.First(); 1249var newTree = CSharpSyntaxTree.ParseText(@" 1426var firstTree = compilation.SyntaxTrees.First(); 1427var lastTree = compilation.SyntaxTrees.Last(); 1428var dummyTree = CSharpSyntaxTree.ParseText("", parseOptions); 1461var newLastTree = CSharpSyntaxTree.ParseText(lastTree.ToString(), parseOptions);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1154)
Compilation\CompilationAPITests.cs (67)
38SyntaxTree tree, 47var tree = SyntaxFactory.ParseSyntaxTree(@" 70var tree = SyntaxFactory.ParseSyntaxTree("class C { long _f = 0l;}"); 90var tree = SyntaxFactory.ParseSyntaxTree("class C { long _f = 0l;}"); 112var tree = SyntaxFactory.ParseSyntaxTree(@" 138var tree = SyntaxFactory.ParseSyntaxTree("class C { long _f = 0l; }"); 165var tree = SyntaxFactory.ParseSyntaxTree(@" class C { long _f = 0l; }"); 166var newTree = SyntaxFactory.ParseSyntaxTree(@" class D { long _f = 0l; }"); 191var tree = SyntaxFactory.ParseSyntaxTree(@" class C { long _f = 0l; }"); 338var listSyntaxTree = new List<SyntaxTree>(); 353SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree(s1); 559var t1 = Parse(@" 567var t2 = Parse(@" 575var t3 = Parse(@" 582var t4 = Parse(@" 614syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree("public class C {}") }, 622syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 633syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 646syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 682syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree("public class C {}", options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)) }, 690syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 701syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 714syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 783SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree(s1); 784SyntaxTree withErrorTree = SyntaxFactory.ParseSyntaxTree(s2); 785SyntaxTree withErrorTree1 = SyntaxFactory.ParseSyntaxTree(s3); 786SyntaxTree withErrorTreeVB = SyntaxFactory.ParseSyntaxTree(s4); 787SyntaxTree withExpressionRootTree = SyntaxFactory.ParseExpression(s3).SyntaxTree; 788var withWarning = SyntaxFactory.ParseSyntaxTree(s5); 798comp = comp.AddSyntaxTrees(Enumerable.Empty<SyntaxTree>()); 840SyntaxTree t4 = SyntaxFactory.ParseSyntaxTree("Using System;"); 841SyntaxTree t5 = SyntaxFactory.ParseSyntaxTree("Usingsssssssssssss System;"); 842SyntaxTree t6 = SyntaxFactory.ParseSyntaxTree("Import System;"); 845var hs = new HashSet<SyntaxTree> { t4, t5, t6 }; 853var col = new Collection<SyntaxTree> { t4, t5, t6 }; 861var stack = new ConcurrentStack<SyntaxTree> { }; 872var queue = new ConcurrentQueue<SyntaxTree> { }; 914Assert.Throws<ArgumentException>(() => CSharpCompilation.Create("Compilation", new SyntaxTree[] { withExpressionRootTree })); 929SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree(s1); 930SyntaxTree t2 = SyntaxFactory.ParseSyntaxTree(s2); 931SyntaxTree t3 = SyntaxFactory.ParseSyntaxTree(s3); 933var listSyntaxTree = new List<SyntaxTree>(); 1341Assert.Throws<ArgumentNullException>(() => CSharpCompilation.Create("goo", syntaxTrees: new SyntaxTree[] { null })); 1481SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree("Using System;"); 1541SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree("Using System;"); 1555SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree("Using System;"); 1564SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("Using Goo;"); 1592SyntaxTree t1 = VB.VisualBasicSyntaxTree.ParseText(s1); 1593SyntaxTree t2 = t1; 1594var t3 = t2; 1599foreach (var item in vbComp.SyntaxTrees) 1619SyntaxTree t4 = SyntaxFactory.ParseSyntaxTree(s1); 1623comp.RemoveSyntaxTrees(new SyntaxTree[] { t4 }).GetSemanticModel(t4); 1939var tree2 = compilation.SyntaxTrees[1]; //tree for empty file 1953var tree2 = compilation.SyntaxTrees[1]; //tree for empty file 2066var ta = Parse("class C { }", options: TestOptions.Regular10); 2068var tb = Parse(@" 2071var tc = Parse(@" 2075var tr = Parse(@" 2079var ts = Parse(@" 2379var tree1 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2380var tree2 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2381var tree3 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 2621var tree = CSharpSyntaxTree.ParseText("class C { }"); 2839var syntaxTree = compilation.SyntaxTrees.Single(); 2874var syntaxTree = compilation.SyntaxTrees.Single(); 2906var syntaxTree = compilation.SyntaxTrees.Single();
Compilation\GetImportScopesTests.cs (13)
21var tree = Parse(text); 412var tree = Parse(text); 431var tree = Parse(text); 453var tree = Parse(text); 474var tree = Parse(text); 494var tree = Parse(text); 510var tree = Parse(text); 530var tree = Parse(text); 561var tree = Parse(text); 586var tree = Parse(text); 612var tree = Parse(text); 641var tree = Parse(text); 674var tree = Parse(text);
Compilation\GetSemanticInfoBrokenCodeTests.cs (17)
28var tree = Parse(text); 47var tree = Parse(text); 70var tree = Parse(text); 93var tree = Parse(text); 106var tree = Parse(text); 131var tree = Parse(text); 158var tree = Parse(text); 175var tree = Parse(text); 197var tree = comp.SyntaxTrees.Single(); 221var tree = comp.SyntaxTrees.Single(); 242var tree = comp.SyntaxTrees.Single(); 264var tree = comp.SyntaxTrees.Single(); 297var tree = comp.SyntaxTrees.Single(); 314var tree = Parse(text); 329var tree = Parse(text); 344var tree = Parse(text); 359var tree = Parse(text);
Compilation\GetSemanticInfoTests.cs (133)
39var tree = Parse(text); 69var tree = Parse(text); 98var tree = Parse(text); 132var tree = Parse(text); 161var tree = Parse(text); 187var tree = Parse(text); 238var tree = Parse(text); 291var tree = Parse(source); 370var tree = Parse(text); 412var tree = Parse(text); 439var tree = Parse(text); 473var tree = Parse(text); 526var tree = Parse(text); 593var tree = Parse(text); 626var tree = Parse(text); 972var tree = compilation.SyntaxTrees[0]; 996var tree = compilation.SyntaxTrees[0]; 1021var tree = Parse(text); 1044var tree = compilation.SyntaxTrees[0]; 1129var tree = Parse(text, options: TestOptions.Script); 1160var tree = Parse(text); 1189var tree = Parse(text); 1213var tree = Parse(text); 1236var tree = Parse(text); 1262var tree = Parse(text); 1290var tree = Parse(text); 1318var tree = Parse(text); 1345var tree = Parse(text); 1372var tree = Parse(text); 1408var tree = Parse(text); 1446var tree = Parse(text); 1484var tree = Parse(text); 1520var tree = Parse(text); 1551var tree = Parse(text); 1573var tree = Parse(text); 1601var tree = Parse(text); 1626var tree = Parse(text); 1665var tree = Parse(text); 1697var tree = Parse(text); 1732var tree = Parse(text); 1767var tree = Parse(text); 1803var tree = Parse(text); 1839var tree = Parse(text); 1880var tree = Parse(text); 1909var tree = Parse(text); 1945var tree = Parse(text); 1981var tree = Parse(text); 2017var tree = Parse(text); 2052var tree = Parse(text); 2218var tree = Parse(string.Format(template, types, constraints)); 2316var tree = Parse(text); 2352var tree = Parse(text); 2388var tree = Parse(text); 2447var tree = Parse(text); 2476var tree = comp.SyntaxTrees.Single(); 2504var tree = Parse(text); 2533var tree = Parse(text); 2563var tree = compilation.SyntaxTrees.Single(); 2716var tree = Parse(text); 2787var tree = Parse(text); 2833var tree = Parse(text); 2863var tree = Parse(text); 2925var tree = comp.SyntaxTrees.Single(); 2956var tree = Parse(text); 3017var tree = comp.SyntaxTrees.Single(); 3048var tree = Parse(text); 3090var tree = Parse(text); 3122var tree = Parse(text); 3164var tree = Parse(text); 3196var tree = Parse(text); 3239var tree = Parse(text); 3269var tree = Parse(text); 3323var tree = Parse(text); 3389var tree = Parse(text); 3463var tree = compilation.SyntaxTrees.Single(); 3517var tree = compilation.SyntaxTrees.Single(); 3549var tree = compilation.SyntaxTrees.Single(); 3577var tree = compilation.SyntaxTrees.Single(); 3604var tree = compilation.SyntaxTrees.Single(); 3629var tree = compilation.SyntaxTrees.Single(); 3662var tree = compilation.SyntaxTrees.Single(); 3698var tree = compilation.SyntaxTrees.Single(); 3754var tree = compilation.SyntaxTrees.Single(); 3782var tree = compilation.SyntaxTrees.Single(); 3815var tree = compilation.SyntaxTrees.Single(); 3843var tree = compilation.SyntaxTrees.Single(); 3869var tree = compilation.SyntaxTrees.Single(); 3909var tree = compilation.SyntaxTrees.Single(); 3949var tree = compilation.SyntaxTrees.Single(); 3995var tree = compilation.SyntaxTrees.Single(); 4035var tree = comp.SyntaxTrees.Single(); 4104var tree = comp.SyntaxTrees.Single(); 4159var tree = comp.SyntaxTrees.Single(); 4208var tree = compilation.SyntaxTrees.Single(); 4238var tree = compilation.SyntaxTrees.Single(); 4268var tree = compilation.SyntaxTrees.Single(); 4289var tree = compilation.SyntaxTrees.Single(); 4319var tree = compilation.SyntaxTrees.Single(); 4352var tree = compilation.SyntaxTrees.Single(); 4373var tree = compilation.SyntaxTrees.Single(); 4397var tree = compilation.SyntaxTrees.Single(); 4433var tree = compilation.SyntaxTrees.Single(); 4487var tree = compilation.SyntaxTrees.Single(); 4532var tree = compilation.SyntaxTrees.Single(); 4586var tree = compilation.SyntaxTrees.Single(); 4638var tree = compilation.SyntaxTrees.Single(); 4671var tree = comp.SyntaxTrees.Single(); 4716var tree = comp.SyntaxTrees.Single(); 4749var tree = comp.SyntaxTrees.Single(); 4782var tree = comp.SyntaxTrees.Single(); 4825var tree = comp.SyntaxTrees.Single(); 4871var tree = comp.SyntaxTrees.Single(); 4907var tree = comp.SyntaxTrees.Single(); 5400var tree = compilation.SyntaxTrees.Single(); 5475var tree = comp.SyntaxTrees.Single(); 5518var tree = comp.SyntaxTrees.Single(); 5532var tree = comp.SyntaxTrees.Single(); 5579var tree = comp.SyntaxTrees.Single(); 5617var tree = comp.SyntaxTrees.Single(); 5664var tree = comp.SyntaxTrees.Single(); 5717var tree = comp.SyntaxTrees.Single(); 5778var tree1 = Parse(file1); 5779var tree2 = Parse(file2); 5816var tree1 = Parse(file1); 5817var tree2 = Parse(file2); 5818var tree3 = Parse(file3); 5860var tree1 = Parse(file1); 5861var tree2 = Parse(file2); 5862var tree3 = Parse(file3); 5911var tree = comp.SyntaxTrees.Single(); 5984var tree = comp.SyntaxTrees.Single(); 6008var tree = compilation.SyntaxTrees.Single(); 6043var tree = comp.SyntaxTrees[0];
Compilation\GetUnusedImportDirectivesTests.cs (9)
32var tree = Parse(text); 89var tree = Parse(consoleApplicationSource); 172var tree = Parse(text); 190var tree = Parse(text); 214var signing = Parse(@" 389var tree = Parse("using System;", options: TestOptions.Script); 398var tree = Parse("using System;", options: TestOptions.Script); 423var tree = comp.SyntaxTrees[0]; 451var tree = comp.SyntaxTrees[0];
Compilation\IndexedProperties_BindingTests.cs (1)
135var tree = Parse(source);
Compilation\LoadDirectiveTests.cs (5)
80var external1 = compilation.SyntaxTrees.Last(); 81var external2 = Parse(code, "external2.csx", TestOptions.Script); 90var external3 = Parse(@" 104var external4 = Parse("#load \"a.csx\"", "external4.csx", TestOptions.Script); 162var newTree = Parse(code, "a.csx", TestOptions.Script);
Compilation\ReferenceManagerTests.cs (9)
740var tree = Parse(source); 859SyntaxTree t1, t2, t3; 1321foreach (var tree in new[] 1349var t1 = Parse(@" 1355var t2 = Parse(@" 1771var tree1 = comp1.SyntaxTrees.Single(); 1783var tree2 = tree1.WithInsertAt(text1.Length, text2); 1821var tree1 = comp1.SyntaxTrees.Single(); 1826var tree2 = tree1.WithInsertAt(text1.Length, text2);
Compilation\SemanticModelAPITests.cs (138)
40var tree = comp.SyntaxTrees[0]; 107SyntaxTree tree = comp.SyntaxTrees[0]; 134var tree = comp.SyntaxTrees[0]; 173var tree = comp.SyntaxTrees.Single(); 200var tree = comp.SyntaxTrees.Single(); 232var tree = comp.SyntaxTrees.Single(); 249var tree = Parse(text); 268var tree = Parse(text); 288var tree = Parse(text); 307var tree = Parse(text); 327var tree = Parse(text); 346var tree = Parse(text); 366var tree1 = Parse(text); 367var tree2 = Parse(text); 390var tree = Parse(text); 417var tree = Parse(text); 483var tree = Parse(text); 514var partial1Tree = Parse(partial1); 515var partial2Tree = Parse(partial2); 516var comp = CreateCompilation(new SyntaxTree[] { partial1Tree, partial2Tree }); 530var tree = Parse(text); 556var tree = Parse(text); 582var tree = Parse(text); 605var tree = Parse(text); 638var tree1 = Parse(text); 641var tree2 = Parse(text); 670var tree1 = Parse(text); 697var tree1 = Parse(text); 698var tree2 = Parse(text); 699var compilation = (Compilation)CreateCompilation(new SyntaxTree[] { tree1, tree2 }); 721var tree = Parse(text); 747var tree = Parse(text); 778var tree = Parse(text); 813var tree = Parse(text); 839var tree = Parse(text); 865var tree = Parse(text); 921var tree = Parse(text); 958var tree1 = Parse(text1); 959var tree2 = Parse(text2); 999var tree1 = Parse(text1); 1000var tree2 = Parse(text2); 1001var comp = CreateCompilation(new List<SyntaxTree> { tree1, tree2 }); 1038var tree = Parse(text); 1069var tree = Parse(text); 1110var tree = Parse(text); 1154var tree = Parse(text); 1190var tree = Parse(text); 1229var tree = comp.SyntaxTrees.Single(); 1262var tree = comp2.SyntaxTrees.Single(); 1303var tree = comp.SyntaxTrees.Single(); 1335var tree = comp.SyntaxTrees.Single(); 1358var tree = comp.SyntaxTrees.Single(); 1387var tree = comp.SyntaxTrees.Single(); 1407var tree = compilation.SyntaxTrees[0]; 1451var tree = compilation.SyntaxTrees[0]; 1497var tree = compilation.SyntaxTrees[0]; 1546var tree = compilation.SyntaxTrees[0]; 1585var tree = compilation.SyntaxTrees[0]; 1625var tree = compilation.SyntaxTrees[0]; 1643var tree = compilation.SyntaxTrees[0]; 1661var tree = compilation.SyntaxTrees[0]; 1670private static void TestExpressionBodySpeculation(Compilation compilation, SyntaxTree tree, ArrowExpressionClauseSyntax expressionBody) 1725var tree = comp.SyntaxTrees.Single(); 1774var tree = compilation.SyntaxTrees[0]; 1825var tree = compilation.SyntaxTrees[0]; 1875var tree = compilation.SyntaxTrees[0]; 1914var tree = compilation.SyntaxTrees[0]; 1951var tree = compilation.SyntaxTrees[0]; 1988var tree = compilation.SyntaxTrees[0]; 2017var tree = comp.SyntaxTrees.Single(); 2069var tree = comp.SyntaxTrees.Single(); 2138var tree = comp.SyntaxTrees.Single(); 2167var tree = compilation.SyntaxTrees[0]; 2212var tree = compilation.SyntaxTrees[0]; 2254var tree = compilation.SyntaxTrees[0]; 2307var tree = comp.SyntaxTrees.Single(); 2346var tree = compilation.SyntaxTrees[0]; 2441var tree = compilation.SyntaxTrees[0]; 2483var tree = compilation.SyntaxTrees[0]; 2528var tree = compilation.SyntaxTrees[0]; 2559var tree = compilation.SyntaxTrees[0]; 2631var tree = compilation.SyntaxTrees[0]; 2668var tree = compilation.SyntaxTrees[0]; 2759var tree = compilation.SyntaxTrees[0]; 2795var tree = compilation.SyntaxTrees[0]; 2810var tree = compilation.SyntaxTrees[0]; 2829var tree = compilation.SyntaxTrees[0]; 2859var tree = compilation.SyntaxTrees[0]; 2889var tree = compilation.SyntaxTrees[0]; 2918var tree = compilation.SyntaxTrees[0]; 2958var tree = compilation.SyntaxTrees[0]; 3003var tree = compilation.SyntaxTrees[0]; 3084var tree = compilation.SyntaxTrees[0]; 3124var tree = comp.SyntaxTrees.Single(); 3154var tree = comp.SyntaxTrees.Single(); 3189var tree = comp.SyntaxTrees.Single(); 3219var tree = comp.SyntaxTrees.Single(); 3256var tree = comp.SyntaxTrees.Single(); 3297var tree = comp.SyntaxTrees.Single(); 3338var tree = comp.SyntaxTrees.Single(); 3372var tree = comp.SyntaxTrees.Single(); 3414var tree = comp.SyntaxTrees.Single(); 3455var tree = comp.SyntaxTrees.Single(); 3496var tree = comp.SyntaxTrees.Single(); 3521var tree = compilation.SyntaxTrees.Single(); 3542var tree = compilation.SyntaxTrees.Single(); 3581var tree = comp.SyntaxTrees.Single(); 3599var tree = CSharpSyntaxTree.ParseText(@"using System.Collections.Generic; 3738var tree = comp.SyntaxTrees.Single(); 3783var tree = comp.SyntaxTrees[0]; 3816var tree = comp.SyntaxTrees.Single(); 3843var tree = comp.SyntaxTrees.Single(); 3871var tree = comp.SyntaxTrees.Single(); 3902var tree = comp.SyntaxTrees.Single(); 4055var tree = compilation.SyntaxTrees.Single(); 4104var tree = comp.SyntaxTrees.Single(); 4141var tree = comp.SyntaxTrees.Single(); 4184var tree = comp.SyntaxTrees.Single(); 4208var tree = comp.SyntaxTrees.Single(); 4236var tree = comp.SyntaxTrees.Single(); 4274var tree = comp.SyntaxTrees.Single(); 4326var tree = comp.SyntaxTrees.Single(); 4368var tree = compilation.SyntaxTrees[0]; 4423var syntaxTree = comp.SyntaxTrees[0]; 4456var tree = comp.SyntaxTrees.Single(); 4473var tree = comp.SyntaxTrees.Single(); 4537var tree = comp.SyntaxTrees.Single(); 4610var tree = compilation.SyntaxTrees.Single(); 4624var tree = compilation.SyntaxTrees.Single(); 4643var tree = compilation.SyntaxTrees.Single(); 4660var tree = compilation.SyntaxTrees.Single(); 4675var tree = compilation.SyntaxTrees.Single(); 4691var tree = compilation.SyntaxTrees.Single(); 4707var tree = compilation.SyntaxTrees.Single(); 4726var tree = compilation.SyntaxTrees.Single(); 4742var tree = compilation.SyntaxTrees.Single(); 4757var tree = compilation.SyntaxTrees.Single(); 4769var tree = Parse(text);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (161)
36var tree = comp.SyntaxTrees.Single(); 58var tree = comp.SyntaxTrees.Single(); 77var tree = compilation.SyntaxTrees[0]; 102var tree = compilation.SyntaxTrees[0]; 122var tree = compilation.SyntaxTrees[0]; 145var tree = compilation.SyntaxTrees[0]; 167var tree = compilation.SyntaxTrees[0]; 187var tree = compilation.SyntaxTrees[0]; 208var tree = compilation.SyntaxTrees[0]; 231var tree = compilation.SyntaxTrees[0]; 255var tree = compilation.SyntaxTrees[0]; 275var tree = compilation.SyntaxTrees[0]; 298var tree = compilation.SyntaxTrees[0]; 329var tree = compilation.SyntaxTrees[0]; 378var tree = compilation.SyntaxTrees[0]; 404var tree = compilation.SyntaxTrees[0]; 427var tree = compilation.SyntaxTrees[0]; 448var tree = compilation.SyntaxTrees[0]; 470var tree = compilation.SyntaxTrees[0]; 495var tree = compilation.SyntaxTrees[0]; 517var tree = compilation.SyntaxTrees[0]; 539var tree = compilation.SyntaxTrees[0]; 565var tree = compilation.SyntaxTrees[0]; 587var tree = compilation.SyntaxTrees[0]; 643var tree = compilation.SyntaxTrees[0]; 668var tree = compilation.SyntaxTrees[0]; 774var tree = compilation.SyntaxTrees[0]; 796var tree = compilation.SyntaxTrees[0]; 820var tree = compilation.SyntaxTrees[0]; 836var tree = compilation.SyntaxTrees[0]; 856var tree = compilation.SyntaxTrees[0]; 880var tree = compilation.SyntaxTrees[0]; 900var tree = compilation.SyntaxTrees[0]; 935var tree = compilation.SyntaxTrees[0]; 1003var tree = compilation.SyntaxTrees[0]; 1030var tree = compilation.SyntaxTrees.Single(); 1051var tree = compilation.SyntaxTrees.Single(); 1080var tree = compilation.SyntaxTrees.Single(); 1121var tree = compilation.SyntaxTrees.Single(); 1170var tree = compilation.SyntaxTrees.Single(); 1207var tree = compilation.SyntaxTrees.Single(); 1243var tree = compilation.SyntaxTrees.Single(); 1277var tree = compilation.SyntaxTrees.Single(); 1327var tree = compilation.SyntaxTrees.Single(); 1377var tree = compilation.SyntaxTrees.Single(); 1430var tree = compilation.SyntaxTrees.Single(); 1479var tree = compilation.SyntaxTrees.Single(); 1527var tree = compilation.SyntaxTrees.Single(); 1590var tree = compilation.SyntaxTrees.Single(); 1624var tree = compilation.SyntaxTrees.Single(); 1662var tree = compilation.SyntaxTrees.Single(); 1706var tree = compilation.SyntaxTrees.Single(); 1810var tree = compilation.SyntaxTrees.Single(); 1866var tree = compilation.SyntaxTrees.Single(); 1932var tree = compilation.SyntaxTrees.Single(); 2003var tree = compilation.SyntaxTrees.Single(); 2047var tree = compilation.SyntaxTrees.Single(); 2077var tree = compilation.SyntaxTrees.Single(); 2164var tree = compilation.SyntaxTrees.Single(); 2249var tree = compilation.SyntaxTrees[0]; 2285var tree = compilation.SyntaxTrees[0]; 2322var tree = compilation.SyntaxTrees[0]; 2358var tree = compilation.SyntaxTrees[0]; 2394var tree = compilation.SyntaxTrees[0]; 2424var tree = compilation.SyntaxTrees[0]; 2456var tree = compilation.SyntaxTrees[0]; 2493var tree = compilation.SyntaxTrees[0]; 2530var tree = compilation.SyntaxTrees[0]; 2561var tree = compilation.SyntaxTrees[0]; 2590var tree = compilation.SyntaxTrees[0]; 2615var tree = compilation.SyntaxTrees[0]; 2640var tree = compilation.SyntaxTrees[0]; 2670var tree = compilation.SyntaxTrees[0]; 2698var tree = compilation.SyntaxTrees[0]; 2750var tree = SyntaxFactory.ParseSyntaxTree(test, options: new CSharpParseOptions(languageVersion: LanguageVersion.CSharp6)); 2782var tree = compilation.SyntaxTrees.First(); 2809var tree = compilation.SyntaxTrees[0]; 2839var tree = compilation.SyntaxTrees[0]; 2903var tree = compilation.SyntaxTrees.First(); 2933var tree = compilation.SyntaxTrees.First(); 2965var tree = compilation.SyntaxTrees.First(); 3014var tree = compilation.SyntaxTrees.First(); 3041var tree = compilation.SyntaxTrees[0]; 3071var tree = compilation.SyntaxTrees.First(); 3107var tree = comp.SyntaxTrees.First(); 3137var tree = compilation.SyntaxTrees.First(); 3174var tree = compilation.SyntaxTrees.Single(); 3210var tree = compilation.SyntaxTrees[0]; 3233var tree = compilation.SyntaxTrees.First(); 3263var tree = compilation.SyntaxTrees[0]; 3310var tree = compilation.SyntaxTrees[0]; 3337var tree = compilation.SyntaxTrees[0]; 3363var tree = compilation.SyntaxTrees[0]; 3380var tree = compilation.SyntaxTrees[0]; 3404var tree = compilation.SyntaxTrees[0]; 3425var tree = compilation.SyntaxTrees[0]; 3444var tree = compilation.SyntaxTrees[0]; 3474var tree = compilation.SyntaxTrees[0]; 3497var tree = compilation.SyntaxTrees[0]; 3525var tree = compilation.SyntaxTrees[0]; 3562var tree = compilation.SyntaxTrees[0]; 3583var tree = compilation.SyntaxTrees[0]; 3608var tree = compilation.SyntaxTrees[0]; 3630var tree = compilation.SyntaxTrees[0]; 3666var tree = compilation.SyntaxTrees[0]; 3683var tree = compilation.SyntaxTrees[0]; 3708var tree = compilation.SyntaxTrees[0]; 3736var tree = compilation.SyntaxTrees.First(); 3748var tree2 = compilation.SyntaxTrees.ElementAt(1); 3787var tree = compilation.SyntaxTrees[0]; 3805var tree = compilation.SyntaxTrees[0]; 3824var tree = compilation.SyntaxTrees[0]; 3845var tree = compilation.SyntaxTrees[0]; 3865var tree = compilation.SyntaxTrees[0]; 3898var tree = Parse(sourceCode); 3919var tree = Parse(sourceCode); 3959var tree2 = SyntaxFactory.ParseSyntaxTree(@" 3996var tree = compilation.SyntaxTrees.Single(); 4085var tree = compilation.SyntaxTrees.Single(); 4124var tree = comp.SyntaxTrees.Single(); 4166var tree = compilation.SyntaxTrees.Single(); 4244var tree = compilation.SyntaxTrees.Single(); 4413var tree = compilation.SyntaxTrees[0]; 4437var tree = compilation.SyntaxTrees.Single(); 4468var tree = compilation.SyntaxTrees.Single(); 4499var tree = compilation.SyntaxTrees.Single(); 4533var tree = compilation.SyntaxTrees.Single(); 4570var tree = compilation.SyntaxTrees.Single(); 4602var tree = compilation.SyntaxTrees.Single(); 4651var tree = compilation.SyntaxTrees.Single(); 4690var tree = compilation.SyntaxTrees[0]; 4705var tree = compilation.SyntaxTrees[0]; 4720var tree = compilation.SyntaxTrees[0]; 4740var tree = compilation.SyntaxTrees.Single(); 4766var tree = compilation.SyntaxTrees.Single(); 4796var tree = compilation.SyntaxTrees[0]; 4819var tree = compilation.SyntaxTrees[0]; 4842var tree = compilation.SyntaxTrees[0]; 4865var tree = compilation.SyntaxTrees[0]; 4888var tree = compilation.SyntaxTrees[0]; 4911var tree = compilation.SyntaxTrees[0]; 4934var tree = compilation.SyntaxTrees[0]; 4957var tree = compilation.SyntaxTrees[0]; 4992var tree = compilation.SyntaxTrees[0]; 5038var tree = compilation.SyntaxTrees[0]; 5087var tree = compilation.SyntaxTrees[0]; 5110var tree = compilation.SyntaxTrees[0]; 5123var tree = compilation.SyntaxTrees[0]; 5170var tree = compilation.SyntaxTrees.Single(); 5203var tree = comp.SyntaxTrees.Single(); 5220var tree = comp.SyntaxTrees[0]; 5241var tree = comp.SyntaxTrees[0]; 5262var tree = comp.SyntaxTrees[0]; 5300var tree = comp.SyntaxTrees[0]; 5351var tree = comp.SyntaxTrees[0]; 5395var tree = comp.SyntaxTrees[0]; 5443var tree = comp.SyntaxTrees[0]; 5486var tree = comp.SyntaxTrees[0]; 5537var tree = comp.SyntaxTrees[0]; 5581var tree = comp.SyntaxTrees[0]; 5629var tree = comp.SyntaxTrees[0];
Compilation\SemanticModelGetSemanticInfoTests.cs (15)
1113var tree = compilation.SyntaxTrees.First(); 1662var tree = compilation.SyntaxTrees[0]; 8266var tree = compilation.SyntaxTrees.Single(); 8431var tree = compilation.SyntaxTrees.Single(); 8455var tree = compilation.SyntaxTrees.Single(); 12122var tree = Parse(sourceCode); 14483var tree = compilation.SyntaxTrees.First(); 14653var tree = comp.SyntaxTrees.Single(); 14736var tree = compilation.SyntaxTrees[i]; 14786SyntaxTree tree = compilation.SyntaxTrees.Single(); 14882SyntaxTree tree = compilation.SyntaxTrees.Single(); 14993SyntaxTree tree = compilation.SyntaxTrees.Single(); 15052var tree = compilation.SyntaxTrees.First(); 15371var tree = compilation.SyntaxTrees[0]; 15432var tree = compilation.SyntaxTrees[0];
Compilation\UsedAssembliesTests.cs (1)
135var tree = comp.SyntaxTrees.Single();
CrossLanguageTests.cs (1)
34var tree = Parse(text);
DeclarationTests.cs (50)
57var tree1 = SyntaxFactory.ParseSyntaxTree(text1); 58var tree2 = SyntaxFactory.ParseSyntaxTree(text2); 226var tree1 = SyntaxFactory.ParseSyntaxTree(text1); 227var tree2 = SyntaxFactory.ParseSyntaxTree(text2); 271var underlyingTree = SyntaxFactory.ParseSyntaxTree(@" 280var foreignType = SyntaxFactory.ParseSyntaxTree(@" 290var compilation = CreateCompilation(new SyntaxTree[] { underlyingTree, countedTree }, skipUsesIsNullable: true, options: TestOptions.ReleaseDll); 318var underlyingTree = SyntaxFactory.ParseSyntaxTree(@" 327var foreignType = SyntaxFactory.ParseSyntaxTree(@" 337var compilation = CreateCompilation(new SyntaxTree[] { underlyingTree, countedTree }, skipUsesIsNullable: true, options: TestOptions.ReleaseDll); 361var firstTree = SyntaxFactory.ParseSyntaxTree(@" 375var secondTree = SyntaxFactory.ParseSyntaxTree(@" 389var thirdTree = SyntaxFactory.ParseSyntaxTree(@" 404var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 428var firstTree = SyntaxFactory.ParseSyntaxTree(@" 442var secondTree = SyntaxFactory.ParseSyntaxTree(@" 457var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 474var firstTree = SyntaxFactory.ParseSyntaxTree(@" 488var secondTree = SyntaxFactory.ParseSyntaxTree(@" 500var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 517var firstTree = SyntaxFactory.ParseSyntaxTree(@" 536var secondTree = SyntaxFactory.ParseSyntaxTree(@" 553var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 577var firstTree = SyntaxFactory.ParseSyntaxTree(@" 596var secondTree = SyntaxFactory.ParseSyntaxTree(@" 608var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 631var firstTree = SyntaxFactory.ParseSyntaxTree(@" 645var secondTree = SyntaxFactory.ParseSyntaxTree(@" 657var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 674var firstTree = SyntaxFactory.ParseSyntaxTree(@" 688var secondTree = SyntaxFactory.ParseSyntaxTree(@" 700var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 717var firstTree = SyntaxFactory.ParseSyntaxTree(@" 733var secondTree = SyntaxFactory.ParseSyntaxTree(@" 747var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 764var firstTree = SyntaxFactory.ParseSyntaxTree(@" 780var secondTree = SyntaxFactory.ParseSyntaxTree(@" 792var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 809var firstTree = SyntaxFactory.ParseSyntaxTree(@" 823var secondTree = SyntaxFactory.ParseSyntaxTree(@" 837var compilation = CreateCompilation(new SyntaxTree[] { firstTree }); 854var firstTree = SyntaxFactory.ParseSyntaxTree(@" 869var compilation1 = CreateCompilation(new SyntaxTree[] { firstTree }); 870var compilation2 = CreateCompilation(new SyntaxTree[] { firstTree }); 898public override SyntaxTree SyntaxTree 931private readonly SyntaxTree _underlyingTree; 936public CountedSyntaxTree(SyntaxTree underlying) 1001public override SyntaxTree WithChangedText(SourceText newText) 1006public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 1011public override SyntaxTree WithFilePath(string path)
DocumentationComments\CrefTests.cs (23)
4417var tree1 = Parse(source1, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose).WithLanguageVersion(LanguageVersion.Latest)); 4418var tree2 = Parse(source2, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None).WithLanguageVersion(LanguageVersion.Latest)); 5122var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 5228SyntaxTree tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 5511var tree = compilation.SyntaxTrees.Single(); 5556var tree = compilation.SyntaxTrees.Single(); 5593var tree = compilation.SyntaxTrees.Single(); 5623var tree = compilation.SyntaxTrees.Single(); 5656var tree = compilation.SyntaxTrees.Single(); 5695var tree = compilation.SyntaxTrees.Single(); 5714var tree = compilation.SyntaxTrees.Single(); 5747var tree = compilation.SyntaxTrees.Single(); 5790var tree = compilation.SyntaxTrees.Single(); 6104var tree = compilation.SyntaxTrees.Single(); 6139var tree = compilation.SyntaxTrees.Single(); 6182var tree = compilation.SyntaxTrees.Single(); 6210var tree = compilation.SyntaxTrees.Single(); 6240var tree = compilation.SyntaxTrees.Single(); 6275var tree = compilation.SyntaxTrees[0]; 6325var tree = compilation.SyntaxTrees.First(); 6424var tree = comp.SyntaxTrees.Single(); 6462var tree = comp.SyntaxTrees.Single(); 6670var tree = compilation.SyntaxTrees[0];
DocumentationComments\DocumentationCommentCompilerTests.cs (58)
759var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 760var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 887var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 888var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 926var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularWithDocumentationComments); 968var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 969var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1017var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1018var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1068var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1069var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1118var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1119var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1173var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1174var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1221var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1222var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1276var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1277var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1333var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1334var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1396var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1397var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1459var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1460var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1512var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularWithDocumentationComments); 1555var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1556var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1606var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1607var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1650var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularWithDocumentationComments); 1693var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1694var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1745var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1746var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1796var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1797var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1852var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1853var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1901var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1902var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1957var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1958var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 2015var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 2016var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 2079var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 2080var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 2143var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 2144var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 3162var tree1 = Parse(source1, options: TestOptions.RegularWithDocumentationComments); 3163var tree2 = Parse(source2, options: TestOptions.RegularWithDocumentationComments); 3658var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 4520var tree = Parse(source, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 5318var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 5319var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 5758var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 6010SyntaxTree tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 7115var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments);
DocumentationComments\DocumentationCommentIDTests.cs (4)
29var tree = comp.SyntaxTrees.Single(); 142var tree = comp.SyntaxTrees.Single(); 163var tree = comp.SyntaxTrees.Single(); 307var tree = comp.SyntaxTrees.Single();
DocumentationComments\ParameterTests.cs (2)
740var tree = compilation.SyntaxTrees.Single(); 787var tree = compilation.SyntaxTrees.Single();
DocumentationComments\PartialTypeDocumentationCommentTests.cs (2)
23var tree1 = Parse( 37var tree2 = Parse(
SymbolDisplay\SymbolDisplayTests.cs (22)
3023var tree = SyntaxFactory.ParseSyntaxTree(text, TestOptions.Script); 3589var tree = comp.SyntaxTrees.First(); 5620var tree = comp.SyntaxTrees.Single(); 6060var tree = comp.SyntaxTrees.First(); 6597var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6640var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6671var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6735var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6766var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6829var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6862var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6907var srcTree = SyntaxFactory.ParseSyntaxTree(@" 7908var tree = compilation.SyntaxTrees[0]; 8001var tree = compilation.SyntaxTrees[0]; 8061var tree = compilation.SyntaxTrees[0]; 8093var tree = compilation.SyntaxTrees[0]; 8398var syntaxTree = semanticModel.SyntaxTree; 8449var syntaxTree = semanticModel.SyntaxTree; 8482var tree = comp.SyntaxTrees.Single(); 8873var tree = comp.SyntaxTrees[0]; 8929var tree = comp.SyntaxTrees[0]; 9022var tree = comp.SyntaxTrees.First();
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1004var syntaxTree = compilation.SyntaxTrees.Single();
Symbols\AnonymousTypesSemanticsTests.cs (2)
2034public SyntaxTree Tree; 2048var tree = compilation.SyntaxTrees[0];
Symbols\AnonymousTypesSymbolTests.cs (3)
1637var tree = SyntaxFactory.ParseSyntaxTree(source); 1678var tree = SyntaxFactory.ParseSyntaxTree(source); 1706private static readonly SyntaxTree s_equalityComparerSourceTree = Parse(@"
Symbols\AssemblyAndNamespaceTests.cs (8)
118syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text) }, references: new MetadataReference[] { }); 122syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1), SyntaxFactory.ParseSyntaxTree(text2) }, 165syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1), SyntaxFactory.ParseSyntaxTree(text2) }, 251var comp1 = CSharpCompilation.Create(assemblyName: "Test1", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1) }, references: new MetadataReference[] { }); 252var comp2 = CSharpCompilation.Create(assemblyName: "Test2", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text2) }, references: new MetadataReference[] { }); 258syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text3) }, 300syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1) }, 330var tree = compilation.SyntaxTrees[0];
Symbols\CheckedUserDefinedOperatorsTests.cs (5)
7207var tree = compilation1.SyntaxTrees.Single(); 7279var tree = compilation1.SyntaxTrees.Single(); 7350var tree = compilation1.SyntaxTrees.Single(); 7423var tree = compilation1.SyntaxTrees.Single(); 7487var tree = compilation1.SyntaxTrees.Single();
Symbols\CompilationCreationTests.cs (29)
28private static SyntaxTree CreateSyntaxTree(string className) 35private static void CheckCompilationSyntaxTrees(CSharpCompilation compilation, params SyntaxTree[] expectedSyntaxTrees) 37ImmutableArray<SyntaxTree> actualSyntaxTrees = compilation.SyntaxTrees; 2861var st = SyntaxFactory.ParseSyntaxTree("class C { static void Main() { new lib.Class1(); } }"); 2875var tree1 = CreateSyntaxTree("A"); 2876var tree2 = CreateSyntaxTree("B"); 2878SyntaxTree[] treeOrder1 = new[] { tree1, tree2 }; 2882SyntaxTree[] treeOrder2 = new[] { tree2, tree1 }; 2890var tree1 = CreateSyntaxTree("A"); 2891var tree2 = CreateSyntaxTree("B"); 2892var tree3 = CreateSyntaxTree("C"); 2893var tree4 = CreateSyntaxTree("D"); 2895SyntaxTree[] treeList1 = new[] { tree1, tree2 }; 2899SyntaxTree[] treeList2 = new[] { tree3, tree4 }; 2904SyntaxTree[] treeList3 = new[] { tree4, tree3 }; 2908SyntaxTree[] treeList4 = new[] { tree2, tree1 }; 2917var tree1 = CreateSyntaxTree("A"); 2918var tree2 = CreateSyntaxTree("B"); 2919var tree3 = CreateSyntaxTree("C"); 2920var tree4 = CreateSyntaxTree("D"); 2922SyntaxTree[] treeList1 = new[] { tree1, tree2, tree3, tree4 }; 2926SyntaxTree[] treeList2 = new[] { tree3, tree1 }; 2931SyntaxTree[] treeList3 = new[] { tree4, tree3, tree2, tree1 }; 2935SyntaxTree[] treeList4 = new[] { tree3, tree1 }; 2944var tree1 = CreateSyntaxTree("A"); 2945var tree2 = CreateSyntaxTree("B"); 2946var tree3 = CreateSyntaxTree("C"); 2948SyntaxTree[] treeList1 = new[] { tree1, tree2 }; 2956SyntaxTree[] treeList3 = new[] { tree2, tree1 };
Symbols\ConversionTests.cs (15)
385var tree = SyntaxFactory.ParseSyntaxTree(source); 451var tree = comp.SyntaxTrees.Single(); 482var tree = comp.SyntaxTrees.Single(); 517var tree = comp.SyntaxTrees.Single(); 553var tree = comp.SyntaxTrees.Single(); 589var tree = comp.SyntaxTrees.Single(); 623var tree = comp.SyntaxTrees.Single(); 658var tree = comp.SyntaxTrees.Single(); 683var tree = comp.SyntaxTrees.Single(); 714var tree = comp.SyntaxTrees.Single(); 740var tree = comp.SyntaxTrees.Single(); 763var tree = comp.SyntaxTrees.Single(); 2066var tree = comp.SyntaxTrees.Single(); 2136var tree = comp.SyntaxTrees.Single(); 2170var tree = comp.SyntaxTrees.Single();
Symbols\CorLibrary\CorTypes.cs (2)
293var tree = comp.SyntaxTrees.Single(); 358var tree = comp1.SyntaxTrees.Single();
Symbols\CovariantReturnTests.cs (2)
376foreach (var tree in comp.SyntaxTrees) 2619var vbTree = vbComp.SyntaxTrees[0];
Symbols\CustomModifiersTests.cs (1)
1525var compilation2 = CreateCompilationWithMscorlib461(new SyntaxTree[] { }, references: new[] { new CSharpCompilationReference(compilation1) });
Symbols\DestructorTests.cs (1)
404var tree = compilation.SyntaxTrees.Single();
Symbols\EnumTests.cs (1)
351var tree = comp.SyntaxTrees[0];
Symbols\ExtensionMethodTests.cs (11)
225var syntaxTree = compilation.SyntaxTrees.Single(); 2423var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6)); 2724var tree = compilation.SyntaxTrees[0]; 2950var tree = compilation.SyntaxTrees.Single(); 3008var tree = compilation.SyntaxTrees.Single(); 3136var tree = comp.SyntaxTrees[0]; 3775var syntaxTree = compilation.SyntaxTrees.Single(); 3863var tree = compilation.SyntaxTrees.Single(); 3910var tree = compilation.SyntaxTrees.Single(); 3955var tree = compilation.SyntaxTrees.Single(); 4005var tree = compilation.SyntaxTrees.Single();
Symbols\FunctionPointerTypeSymbolTests.cs (16)
49var syntaxTree = comp.SyntaxTrees[0]; 122var syntaxTree = comp.SyntaxTrees[0]; 202var syntaxTree = comp.SyntaxTrees[0]; 269var syntaxTree = comp.SyntaxTrees[0]; 337var syntaxTree = comp.SyntaxTrees[0]; 403var syntaxTree = comp.SyntaxTrees[0]; 483var syntaxTree = comp.SyntaxTrees[0]; 600var syntaxTree = comp.SyntaxTrees[0]; 682var syntaxTree = comp.SyntaxTrees[0]; 1145var syntaxTree = comp.SyntaxTrees[0]; 1256var syntaxTree = comp.SyntaxTrees[0]; 1313var syntaxTree = compilation.SyntaxTrees[0]; 1424var syntaxTree = comp.SyntaxTrees[0]; 1682var syntaxTree = comp.SyntaxTrees[0]; 1793var syntaxTree = comp.SyntaxTrees[0]; 1923var syntaxTree = comp.SyntaxTrees[0];
Symbols\GenericConstraintTests.cs (2)
7391var tree = comp.SyntaxTrees.Single(); 7416var tree = comp.SyntaxTrees.Single();
Symbols\ImplicitClassTests.cs (2)
70var tree = c.SyntaxTrees.Single(); 113var tree = comp.SyntaxTrees.Single();
Symbols\IndexerTests.cs (9)
1285var tree = Parse(source); 2230var tree = Parse(source); 2271var tree = Parse(source); 2313var tree = Parse(source); 2351var tree = Parse(source); 2529private static void CheckOverloadResolutionResults(SyntaxTree tree, SemanticModel model, params string[] expected) 2609var tree = Parse(source); 2696var tree = Parse(source); 2842var tree = comp2.SyntaxTrees[0];
Symbols\LocalFunctionTests.cs (4)
32var tree = compilation.SyntaxTrees[0]; 53var tree = compilation.SyntaxTrees[0]; 74var tree = compilation.SyntaxTrees[0]; 97var tree = compilation.SyntaxTrees[0];
Symbols\LookupSymbolsInfoTests.cs (1)
93var tree = compilation.SyntaxTrees.Single();
Symbols\Metadata\MetadataTypeTests.cs (3)
357var tree = SyntaxFactory.ParseSyntaxTree(String.Empty); 362var oldTree = comp.SyntaxTrees.First(); 368var newTree = oldTree.WithChangedText(newIText);
Symbols\Metadata\PE\NoPia.cs (7)
1129var tc1 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, pia5Link }); 1139var tc2 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, pia5Ref }); 1149var tc3 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref }); 1163var tc4 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Ref, pia1Ref }); 1179var tc5 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Link }); 1197var tc6 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref }); 1210var tc7 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Link, pia5Link, pia1Ref });
Symbols\Metadata\PE\TypeForwarders.cs (1)
94var compilation = CreateCompilationWithMscorlib40AndSystemCore(new SyntaxTree[0]);
Symbols\MethodEqualityTests.cs (1)
205var tree = comp.SyntaxTrees.Single();
Symbols\OverriddenOrHiddenMembersTests.cs (2)
73var tree = Parse(text); 160var tree = Parse(text);
Symbols\RelaxedShiftOperatorTests.cs (6)
100var tree = compilation1.SyntaxTrees.Single(); 144var tree = compilation1.SyntaxTrees.Single(); 188var tree = compilation1.SyntaxTrees.Single(); 232var tree = compilation1.SyntaxTrees.Single(); 276var tree = compilation1.SyntaxTrees.Single(); 320var tree = compilation1.SyntaxTrees.Single();
Symbols\RequiredMembersTests.cs (1)
7645var tree = comp.SyntaxTrees[0];
Symbols\Source\AccessTests.cs (7)
27var tree = Parse(text); 44var tree = Parse(text); 70var tree = Parse(text); 93var tree = Parse(text); 122var tree = Parse(text); 144var tree = Parse(text); 167var tree = Parse(text);
Symbols\Source\BaseClassTests.cs (5)
269var tree = comp.SyntaxTrees.First(); 306var tree = comp.SyntaxTrees.First(); 1408var tree = Parse(text); 1424var tree = Parse(text); 2029var tree = comp.SyntaxTrees[0];
Symbols\Source\ClsComplianceTests.cs (3)
3461var tree = comp.SyntaxTrees.Single(); 3497var tree1 = SyntaxFactory.ParseSyntaxTree(string.Format(sourceTemplate, 1), parseOptions, path: "a.cs"); 3498var tree2 = SyntaxFactory.ParseSyntaxTree(string.Format(sourceTemplate, 2), parseOptions, path: "b.cs");
Symbols\Source\DeclaringSyntaxNodeTests.cs (15)
43SyntaxTree tree = node.SyntaxTree; 134private void CheckDeclaringSyntax<TNode>(CSharpCompilation comp, SyntaxTree tree, string name, SymbolKind kind) 149private void CheckLambdaDeclaringSyntax<TNode>(CSharpCompilation comp, SyntaxTree tree, string textToSearchFor) 257var tree = Parse(text); 300var tree = Parse(text); 602var tree = Parse(text); 637var tree = Parse(text); 662var tree = Parse(text); 688var tree = Parse(text); 717var tree = Parse(text); 732var source0 = Parse("namespace N { partial class C { } } namespace N0 { } class C0 { }"); 733var source1 = Parse("namespace N { partial class C { } } namespace N1 { } class C1 { }"); 734var source2 = Parse("namespace N { struct S { } }"); 735var source3 = Parse("namespace N { partial class C { } } namespace N3 { } class C3 { }"); 745var source4 = Parse("namespace N { partial class C { } } namespace N4 { } class C4 { }");
Symbols\Source\DelegateTests.cs (4)
734var syntaxTree = comp.SyntaxTrees.Single(); 761var syntaxTree = comp.SyntaxTrees.Single(); 822var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular); 823var compilation = CreateCompilationWithMscorlib461(new SyntaxTree[] { tree }).VerifyDiagnostics();
Symbols\Source\EnumTests.cs (1)
955var tree = compilation.SyntaxTrees[0];
Symbols\Source\EventTests.cs (2)
432var tree = compilation.SyntaxTrees.First(); 478var tree = compilation.SyntaxTrees.First();
Symbols\Source\ExternAliasTests.cs (2)
349var tree = Parse(text); 475var tree = comp.SyntaxTrees.Single();
Symbols\Source\FileModifierTests.cs (31)
832var testSource1 = CSharpTestSource.Parse(source, Path.Combine(root1, "code.cs")); 833var testSource2 = CSharpTestSource.Parse(source, Path.Combine(root2, "code.cs")); 865var source1 = SyntaxFactory.ParseSyntaxTree(""" 875var source2 = SyntaxFactory.ParseSyntaxTree("", options: TestOptions.RegularPreview, path: path, encoding: Encoding.Default); 900var source1 = SyntaxFactory.ParseSyntaxTree(""" 910var source2 = SyntaxFactory.ParseSyntaxTree(""" 947var source1 = SyntaxFactory.ParseSyntaxTree(""" 957var source2 = SyntaxFactory.ParseSyntaxTree("", options: TestOptions.RegularPreview, path: path, encoding: Encoding.Default); 981var source1 = SyntaxFactory.ParseSyntaxTree(""" 991var source2 = SyntaxFactory.ParseSyntaxTree("", options: TestOptions.RegularPreview, path: "path/to/File.cs", encoding: Encoding.Default); 1212var tree = comp.SyntaxTrees[0]; 1365var tree = comp.SyntaxTrees[2]; 1431var tree = comp.SyntaxTrees[1]; 1489var tree = comp.SyntaxTrees[1]; 1787var tree = comp.SyntaxTrees[0]; 1861var tree = comp.SyntaxTrees[0]; 2594var tree = comp.SyntaxTrees[1]; 2634var tree = comp.SyntaxTrees[1]; 3503var tree = comp.SyntaxTrees[0]; 3554var tree = comp.SyntaxTrees[0]; 3610var tree = compilation.SyntaxTrees[1]; 3640var tree = compilation.SyntaxTrees[0]; 3710var tree = compilation.SyntaxTrees[1]; 3772var tree = compilation.SyntaxTrees[0]; 3813var tree = compilation.SyntaxTrees[1]; 3976var tree = comp.SyntaxTrees[0]; 4121var tree = comp.SyntaxTrees[0]; 4408var tree = comp.SyntaxTrees[0]; 4452var tree = comp.SyntaxTrees[0]; 4475var tree = comp.SyntaxTrees[0]; 4584var tree = SyntaxFactory.ParseSyntaxTree("""
Symbols\Source\LocalTests.cs (1)
58var tree = compilation.SyntaxTrees[0];
Symbols\Source\MethodTests.cs (4)
235var tree = comp.SyntaxTrees.Single(); 263var tree = comp.SyntaxTrees.Single(); 2537var syntax = comp.SyntaxTrees[0]; 2568var syntax = comp.SyntaxTrees[0];
Symbols\Source\NullablePublicAPITests.cs (105)
51var syntaxTree = comp.SyntaxTrees[0]; 85var syntaxTree = comp.SyntaxTrees[0]; 568var syntaxTree = comp.SyntaxTrees[0]; 943var syntaxTree = comp.SyntaxTrees[0]; 1000var syntaxTree = comp.SyntaxTrees[0]; 1092var syntaxTree = comp.SyntaxTrees[0]; 1119var syntaxTree = comp.SyntaxTrees[0]; 1207var syntaxTree = comp.SyntaxTrees.First(); 1259var syntaxTree = comp.SyntaxTrees[0]; 1357var syntaxTree = comp.SyntaxTrees[0]; 1437var syntaxTree = comp.SyntaxTrees[0]; 1509var syntaxTree = comp.SyntaxTrees[0]; 1565var syntaxTree = comp.SyntaxTrees[0]; 1622var syntaxTree = comp.SyntaxTrees[0]; 1665var syntaxTree = comp.SyntaxTrees[0]; 1708var syntaxTree = comp.SyntaxTrees[0]; 1847var syntaxTree = comp.SyntaxTrees[0]; 1890var syntaxTree = comp.SyntaxTrees[0]; 1935var syntaxTree = comp.SyntaxTrees[0]; 1982var syntaxTree = comp.SyntaxTrees[0]; 2043var syntaxTree = comp.SyntaxTrees[0]; 2086var syntaxTree = comp.SyntaxTrees[0]; 2129var syntaxTree = comp.SyntaxTrees[0]; 2172var syntaxTree = comp.SyntaxTrees[0]; 2214var syntaxTree = comp.SyntaxTrees[0]; 2244var syntaxTree = comp.SyntaxTrees[0]; 2279var syntaxTree = comp.SyntaxTrees[0]; 2323var syntaxTree = comp.SyntaxTrees[0]; 2364var syntaxTree = comp.SyntaxTrees[0]; 2409var syntaxTree = comp.SyntaxTrees[0]; 2449var syntaxTree = comp.SyntaxTrees[0]; 2497var syntaxTree = comp.SyntaxTrees[0]; 2542var syntaxTree = comp.SyntaxTrees[0]; 2591var syntaxTree = comp.SyntaxTrees[0]; 2625var syntaxTree = comp.SyntaxTrees[0]; 2659var syntaxTree = comp.SyntaxTrees[0]; 2697var syntaxTree = comp.SyntaxTrees[0]; 2733var syntaxTree = comp.SyntaxTrees[0]; 2779var syntaxTree = comp.SyntaxTrees[0]; 2822var syntaxTree = comp.SyntaxTrees[0]; 2871var syntaxTree = comp.SyntaxTrees[0]; 2912var syntaxTree = comp.SyntaxTrees[0]; 2953var syntaxTree = comp.SyntaxTrees[0]; 2995var syntaxTree = comp.SyntaxTrees[0]; 3037var syntaxTree = comp.SyntaxTrees[0]; 3097var syntaxTree = comp.SyntaxTrees[0]; 3144var syntaxTree = comp.SyntaxTrees[0]; 3189var syntaxTree = comp.SyntaxTrees[0]; 3254var syntaxTree = comp.SyntaxTrees[0]; 3306var syntaxTree = comp.SyntaxTrees[0]; 3355var syntaxTree = comp.SyntaxTrees[0]; 3402var syntaxTree = comp.SyntaxTrees[0]; 3447var syntaxTree = comp.SyntaxTrees[0]; 3484var syntaxTree = comp.SyntaxTrees[0]; 3533var syntaxTree = comp.SyntaxTrees[0]; 3594var syntaxTree = comp.SyntaxTrees[0]; 3657var syntaxTree = comp.SyntaxTrees[0]; 3695var tree = comp.SyntaxTrees[0]; 3730var tree = comp.SyntaxTrees[0]; 3765var syntaxTree = comp.SyntaxTrees[0]; 3804var syntaxTree = comp.SyntaxTrees[0]; 3850var syntaxTree = comp.SyntaxTrees[0]; 3909var syntaxTree = comp.SyntaxTrees[0]; 3974var syntaxTree = comp.SyntaxTrees[0]; 4043var syntaxTree = comp.SyntaxTrees[0]; 4110var syntaxTree = comp.SyntaxTrees[0]; 4173var syntaxTree = comp.SyntaxTrees[0]; 4207var syntaxTree = comp.SyntaxTrees[0]; 4240var syntaxTree = comp.SyntaxTrees[0]; 4268var syntaxTree = comp.SyntaxTrees[0]; 4302var syntaxTree = comp.SyntaxTrees[0]; 4333var tree = comp.SyntaxTrees[0]; 4363var tree = comp.SyntaxTrees[0]; 4391var tree = comp.SyntaxTrees[0]; 4419var tree = comp.SyntaxTrees[0]; 4449var tree = comp.SyntaxTrees[0]; 4479var tree = comp.SyntaxTrees[0]; 4509var tree = comp.SyntaxTrees[0]; 4541var tree = comp.SyntaxTrees[0]; 4574var tree = comp.SyntaxTrees[0]; 4602var tree = comp.SyntaxTrees[0]; 4635var tree = comp.SyntaxTrees[0]; 4666var tree = comp.SyntaxTrees[0]; 4697var tree = comp.SyntaxTrees[0]; 4727var tree = comp.SyntaxTrees[0]; 4778var syntaxTree = comp.SyntaxTrees[0]; 4813var tree = comp.SyntaxTrees.Single(); 4899var tree = comp.SyntaxTrees.Single(); 4932var tree = comp.SyntaxTrees[0]; 4964var tree = comp.SyntaxTrees[0]; 5007var tree = comp.SyntaxTrees[0]; 5046var tree = comp.SyntaxTrees[0]; 5064SyntaxTree tree = comp.SyntaxTrees[0]; 5100var tree = comp.SyntaxTrees.Single(); 5132var tree = comp.SyntaxTrees.Single(); 5160var tree = comp.SyntaxTrees.Single(); 5195var tree = comp.SyntaxTrees.Single(); 5230var tree = comp.SyntaxTrees.Single(); 5251var tree = comp.SyntaxTrees[0]; 5274var tree = comp.SyntaxTrees[0]; 5306var tree = comp.SyntaxTrees[0]; 5329var tree = comp.SyntaxTrees[0]; 5351var tree = comp.SyntaxTrees[0]; 5396var tree = comp.SyntaxTrees[0]; 5453var tree = comp.SyntaxTrees[0];
Symbols\Source\TypeMapTests.cs (1)
110var tree = Parse(text);
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (1)
33var syntaxTree = comp.SyntaxTrees[0];
Symbols\Source\UsingAliasTests.cs (24)
30var tree = Parse(text); 87var tree = Parse(text); 147var tree = Parse(text); 202var tree = Parse(text); 267var tree = Parse(text); 294var tree = Parse(text); 340var tree = Parse(text); 381var tree = Parse(text); 402var tree = Parse(text); 421var tree = Parse(text); 440var tree = Parse(text); 459var tree = Parse(text); 478var tree = Parse(text); 499var tree = Parse(text); 521SyntaxTree syntaxTree = Parse(text); 542SyntaxTree syntaxTree = Parse(text); 562SyntaxTree syntaxTree = Parse(text); 581SyntaxTree syntaxTree = Parse(text); 601SyntaxTree syntaxTree = Parse(text); 625SyntaxTree syntaxTree = Parse(text); 648SyntaxTree syntaxTree = Parse(text); 665SyntaxTree syntaxTree = Parse(text); 695var tree = compilation.SyntaxTrees.Single(); 738var tree = compilation.SyntaxTrees.Single();
Symbols\StaticAbstractMembersInInterfacesTests.cs (26)
8451var tree = compilation1.SyntaxTrees.Single(); 9039var tree = compilation1.SyntaxTrees.Single(); 9354var tree = compilation1.SyntaxTrees.Single(); 9753var tree = compilation1.SyntaxTrees.Single(); 10750var tree = compilation1.SyntaxTrees.Single(); 10943var tree = compilation1.SyntaxTrees.Single(); 11133var tree = compilation1.SyntaxTrees.Single(); 11327var tree = compilation1.SyntaxTrees.Single(); 11581var tree = compilation1.SyntaxTrees.Single(); 11958var tree = compilation1.SyntaxTrees.Single(); 12137var tree = compilation1.SyntaxTrees.Single(); 13178var tree = compilation1.SyntaxTrees.Single(); 13264var tree = compilation1.SyntaxTrees.Single(); 13386var tree = compilation1.SyntaxTrees.Single(); 14087var tree = compilation1.SyntaxTrees.Single(); 14712var tree = compilation1.SyntaxTrees.Single(); 15118var tree = compilation1.SyntaxTrees.Single(); 15386var tree = compilation1.SyntaxTrees.Single(); 19558var tree = compilation1.SyntaxTrees.Single(); 19641var tree = compilation1.SyntaxTrees.Single(); 19733var tree = compilation1.SyntaxTrees.Single(); 19822var tree = compilation1.SyntaxTrees.Single(); 28771var tree = compilation1.SyntaxTrees.Single(); 30278var tree = compilation1.SyntaxTrees.Single(); 30469var tree = compilation1.SyntaxTrees.Single(); 30935var tree = compilation1.SyntaxTrees.Single();
Symbols\SymbolDistinguisherTests.cs (9)
31var tree = Parse(source, "file.cs"); 95var tree = Parse(source, "file.cs"); 115var tree = Parse(source, "file.cs"); 135var tree = Parse(source, @"a\..\file.cs"); 180var tree = Parse(source, "file.cs"); 206var tree = Parse(source, "file.cs"); 231var tree = Parse(source, "file.cs"); 256var tree = Parse(source, "file.cs"); 278var tree = Parse(source, "file.cs");
Symbols\SymbolEqualityTests.cs (18)
38var tree = comp.SyntaxTrees[0]; 81var tree = comp.SyntaxTrees[0]; 121var tree = comp.SyntaxTrees[0]; 162var tree = comp.SyntaxTrees[0]; 409var syntaxTree = comp.SyntaxTrees[0]; 447var syntaxTree = comp.SyntaxTrees[0]; 478var syntaxTree = comp.SyntaxTrees[0]; 521var syntaxTree = comp.SyntaxTrees[0]; 552var syntaxTree = comp.SyntaxTrees[0]; 588var syntaxTree = comp.SyntaxTrees[0]; 622var syntaxTree = comp.SyntaxTrees[0]; 671var syntaxTree = comp.SyntaxTrees[0]; 723var syntaxTree = comp.SyntaxTrees[0]; 773var syntaxTree = comp.SyntaxTrees[0]; 824var syntaxTree = comp.SyntaxTrees[0]; 885var syntaxTree = comp.SyntaxTrees[0]; 932var syntaxTree = comp.SyntaxTrees[0]; 959var syntaxTree = comp.SyntaxTrees[0];
Symbols\SymbolErrorTests.cs (6)
2114var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5516comp = CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }, new List<MetadataReference> { ref1 }); 17740var tree = Parse(sourceLib, filename: @"C:\lib.cs"); 17821var tree = Parse(sourceLib, filename: @"C:\lib.cs"); 17856CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }).VerifyDiagnostics( 17886CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }).VerifyDiagnostics(
Symbols\SymbolExtensionTests.cs (5)
100var tree = compilation.SyntaxTrees.Single(); 118var tree = compilation.SyntaxTrees.Single(); 136var tree = compilation.SyntaxTrees.Single(); 155var tree = compilation.SyntaxTrees.Single(); 250var tree = compilation.SyntaxTrees.Single();
Symbols\TypeTests.cs (8)
901var tree = SyntaxFactory.ParseSyntaxTree(text); 1138var tree = Parse(text); 1152var tree = Parse(text); 1177var tree = Parse(text); 1196var tree = Parse(text); 1675var tree = SyntaxFactory.ParseSyntaxTree(text); 1759var tree = SyntaxFactory.ParseSyntaxTree(text); 1851var tree = compilation.SyntaxTrees.Single();
Symbols\UnsignedRightShiftTests.cs (9)
121var tree = compilation1.SyntaxTrees.Single(); 624var tree = compilation1.SyntaxTrees.Single(); 1174var tree = compilation1.SyntaxTrees.Single(); 1582var tree = compilation1.SyntaxTrees.Single(); 1981var tree = compilation1.SyntaxTrees.Single(); 2233var tree = compilation1.SyntaxTrees.Single(); 2375var tree = compilation1.SyntaxTrees.Single(); 2509var tree = compilation1.SyntaxTrees.Single(); 2606var tree = compilation1.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1245)
Diagnostics\DiagnosticTest.cs (7)
68SyntaxTree syntaxTree = new MockCSharpSyntaxTree(); 96SyntaxTree syntaxTree = new MockCSharpSyntaxTree(); 2356SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, path: "goo.cs"); 2385SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, path: "goo.cs"); 2403SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, path: "goo.cs"); 2407private TextSpan GetSpanIn(SyntaxTree syntaxTree, string textToFind) 2483var tree = Parse(text);
Diagnostics\LineSpanDirectiveTests.cs (13)
41var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "b.cs"); 87var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "b.cs"); 134var tree = SyntaxFactory.ParseSyntaxTree(source); 183var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "b.cs"); 233var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "page.razor.g.cs"); 301var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "page.razor.g.cs"); 353var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "page.razor.g.cs"); 411var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "a.razor.g.cs"); 440private static ImmutableArray<SyntaxNode> GetStatementsAndExpressionBodies(SyntaxTree tree) 461private static ImmutableArray<string> GetLineMappings(SyntaxTree tree) 471private static (string, string) GetTextMapping(SourceText mappedText, SyntaxTree unmappedText, SyntaxNode syntax) 484static string getMapping(SourceText mappedText, SyntaxTree unmappedText, SyntaxNode syntax) 571var tree = comp.SyntaxTrees[0];
Diagnostics\LocationsTests.cs (21)
36SyntaxTree syntaxTree, 66private TextSpan GetSpanIn(SyntaxTree syntaxTree, string textToFind) 74private static IEnumerable<string> InspectLineMapping(SyntaxTree tree) 87SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 144SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "goo.cs"); 182SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 214SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "filename.cs"); 235SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 251var syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 265var syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 285var syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 309SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 372SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 394SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 410SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram); 427SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram); 428SyntaxTree tree2 = SyntaxFactory.ParseSyntaxTree(sampleProgram); 454SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 488SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram); 559var tree = SyntaxFactory.SyntaxTree(nodeWithBadError); 587var tree = SyntaxFactory.SyntaxTree(nodeWithBadError);
IncrementalParsing\BinaryExpression.cs (6)
29var oldTree = SyntaxFactory.ParseSyntaxTree(text); 30var newTree = oldTree.WithReplaceFirst("+", "*"); 197var oldTree = SyntaxFactory.ParseSyntaxTree(topLevel ? topLevelStatement : code, options: options); 200var newTree = oldTree.WithReplaceFirst(oldName, newName); 205private static ExpressionSyntax GetExpressionNode(SyntaxTree newTree) 214private static ExpressionSyntax GetGlobalExpressionNode(SyntaxTree newTree)
IncrementalParsing\ChangingAsync.cs (5)
30var newTree = oldTree.WithInsertBefore("public", "async "); 51var newTree = oldTree.WithRemoveFirst("async"); 59private static void ParseAndVerify(string text, Action<SyntaxTree> validator) 65private static void ParseAndValidate(string text, Action<SyntaxTree> validator, CSharpParseOptions options = null) 67var oldTree = SyntaxFactory.ParseSyntaxTree(text);
IncrementalParsing\ChangingIdentifiers.cs (4)
264var oldTree = SyntaxFactory.ParseSyntaxTree(code, options: options); 267var newTree = oldTree.WithReplaceFirst(oldName, newName); 272private static ExpressionSyntax GetExpressionSyntaxChange(SyntaxTree newTree) 280private static ExpressionSyntax GetGlobalMethodDeclarationSyntaxChange(SyntaxTree newTree)
IncrementalParsing\CompoundAssignment.cs (4)
103var oldTree = SyntaxFactory.ParseSyntaxTree(topLevel ? topLevelStatement : code, options: options); 106var newTree = oldTree.WithReplaceFirst(oldName, newName); 144private static AssignmentExpressionSyntax GetExpressionSyntaxChange(SyntaxTree newTree) 154private static AssignmentExpressionSyntax GetGlobalStatementSyntaxChange(SyntaxTree newTree)
IncrementalParsing\GrammarAmbiguities.cs (3)
90var originalTree = SyntaxFactory.ParseSyntaxTree(code); 93var incrementalTree = originalTree.WithReplace(start, length, replacement); 101private void VerifyIdenticalStructure(SyntaxTree syntaxTree)
IncrementalParsing\IncrementalParsingTests.cs (262)
26private SyntaxTree Parse(string text, params string[] defines) 33private SyntaxTree Parse(string text, LanguageVersion languageVersion) 40private SyntaxTree Parse6(string text) 43private SyntaxTree ParsePreview(string text) 436var oldTree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 437var newTree = oldTree.WithInsertAt(0, "{ "); 460var oldTree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 461var newTree = oldTree.WithRemoveAt(0, 1); 490var tree = SyntaxFactory.ParseSyntaxTree(source); 500var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 522var tree = SyntaxFactory.ParseSyntaxTree(source); 532var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 562var tree = SyntaxFactory.ParseSyntaxTree(source); 579var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 613var initialTree = SyntaxFactory.ParseSyntaxTree(initialSource); 628var withOpenBraceDeletedTree = initialTree.WithChangedText(withOpenBraceDeletedText); 839var withCloseBraceDeletedTree = withOpenBraceDeletedTree.WithChangedText(withCloseBraceDeletedText); 843var fullTree = SyntaxFactory.ParseSyntaxTree(withCloseBraceDeletedText.ToString()); 913var startTree = SyntaxFactory.ParseSyntaxTree(text); 914var newTree = startTree.WithInsertAt(1, "/"); 962var startTree = SyntaxFactory.ParseSyntaxTree(text); 966var newTree = startTree.WithChangedText(newText); 976var startTree = SyntaxFactory.ParseSyntaxTree(text); 980var newTree = startTree.WithChangedText(newText); 994SyntaxTree incrementalTree, parsedTree; 1012SyntaxTree incrementalTree, parsedTree; 1029SyntaxTree incrementalTree, parsedTree; 1045SyntaxTree incrementalTree, parsedTree; 1058SyntaxTree incrementalTree, parsedTree; 1074SyntaxTree incrementalTree, parsedTree; 1086SyntaxTree incrementalTree, parsedTree; 1098SyntaxTree incrementalTree, parsedTree; 1114SyntaxTree incrementalTree, parsedTree; 1127SyntaxTree incrementalTree, parsedTree; 1142SyntaxTree incrementalTree, parsedTree; 1154SyntaxTree incrementalTree, parsedTree; 1168SyntaxTree incrementalTree, parsedTree; 1183SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(startingText); 1204SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(startingText); 1223SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(startingText); 1247SyntaxTree incrementalTree; 1248SyntaxTree parsedTree; 1270SyntaxTree incrementalTree; 1271SyntaxTree parsedTree; 1294SyntaxTree incrementalTree; 1295SyntaxTree parsedTree; 1318SyntaxTree incrementalTree; 1319SyntaxTree parsedTree; 1342SyntaxTree incrementalTree; 1343SyntaxTree parsedTree; 1365SyntaxTree incrementalTree; 1366SyntaxTree parsedTree; 1389SyntaxTree incrementalTree; 1390SyntaxTree parsedTree; 1411SyntaxTree incrementalTree; 1412SyntaxTree parsedTree; 1429SyntaxTree oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 1432SyntaxTree newTree = oldTree.WithInsertAt(locationOfInsert, ";"); 1444var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 1445var newTree = oldTree.WithInsertAt(oldText.IndexOf('@'), ";"); 1458SyntaxTree origTree = SyntaxFactory.ParseSyntaxTree(oldText); 1461SyntaxTree incrTree = origTree.WithInsertAt(0, diffText); 1466SyntaxTree fullTree = SyntaxFactory.ParseSyntaxTree(newText); 1516SyntaxTree incrementalTree; 1517SyntaxTree parsedTree; 1533SyntaxTree incrementalTree; 1534SyntaxTree parsedTree; 1553SyntaxTree incrementalTree; 1554SyntaxTree parsedTree; 1573SyntaxTree incrementalTree; 1574SyntaxTree parsedTree; 1576var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 1596SyntaxTree incrementalTree; 1597SyntaxTree parsedTree; 1618CommentOutText(oldText, locationOfChange, widthOfChange, out SyntaxTree incrementalTree, out SyntaxTree parsedTree); 1636SyntaxTree incrementalTree; 1637SyntaxTree parsedTree; 1657SyntaxTree incrementalTree; 1658SyntaxTree parsedTree; 1689SyntaxTree incrementalTree; 1690SyntaxTree parsedTree; 1714SyntaxTree incrementalTree; 1715SyntaxTree parsedTree; 1732SyntaxTree incrementalTree; 1733SyntaxTree parsedTree; 1787SyntaxTree incrementalTree; 1788SyntaxTree parsedTree; 1813SyntaxTree incrementalTree; 1814SyntaxTree parsedTree; 1834SyntaxTree incrementalTree; 1835SyntaxTree parsedTree; 1855SyntaxTree incrementalTree; 1856SyntaxTree parsedTree; 1874SyntaxTree incrementalTree; 1875SyntaxTree parsedTree; 1899SyntaxTree incrementalTree; 1900SyntaxTree parsedTree; 1919SyntaxTree incrementalTree; 1920SyntaxTree parsedTree; 1937SyntaxTree incrementalTree; 1938SyntaxTree parsedTree; 1958SyntaxTree incrementalTree; 1959SyntaxTree parsedTree; 1979SyntaxTree incrementalTree; 1980SyntaxTree parsedTree; 1982var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 1998SyntaxTree incrementalTree; 1999SyntaxTree parsedTree; 2015SyntaxTree incrementalTree; 2016SyntaxTree parsedTree; 2033SyntaxTree incrementalTree; 2034SyntaxTree parsedTree; 2055SyntaxTree incrementalTree; 2056SyntaxTree parsedTree; 2086SyntaxTree incrementalTree; 2087SyntaxTree parsedTree; 2114SyntaxTree incrementalTree; 2115SyntaxTree parsedTree; 2132SyntaxTree incrementalTree; 2133SyntaxTree parsedTree; 2150SyntaxTree incrementalTree; 2151SyntaxTree parsedTree; 2170SyntaxTree incrementalTree; 2171SyntaxTree parsedTree; 2200SyntaxTree incrementalTree; 2201SyntaxTree parsedTree; 2225SyntaxTree incrementalTree; 2226SyntaxTree parsedTree; 2244SyntaxTree incrementalTree; 2245SyntaxTree parsedTree; 2262SyntaxTree incrementalTree; 2263SyntaxTree parsedTree; 2281SyntaxTree incrementalTree; 2282SyntaxTree parsedTree; 2300SyntaxTree incrementalTree; 2301SyntaxTree parsedTree; 2321SyntaxTree incrementalTree; 2322SyntaxTree parsedTree; 2340SyntaxTree incrementalTree; 2341SyntaxTree parsedTree; 2364SyntaxTree incrementalTree; 2365SyntaxTree parsedTree; 2392SyntaxTree incrementalTree; 2393SyntaxTree parsedTree; 2414SyntaxTree incrementalTree; 2415SyntaxTree parsedTree; 2436SyntaxTree incrementalTree; 2437SyntaxTree parsedTree; 2465SyntaxTree incrementalTree; 2466SyntaxTree parsedTree; 2498SyntaxTree incrementalTree; 2499SyntaxTree parsedTree; 2524SyntaxTree incrementalTree; 2525SyntaxTree parsedTree; 2549SyntaxTree incrementalTree; 2550SyntaxTree parsedTree; 2578SyntaxTree incrementalTree; 2579SyntaxTree parsedTree; 2605SyntaxTree incrementalTree; 2606SyntaxTree parsedTree; 2629SyntaxTree incrementalTree; 2630SyntaxTree parsedTree; 2664SyntaxTree incrementalTree; 2665SyntaxTree parsedTree; 2692SyntaxTree incrementalTree; 2693SyntaxTree parsedTree; 2715SyntaxTree incrementalTree; 2716SyntaxTree parsedTree; 2745var tree = SyntaxFactory.ParseSyntaxTree(text); 2752var parsedTree = SyntaxFactory.ParseSyntaxTree(text2); 2753var reparsedTree = tree.WithChangedText(text2); 2766var startTree = SyntaxFactory.ParseSyntaxTree(oldText); 2771var reparsedTree = startTree.WithChangedText(newText); 2772var parsedTree = SyntaxFactory.ParseSyntaxTree(newText); 2782var startTree = SyntaxFactory.ParseSyntaxTree(oldText, options: TestOptions.Script); 2794var reparsedTree = startTree.WithChangedText(newText); 2795var parsedTree = SyntaxFactory.ParseSyntaxTree(newText, options: TestOptions.Script); 2811var startTree = SyntaxFactory.ParseSyntaxTree(oldText, options: TestOptions.Script); 2824var reparsedTree = startTree.WithChangedText(newText); 2826var parsedTree = SyntaxFactory.ParseSyntaxTree(newText, options: TestOptions.Script); 2841var startTree = SyntaxFactory.ParseSyntaxTree(oldText, options: TestOptions.Script); 2852var reparsedTree = startTree.WithChangedText(newText); 2853var parsedTree = SyntaxFactory.ParseSyntaxTree(newText, options: TestOptions.Script); 2898var oldTree = comp.SyntaxTrees.First(); 2904var newTree = oldTree.WithChangedText(newIText); 2906var fullTree = SyntaxFactory.ParseSyntaxTree(newIText.ToString(), options: newTree.Options); 2976var currTree = SyntaxFactory.ParseSyntaxTree(text); 2990var fullTree = SyntaxFactory.ParseSyntaxTree(currIText.ToString()); 3016var currTree = SyntaxFactory.ParseSyntaxTree(text); 3026var fullTree = SyntaxFactory.ParseSyntaxTree(currIText.ToString()); 3039Func<SyntaxTree, GreenNode> extractGreenClassC = tree => 3044var oldTree = SyntaxFactory.ParseSyntaxTree(text); 3045var newTree = oldTree.WithInsertAt(text.Length, " "); 3053var tempTree = SyntaxFactory.ParseSyntaxTree(text); 3060var oldTree = SyntaxFactory.SyntaxTree(oldRoot, options: tempTree.Options, path: tempTree.FilePath); 3061var newTree = oldTree.WithInsertAt(text.Length, " "); 3098var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); // f is a simple lambda parameter 3103var incrTree = oldTree.WithChangedText(newText); 3104var fullTree = SyntaxFactory.ParseSyntaxTree(newText); 3181var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 3182var newTree = oldTree.WithChangedText(newText); 3196var tree = SyntaxFactory.ParseSyntaxTree(source); 3202var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3217var tree = SyntaxFactory.ParseSyntaxTree(src); 3223var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3238var tree = SyntaxFactory.ParseSyntaxTree(source); 3244var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3259var tree = SyntaxFactory.ParseSyntaxTree(source); 3265var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3280var tree = SyntaxFactory.ParseSyntaxTree(source); 3286var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3301var tree = SyntaxFactory.ParseSyntaxTree(source); 3308var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3325var tree = SyntaxFactory.ParseSyntaxTree(source); 3332var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3349var tree = SyntaxFactory.ParseSyntaxTree(source); 3356var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3373var tree = SyntaxFactory.ParseSyntaxTree(source); 3380var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3397var tree = SyntaxFactory.ParseSyntaxTree(source); 3404var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3421var tree = SyntaxFactory.ParseSyntaxTree(source); 3428var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3447var tree = SyntaxFactory.ParseSyntaxTree(source); 3454var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3473var tree = SyntaxFactory.ParseSyntaxTree(source); 3479var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3498var tree = SyntaxFactory.ParseSyntaxTree(source); 3505var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3524var tree = SyntaxFactory.ParseSyntaxTree(source); 3531var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3542var tree = SyntaxFactory.ParseSyntaxTree(source); 3549var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3560var tree = SyntaxFactory.ParseSyntaxTree(source); 3567var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3578var tree = SyntaxFactory.ParseSyntaxTree(source); 3585var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3593var tree = SyntaxFactory.ParseSyntaxTree(source); 3599var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3607var tree = SyntaxFactory.ParseSyntaxTree(source); 3613var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3621var tree = SyntaxFactory.ParseSyntaxTree(source); 3628var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3659var tree = SyntaxFactory.ParseSyntaxTree(source); 3665var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3680var tree = SyntaxFactory.ParseSyntaxTree(source); 3702var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3724private static void CommentOutText(SourceText oldText, int locationOfChange, int widthOfChange, out SyntaxTree incrementalTree, out SyntaxTree parsedTree) 3731var tree = SyntaxFactory.ParseSyntaxTree(oldText); 3736private static void RemoveText(SourceText oldText, int locationOfChange, int widthOfChange, out SyntaxTree incrementalTree, out SyntaxTree parsedTree) 3739var tree = SyntaxFactory.ParseSyntaxTree(oldText); 3744private void CompareIncToFullParseErrors(SyntaxTree incrementalTree, SyntaxTree parsedTree) 3758private static void CharByCharIncrementalParse(SourceText oldText, char newChar, out SyntaxTree incrementalTree, out SyntaxTree parsedTree) 3760var startTree = SyntaxFactory.ParseSyntaxTree(oldText); 3769private static void TokenByTokenBottomUp(SourceText oldText, string token, out SyntaxTree incrementalTree, out SyntaxTree parsedTree) 3771var startTree = SyntaxFactory.ParseSyntaxTree(oldText);
IncrementalParsing\SyntaxDifferences.cs (2)
23public static ImmutableArray<SyntaxNodeOrToken> GetRebuiltNodes(SyntaxTree oldTree, SyntaxTree newTree)
IncrementalParsing\TypeChanges.cs (11)
31var newTree = oldTree.WithReplace(16, "construct", "~construct"); 46var newTree = oldTree.WithReplace(16, "M", "construct"); 61var newTree = oldTree.WithReplace(16, "construct", "M"); 76var newTree = oldTree.WithReplace(16, "~construct", "construct"); 91var newTree = oldTree.WithReplace(16, "get", "set"); 107var newTree = oldTree.WithReplace(16, "set", "get"); 123var newTree = oldTree.WithReplace(16, "add", "remove"); 139var newTree = oldTree.WithReplace(16, "remove", "add"); 147private static void ParseAndVerify(string text, Action<SyntaxTree> validator) 153private static void ParseAndValidate(string text, Action<SyntaxTree> validator, CSharpParseOptions options = null) 155var oldTree = SyntaxFactory.ParseSyntaxTree(text);
IncrementalParsing\UnaryExpression.cs (4)
79var oldTree = SyntaxFactory.ParseSyntaxTree(topLevel ? topLevelStatement : code, options: options); 82var newTree = oldTree.WithReplaceFirst(oldName, newName); 87private static PrefixUnaryExpressionSyntax GetExpressionNode(SyntaxTree newTree) 97private static PrefixUnaryExpressionSyntax GetGlobalExpressionNode(SyntaxTree newTree)
LexicalAndXml\LexicalTests.cs (1)
3820var tree = CSharpSyntaxTree.ParseText(source);
LexicalAndXml\PreprocessorTests.cs (5)
97private SyntaxTree ParseTree(string text, params string[] defines) 3213var tree = SyntaxFactory.ParseSyntaxTree(text, path: compilationFileName); 3550var tree = ParseTree(text); 3874var tree = SyntaxFactory.ParseSyntaxTree(text); 4561var tree = ParseTree(text);
LexicalAndXml\XmlDocCommentTests.cs (110)
31private SyntaxTree Parse(string text, params string[] defines) 76var tree = Parse(text); 96var tree = Parse(text); 113var tree = Parse(text); 128var tree = Parse(text); 144var tree = Parse(text); 166var tree = Parse(text); 190var tree = Parse(text); 213var tree = Parse(text); 236var tree = Parse(text); 259var tree = Parse(text); 286var tree = Parse(text); 314var tree = Parse(text); 338var tree = Parse(text); 363var tree = Parse(text); 389var tree = Parse(text); 416var tree = Parse(text); 443var tree = Parse(text); 471var tree = Parse(text); 500var tree = Parse(text); 530var tree = Parse(text); 559var tree = Parse(text); 589var tree = Parse(text); 620var tree = Parse(text); 643var tree = Parse(text); 665var tree = Parse(text); 687var tree = Parse(text); 709var tree = Parse(text); 731var tree = Parse(text); 751var tree = Parse(text); 785var tree = Parse(text); 818var tree = Parse(text); 849var tree = Parse(text); 877var tree = Parse(text); 902var tree = Parse(text); 928var tree = Parse(text); 953var tree = Parse(text); 980var tree = Parse(text); 1011var tree = Parse(text); 1039var tree = Parse(text); 1064var tree = Parse(text); 1089var tree = Parse(text); 1116var tree = Parse(text); 1149var tree = Parse(text); 1180var tree = Parse(text); 1206var tree = Parse(text); 1233var tree = Parse(text); 1260var tree = Parse(text); 1286var tree = Parse(text); 1306var tree = Parse(text); 1330var tree = Parse(text); 1355var tree = Parse(text); 1379var tree = Parse(text); 1404var tree = Parse(text); 1428var tree = Parse(text); 1453var tree = Parse(text); 1477var tree = Parse(text); 1502var tree = Parse(text); 1513var tree = Parse(text); 1524var tree = Parse(text); 1535var tree = Parse(text); 1546var tree = Parse(text); 1557var tree = Parse(text); 1585var tree = Parse(text); 1613var tree = Parse(text); 1639var tree = Parse(text); 1670var tree = Parse(text); 1687var tree = Parse(text); 1706var tree = Parse(text); 1745var tree = Parse(text); 1784var tree = Parse(text); 1825var tree = Parse(text); 1860var tree = Parse(text); 1895var tree = Parse(text); 1930var tree = Parse(text); 1965var tree = Parse(text); 2002var tree = Parse(text); 2040var tree = Parse(text); 2076var tree = Parse(text); 2107var tree = Parse(text); 2140var tree = Parse(text); 2170var tree = Parse(text); 2201var tree = Parse(text); 2236var tree = Parse(text); 2251var tree = Parse(text); 2279var tree = Parse(text); 2321var tree = Parse(text); 2353var tree = Parse(text); 2377var tree = Parse(text); 2407var tree = Parse(text); 2436var tree = Parse(text); 2459var tree = Parse(text); 2486var tree = Parse(text); 2511var tree = Parse(text); 2536var tree = Parse(text); 2562var tree = Parse(text); 2588var tree = Parse(text); 2603var tree = Parse(text); 2617var tree = Parse(text); 2632var tree = Parse(text); 2650var tree = Parse(text); 2673var tree = Parse(text); 2691var tree = Parse(text); 2717var tree = Parse(text); 2740var tree = Parse(text); 2764var tree = Parse(text); 2792var tree = Parse(text); 2844var tree = Parse(text); 2888var tree = Parse(text); 2921var tree = Parse(text);
ParentChecker.cs (1)
16public static void CheckParents(SyntaxNodeOrToken nodeOrToken, SyntaxTree expectedSyntaxTree)
Parsing\AllowsConstraintParsing.cs (1)
18private new SyntaxTree UsingTree(string text, params DiagnosticDescription[] expectedErrors)
Parsing\AnonymousFunctionParsingTests.cs (2)
2285var tree = UsingTree(test, 2362var tree = UsingTree(test,
Parsing\AsyncParsingTests.cs (1)
19protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\AsyncStreamsParsingTests.cs (1)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\AwaitParsingTests.cs (1)
17protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\CrefParsingTests.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\DeclarationParsingTests.cs (6)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 6544var tree = UsingTree(@" 6618var tree = UsingTree(@" 6664var tree = UsingTree(@" 6721var tree = UsingTree(@" 6789var tree = UsingTree(@"
Parsing\DeconstructionTests.cs (30)
32protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 41var tree = UsingTree(@" 115var tree = UsingTree(@" 193var tree = UsingTree(@" 269var tree = UsingTree(@" 357var tree = UsingTree(@" 441var tree = UsingTree(@" 516var tree = UsingTree(@" 592var tree = UsingTree(@" 684var tree = UsingTree(@" 774var tree = UsingTree(@" 887var tree = UsingTree(@" 964var tree = UsingTree(@" 1051var tree = UsingTree(@" 1125var tree = UsingTree(@" 1224var tree = UsingTree(@" 1322var tree = UsingTree(@" 1407var tree = UsingTree(@" 1500var tree = UsingTree(@" 1580var tree = UsingTree(@" (int x, int y) = (1, 2); ", options: TestOptions.Script); 1656var tree = UsingTree(@" foreach ((int x, int y) in new[] { (1, 2) }) { }; ", options: TestOptions.Script); 1755var tree = UsingTree(@" 2407var tree = UsingTree(@"void M() { var (x, _) = e; }"); 2472var tree = UsingTree(@"void M() { (var x, var _) = e; }"); 2550var tree = UsingTree(@"void M() { M(out var _); }"); 2613var tree = UsingTree(@"void M() { M(out int _); }"); 2676var tree = UsingTree(@"void M() { if (e is int _) {} }"); 2738var tree = UsingTree(@"void M() { if (e is var _) {} }"); 2797var tree = UsingTree(@"void M() { switch (e) { case int _: break; } }"); 2865var tree = UsingTree(@"void M() { switch (e) { case var _: break; } }");
Parsing\ExpressionParsingTests.cs (13)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 3835var tree = UsingTree(text); 3925var tree = UsingTree(text); 4016var tree = UsingTree(text); 4103var tree = UsingTree(text); 4197var tree = UsingTree(text); 4291var tree = UsingTree(text, 4396var tree = UsingTree(text, 4500var tree = UsingTree(text); 4591var tree = UsingTree(text); 4684var tree = UsingTree(text); 6511var tree = ParseTree(text, TestOptions.Regular); 6548var tree = ParseTree(text, TestOptions.Regular);
Parsing\FieldKeywordParsingTests.cs (3)
2393var tree = ParseTree(""" 2415void verifyMethod(SyntaxTree tree) 2454void verifyProperty(SyntaxTree tree)
Parsing\FileModifierParsingTests.cs (2)
19protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options) 35var tree = UsingTree(text, options, expectedParsingDiagnostics);
Parsing\LambdaAttributeParsingTests.cs (2)
22protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options) 4540var tree = ParseTree(builder.ToString(), CSharpParseOptions.Default);
Parsing\LambdaParameterParsingTests.cs (2)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 5470var tree = UsingTree(source,
Parsing\LambdaReturnTypeParsingTests.cs (1)
16protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options)
Parsing\LineSpanDirectiveParsingTests.cs (1)
18protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options)
Parsing\LocalFunctionParsingTests.cs (5)
356var tree = UsingTree(@" 553var tree = UsingTree(@" 909var tree = UsingTree(@" 989var tree = UsingTree(@" 1077var tree = UsingTree(@"
Parsing\NameAttributeValueParsingTests.cs (1)
22protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\ParserErrorMessageTests.cs (21)
1652var parsedTree = ParseWithRoundTripCheck(test); 2631var parsedTree = ParseWithRoundTripCheck(test); 3764var tree = ParseTree(test, TestOptions.Regular); 5439var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5461var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5526var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5545var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5588var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5623var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5657var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5694var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 5707var tree = UsingTree(text, 5946var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5964var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5977var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6006var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6036var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6078var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6365var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6519var parsedTree = Parse(builder.ToString()); 6552var parsedTree = Parse(builder.ToString());
Parsing\ParserRegressionTests.cs (12)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 88var tree = SyntaxFactory.ParseSyntaxTree(test); 97var tree = SyntaxFactory.ParseSyntaxTree(test); 107var tree = SyntaxFactory.ParseSyntaxTree(test); 117var tree = SyntaxFactory.ParseSyntaxTree(test); 127var tree = SyntaxFactory.ParseSyntaxTree(test); 137var tree = SyntaxFactory.ParseSyntaxTree(test); 147var tree = SyntaxFactory.ParseSyntaxTree(test); 162var tree = CSharpSyntaxTree.ParseText(code); 225var parsedTree = ParseWithRoundTripCheck(source.ToString()); 243var parsedTree = ParseWithRoundTripCheck(source.ToString()); 828var parsedTree = ParseWithRoundTripCheck(text);
Parsing\ParsingErrorRecoveryTests.cs (19)
7395SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, TestOptions.Regular9); 7414SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7448SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7473SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7498SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7524SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7548SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7573SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7587SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7644var tree = SyntaxFactory.ParseSyntaxTree(source); 7671var tree = SyntaxFactory.ParseSyntaxTree(source); 7760var tree = SyntaxFactory.ParseSyntaxTree(source); 7775var tree = SyntaxFactory.ParseSyntaxTree(source); 7806var tree = SyntaxFactory.ParseSyntaxTree(source); 7840var tree = SyntaxFactory.ParseSyntaxTree(source); 7865var tree = SyntaxFactory.ParseSyntaxTree(source); 7892var tree = SyntaxFactory.ParseSyntaxTree(source); 7906var tree = SyntaxFactory.ParseSyntaxTree(source); 7918var tree = SyntaxFactory.ParseSyntaxTree(source);
Parsing\ParsingTests.cs (8)
59var parsedTree = ParseWithRoundTripCheck(text); 66var parsedTree = ParseWithRoundTripCheck(text, options: options); 73var parsedTree = ParseWithRoundTripCheck(text); 78protected virtual SyntaxTree ParseTree(string text, CSharpParseOptions? options) => SyntaxFactory.ParseSyntaxTree(text, options); 145protected SyntaxTree UsingTree(string text, params DiagnosticDescription[] expectedErrors) 150protected SyntaxTree UsingTree(string text, CSharpParseOptions? options, params DiagnosticDescription[] expectedErrors) 155protected SyntaxTree UsingTree(SyntaxTree tree, params DiagnosticDescription[] expectedErrors)
Parsing\ReadOnlyStructs.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\RecordParsing.cs (5)
18private new SyntaxTree UsingTree(string text, params DiagnosticDescription[] expectedErrors) 264var tree = ParseTree(text, options: TestOptions.Regular8); 308var tree = ParseTree("interface P;", options: null); 330var tree = ParseTree(text, options: TestOptions.Regular8); 1217var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular8);
Parsing\RefReadonlyTests.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\RefStructs.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\RoundTrippingTests.cs (4)
28var tree = SyntaxFactory.ParseSyntaxTree(SourceText.From(text), options); 55var tree = SyntaxFactory.ParseSyntaxTree(text); 103var tree = SyntaxFactory.ParseSyntaxTree(SourceText.From(text), path: ""); 1582var tree = SyntaxFactory.ParseSyntaxTree(itext, options, "");
Parsing\ScriptParsingTests.cs (160)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 33private SyntaxTree ParseAndValidate(string text, CSharpParseOptions options, params ErrorDescription[] errors) 35var parsedTree = ParseTree(text, options); 187var tree = UsingTree("int x y;", 229var tree = UsingTree("int x y z;", 510var tree = UsingTree(@" 576var tree = UsingTree(@" 603var tree = UsingTree(@" 643var tree = UsingTree(@" 686var tree = UsingTree("new partial " + typeName + " Goo();"); 713var tree = UsingTree(@" 742var tree = UsingTree(@" 805var tree = UsingTree(@" 850var tree = UsingTree(@" 909var tree = UsingTree(@" 973var tree = UsingTree("new " + modifier + @" T Goo;"); 1001var tree = UsingTree(@" 1021var tree = UsingTree(@" 1052var tree = UsingTree(source); 1080var tree = UsingTree(source); 1106var tree = UsingTree(@" 1202var tree = UsingTree(@" 1227var tree = UsingTree(@" 1255var tree = UsingTree(@" 1286var tree = UsingTree(@" 1331var tree = UsingTree(@" 1413var tree = UsingTree(@" 1450var tree = UsingTree(@" 1492var tree = UsingTree(@" 1524var tree = UsingTree(@" 1563var tree = UsingTree(@" 1604var tree = UsingTree(@" 1651var tree = UsingTree(@" 1740var tree = UsingTree(@" 1914var tree = UsingTree(@" 1989var tree = UsingTree(@" 2268var tree = UsingTree(@" 2476var tree = UsingTree(@" 2612var tree = UsingTree(@"a * b;", TestOptions.Script); 2642var tree = UsingTree(@"a * b", TestOptions.Script); 2675var tree = UsingTree(@"a<t>.n * f(x)", TestOptions.Script); 2811var tree = UsingTree(@"T ? a;", TestOptions.Script); 2841var tree = UsingTree(@"T ? b, c = 1;", TestOptions.Script); 2884var tree = UsingTree(@"T ? b = d => { };", TestOptions.Script); 2931var tree = UsingTree(@"T ? b = x ? y : z;", TestOptions.Script); 2981var tree = UsingTree(@"T ? a,", TestOptions.Script, 3023var tree = UsingTree(@"T ? a = 1,", TestOptions.Script, 3074var tree = UsingTree(@"T ? a {", TestOptions.Script, 3105var tree = UsingTree(@"T ? a.b {", TestOptions.Script, 3144var tree = UsingTree(@"T ? a<T>.b {", TestOptions.Script, 3192var tree = UsingTree(@"T ? a<T?>.b<S>.c {", TestOptions.Script, 3263var tree = UsingTree(@"T ? a() {", TestOptions.Script, 3299var tree = UsingTree(@"T ? a() where", TestOptions.Script, 3356var tree = UsingTree(@"T ? a(T b", TestOptions.Script, 3399var tree = UsingTree(@"T ? a.b(T c", TestOptions.Script, 3450var tree = UsingTree(@"T ? a<A>.b<B>(C c", TestOptions.Script, 3519var tree = UsingTree(@"T ? a([Attr]C c", TestOptions.Script, 3574var tree = UsingTree(@"T ? a([Attr(a = b)]c", TestOptions.Script, 3652var tree = UsingTree(@"T ? a(out C c", TestOptions.Script, 3696var tree = UsingTree(@"T ? a(C[] a", TestOptions.Script, 3751var tree = UsingTree(@"T ? a(params", TestOptions.Script, 3801var tree = UsingTree(@"T ? a(out T ? b", TestOptions.Script, 3849var tree = UsingTree(@"T ? a(ref T ? b", TestOptions.Script, 3897var tree = UsingTree(@"T ? a(params T ? b", TestOptions.Script, 3945var tree = UsingTree(@"T ? a([Attr]T ? b", TestOptions.Script, 4004var tree = UsingTree(@"T ? a(T ? b,", TestOptions.Script, 4066var tree = UsingTree(@"T ? a(T ? b)", TestOptions.Script, 4110var tree = UsingTree(@"T ? a(T c)", TestOptions.Script, 4150var tree = UsingTree(@"T ? a(this c d", TestOptions.Script, 4194var tree = UsingTree(@"T ? a(ref out T a", TestOptions.Script, 4239var tree = UsingTree(@"T ? a(int a", TestOptions.Script, 4282var tree = UsingTree(@"T ? a(ref int a", TestOptions.Script, 4326var tree = UsingTree(@"T ? a(T a =", TestOptions.Script, 4380var tree = UsingTree(@"T ? a(T[,] a", TestOptions.Script, 4440var tree = UsingTree(@"T ? a(T?[10] a)", 4499var tree = UsingTree(@"T ? m(a < b, c > d)", TestOptions.Script, 4555var tree = UsingTree(@"T ? 1", TestOptions.Script, 4596var tree = UsingTree(@"T ? a", TestOptions.Script, 4637var tree = UsingTree(@"T ? a.", TestOptions.Script, 4689var tree = UsingTree(@"T ? a[", TestOptions.Script, 4741var tree = UsingTree(@"T ? a<", TestOptions.Script, 4793var tree = UsingTree(@"T ? a<b", TestOptions.Script, 4842var tree = UsingTree(@"T ? a<b>", TestOptions.Script, 4892var tree = UsingTree(@"T ? a<b,c>", TestOptions.Script, 4947var tree = UsingTree(@"T ? a<b>.", TestOptions.Script, 5008var tree = UsingTree(@"T ? a<b>.c", TestOptions.Script, 5066var tree = UsingTree(@"T ? a<b>.c(", TestOptions.Script, 5135var tree = UsingTree(@"T ? a(", TestOptions.Script, 5187var tree = UsingTree(@"T ? a.b(", TestOptions.Script, 5247var tree = UsingTree(@"T ? m(c", TestOptions.Script, 5306var tree = UsingTree(@"T ? m(c,", TestOptions.Script, 5376var tree = UsingTree(@"T ? m(c:", TestOptions.Script, 5446var tree = UsingTree(@"T ? m(c?", TestOptions.Script, 5527var tree = UsingTree(@"T ? m(c? a", TestOptions.Script, 5605var tree = UsingTree(@"T ? m(c? a =", TestOptions.Script, 5694var tree = UsingTree(@"T ? m(c? a = b ?", TestOptions.Script, 5802var tree = UsingTree(@"T ? m()", TestOptions.Script, 5851var tree = UsingTree(@"T ? m(a)", TestOptions.Script, 5907var tree = UsingTree(@"T ? m();", TestOptions.Script, 5956var tree = UsingTree(@"T ? m(a);", TestOptions.Script, 6012var tree = UsingTree(@"T ? m(x: 1", TestOptions.Script, 6079var tree = UsingTree(@"T ? m(x: 1, y: a ? b : c)", TestOptions.Script, 6172var tree = UsingTree(@"T ? u => { } : v => { }", TestOptions.Script); 6225var tree = UsingTree(@"T ? u => (d ? e => 1 : f => 2)(3) : c => 2", TestOptions.Script); 6325var tree = UsingTree(@"T ? a ?", TestOptions.Script, 6388var tree = UsingTree(@"T ? a =", TestOptions.Script, 6440var tree = UsingTree(@"T ? a = b", TestOptions.Script, 6489var tree = UsingTree(@"T ? a = b : ", TestOptions.Script, 6535var tree = UsingTree(@"T ? m(out c", TestOptions.Script, 6595var tree = UsingTree(@"T ? m(ref c", TestOptions.Script, 6655var tree = UsingTree(@"T ? m(ref out", TestOptions.Script, 6733var tree = UsingTree(@"T ? m(ref out c", TestOptions.Script, 6808var tree = UsingTree(@"T ? m(this", TestOptions.Script, 6867var tree = UsingTree(@"T ? m(this.", TestOptions.Script, 6937var tree = UsingTree(@"T ? m(this<", TestOptions.Script, 7007var tree = UsingTree(@"T ? m(this[", TestOptions.Script, 7077var tree = UsingTree(@"T ? m(this a", TestOptions.Script, 7147var tree = UsingTree(@"T ? m(this(", TestOptions.Script, 7217var tree = UsingTree(@"T ? m(T[", TestOptions.Script, 7287var tree = UsingTree(@"T ? m(T[1", TestOptions.Script, 7364var tree = UsingTree(@"T ? m(T[1]", TestOptions.Script, 7438var tree = UsingTree(@"T ? a(T ? a =", TestOptions.Script, 7527var tree = UsingTree(@"T ? a(T)", TestOptions.Script, 7583var tree = UsingTree(@"T ? a(ref int.MaxValue)", TestOptions.Script, 7648var tree = UsingTree(@"T ? a(ref a,", TestOptions.Script, 7719var tree = UsingTree(@"T ? a(,", TestOptions.Script, 7792var tree = UsingTree(@"T ? a(T ? b[1] : b[2])", TestOptions.Script, 7891var tree = UsingTree(@" 7965var tree = UsingTree(@"T ? m(a < b, c > d) :", TestOptions.Script, 8042var tree = UsingTree(@" 8073var tree = UsingTree(@" 8116var tree = UsingTree(@" 8195var tree = UsingTree(@" 8259var tree = UsingTree(@" 8360var tree = UsingTree(@"from", TestOptions.Script); 8382var tree = UsingTree(@"from c", TestOptions.Script, 8411var tree = UsingTree(@"from x,", 8449var tree = UsingTree(@"from x;"); 8475var tree = UsingTree(@"from x =", 8516var tree = UsingTree(@"from x[", 8564var tree = UsingTree(@"from c(", 8595var tree = UsingTree(@"from a<", 8645var tree = UsingTree(@"from a.", 8691var tree = UsingTree(@"from a::", 8740var tree = UsingTree(@"from global::", 8789var tree = UsingTree(@"from c {", 8816var tree = UsingTree(@"from c d", 8871var tree = UsingTree(@"from x* a", 8931var tree = UsingTree(@"from x? a", 8991var tree = UsingTree(@"from x[] a", 9059var tree = UsingTree(@"from goo in", 9107var tree = UsingTree(@"from goo.bar in", 9177var tree = UsingTree("a < b,c.", TestOptions.Script, 9235var tree = UsingTree(@" 9288var tree = UsingTree(@" 9345var tree = UsingTree(@" 9402var tree = UsingTree(@" 9609var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 9633var tree = ParseAndValidate($"#!{command}", TestOptions.Script); 9707var tree = ParseAndValidate("//#!/usr/bin/env csi", TestOptions.Script);
Parsing\SeparatedSyntaxListParsingTests.cs (3)
22protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 315var tree = UsingTree(@" 735var tree = UsingTree(text, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6),
Parsing\SingleLineDeclarationParsingTests.cs (1)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\StatementAttributeParsingTests.cs (85)
22var test = UsingTree(@" 88var test = UsingTree(@" 153var test = UsingTree(@" 240var test = UsingTree(@" 334var test = UsingTree(@" 419var test = UsingTree(@" 504var test = UsingTree(@" 570var test = UsingTree(@" 639var test = UsingTree(@" 713var test = UsingTree(@" 787var test = UsingTree(@" 865var test = UsingTree(@" 940var test = UsingTree(@" 1018var test = UsingTree(@" 1092var test = UsingTree(@" 1194var test = UsingTree(@" 1328var test = UsingTree(@" 1404var test = UsingTree(@" 1490var test = UsingTree(@" 1574var test = UsingTree(@" 1693var test = UsingTree(@" 1763var test = UsingTree(@" 1833var test = UsingTree(@" 1903var test = UsingTree(@" 1976var test = UsingTree(@" 2085var test = UsingTree(@" 2161var test = UsingTree(@" 2237var test = UsingTree(@" 2313var test = UsingTree(@" 2403var test = UsingTree(@" 2525var test = UsingTree(@" 2646var test = UsingTree(@" 2725var test = UsingTree(@" 2804var test = UsingTree(@" 2913var test = UsingTree(@" 2992var test = UsingTree(@" 3101var test = UsingTree(@" 3180var test = UsingTree(@" 3256var test = UsingTree(@" 3336var test = UsingTree(@" 3422var test = UsingTree(@" 3504var test = UsingTree(@" 3586var test = UsingTree(@" 3676var test = UsingTree(@" 3757var test = UsingTree(@" 3831var test = UsingTree(@" 3924var test = UsingTree(@" 4007var test = UsingTree(@" 4092var test = UsingTree(@" 4177var test = UsingTree(@" 4259var test = UsingTree(@" 4336var test = UsingTree(@" 4424var test = UsingTree(@" 4513var test = UsingTree(@" 4610var test = UsingTree(@" 4688var test = UsingTree(@" 4763var test = UsingTree(@" 4858var test = UsingTree(@" 4957var test = UsingTree(@" 5034var test = UsingTree(@" 5106var test = UsingTree(@" 5194var test = UsingTree(@" 5272var test = UsingTree(@" 5358var test = UsingTree(@" 5435var test = UsingTree(@" 5516var test = UsingTree(""" 5611var test = UsingTree(@" 5729var test = UsingTree(@" 5835var test = UsingTree(@" 5934var test = UsingTree(@" 6030var test = UsingTree(@" 6122var test = UsingTree(@" 6200var test = UsingTree(@" 6292var test = UsingTree(@" 6370var test = UsingTree(@" 6449var test = UsingTree(@" 6536var test = UsingTree(@" 6623var test = UsingTree(@" 6780var tree = UsingTree(@" 6868var test = UsingTree(@" 6954var test = UsingTree(@" 7040var test = UsingTree(@" 7134var test = UsingTree(@" 7235var test = UsingTree(@" 7343var test = UsingTree(@"
Parsing\StatementParsingTests.cs (5)
3410var tree = SyntaxFactory.ParseSyntaxTree(text); 3437var tree = SyntaxFactory.ParseSyntaxTree(text, options: new CSharpParseOptions(documentationMode: DocumentationMode.Parse)); 3460var tree = SyntaxFactory.ParseSyntaxTree(source); 3506var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular); 3531var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular);
Parsing\SuppressNullableWarningExpressionParsingTests.cs (1)
34var tree = UsingTree(source);
Parsing\TopLevelStatementsParsingTests.cs (1)
1621var tree = UsingTree(test, TestOptions.RegularPreview.WithLanguageVersion(version));
Parsing\TypeArgumentListParsingTests.cs (1)
15protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options)
Parsing\UsingDirectiveParsingTests.cs (1)
16protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options)
Parsing\ValueTupleTests.cs (6)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 28var tree = UsingTree(@" 112var tree = UsingTree(@" 226var tree = UsingTree(@" 330var tree = UsingTree(@" 436var tree = UsingTree(@"
Parsing\VerbatimCrefParsingTests.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Syntax\FieldAndValueKeywordTests.cs (1)
1275var syntaxTree = comp.SyntaxTrees[0];
Syntax\LambdaUtilitiesTests.cs (1)
42var tree = SyntaxFactory.ParseSyntaxTree(source);
Syntax\Mocks\MockCSharpSyntaxTree.cs (2)
58public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 61public override SyntaxTree WithFilePath(string path)
Syntax\StructuredTriviaTests.cs (7)
100var tree = SyntaxFactory.ParseSyntaxTree(@" 119var tree = SyntaxFactory.ParseSyntaxTree(@" 131var tree = SyntaxFactory.ParseSyntaxTree(@" 141var tree = SyntaxFactory.ParseSyntaxTree(@" 159var tree = SyntaxFactory.ParseSyntaxTree(@" 175var tree = SyntaxFactory.ParseSyntaxTree(@" 190var tree = SyntaxFactory.ParseSyntaxTree(" class goo {}");
Syntax\SyntaxAnnotationTests.cs (24)
25var tree = SyntaxFactory.ParseSyntaxTree(code); 99var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 109var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 118var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 133var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 143var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 156var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 188var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 220var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 252var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 271var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 280var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 306var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 314var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 322var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 330var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 338var tree1 = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 339var tree2 = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 382private void TestCopyAnnotations(SyntaxTree tree1, SyntaxTree tree2) 468private void TestManyRandomAnnotations(SyntaxTree syntaxTree) 501private void TestRandomAnnotations(SyntaxTree syntaxTree) 562private void TestTriviaAnnotation(SyntaxTree syntaxTree) 576private void TestAnnotation(SyntaxTree syntaxTree)
Syntax\SyntaxDiffingTests.cs (32)
21var oldTree = SyntaxFactory.ParseSyntaxTree(""); 22var newTree = SyntaxFactory.ParseSyntaxTree("class C { }"); 40var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 41var newTree = SyntaxFactory.ParseSyntaxTree("class B { }"); 60var oldTree = SyntaxFactory.ParseSyntaxTree("class A { } class B { }"); 61var newTree = SyntaxFactory.ParseSyntaxTree("class C { } class D { }"); 84var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 85var newTree = oldTree.WithInsertAt(0, "class "); 102var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 103var newTree = oldTree.WithInsertAt(0, "class A "); 120var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 121var newTree = oldTree.WithInsertAt(0, "class A { }"); 139var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 140var newTree = oldTree.WithInsertAt(0, "class A { } "); 159var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 160var newTree = oldTree.WithInsertAt(0, "namespace N { "); 177var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 178var newTree = oldTree.WithInsertAt(10, "int X; "); 195var oldTree = SyntaxFactory.ParseSyntaxTree("class A { int X; }"); 196var newTree = oldTree.WithRemoveAt(10, 7); 212var oldTree = SyntaxFactory.ParseSyntaxTree("namespace N { class A { int X; } }"); 213var newTree = oldTree.WithRemoveAt(24, 7); 229var oldTree = SyntaxFactory.ParseSyntaxTree("class A { int X; }"); 230var newTree = oldTree.WithRemoveAt(14, 1); 246var oldTree = SyntaxFactory.ParseSyntaxTree("namespace N { class A { int X; } }"); 247var newTree = oldTree.WithReplaceFirst("class", "struct"); 283var oldTree = SyntaxFactory.ParseSyntaxTree(original); 305var oldTree = root.SyntaxTree; 320var newTree = newRoot.SyntaxTree; 343var oldTree = SyntaxFactory.ParseSyntaxTree(original); 370var oldTree = root.SyntaxTree; 382var newTree = newRoot.SyntaxTree;
Syntax\SyntaxEquivalenceTests.cs (155)
16private void VerifyEquivalent(SyntaxTree tree1, SyntaxTree tree2, bool topLevel) 21var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 25private void VerifyNotEquivalent(SyntaxTree tree1, SyntaxTree tree2, bool topLevel) 30var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 39var tree3 = SyntaxFactory.ParseSyntaxTree(node2.GetText().ToString()); 47var tree1 = SyntaxFactory.ParseSyntaxTree(text); 48var tree2 = SyntaxFactory.ParseSyntaxTree(text); 58var tree1 = SyntaxFactory.ParseSyntaxTree(text); 59var tree2 = tree1.WithInsertAt(0, "/* goo */"); 69var tree1 = SyntaxFactory.ParseSyntaxTree(text); 70var tree2 = tree1.WithInsertAt(0, "#if true \r\n\r\n#endif"); 80var tree1 = SyntaxFactory.ParseSyntaxTree(text); 81var tree2 = tree1.WithInsertAt(0, "#if false \r\n\r\n#endif"); 91var tree1 = SyntaxFactory.ParseSyntaxTree(text); 92var tree2 = tree1.WithInsertAt(0, "namespace N { }"); 101var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { }"); 102var tree2 = tree1.WithInsertBefore("}", "class C { }"); 111var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { }"); 112var tree2 = tree1.WithReplaceFirst("N", "N1"); 121var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { int z = 0; } } }"); 122var tree2 = tree1.WithReplaceFirst("z", "y"); 131var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { }"); 132var tree2 = tree1.WithReplaceFirst("N", "N"); 141var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { int z = 0; } } }"); 142var tree2 = tree1.WithReplaceFirst("z", "z"); 151var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { } }"); 152var tree2 = tree1.WithInsertBefore("}", "void Goo() { } "); 161var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { } } }"); 162var tree2 = tree1.WithInsertBefore("}", "int i; "); 171var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { int i; } } }"); 172var tree2 = tree1.WithRemoveFirst("int i;"); 181var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5; int j = 6; } }"); 182var tree2 = tree1.WithRemoveFirst("int i = 5;"); 191var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5; int j = 6; } }"); 192var tree2 = tree1.WithRemoveFirst("int j = 6;"); 201var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5; } }"); 202var tree2 = tree1.WithReplaceFirst("5", "6"); 211var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5, j = 7; } }"); 212var tree2 = tree1.WithReplaceFirst("7", "8"); 225var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { const int i = 5; } }"); 226var tree2 = tree1.WithReplaceFirst("5", "6"); 235var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { const int i = 5, j = 7; } }"); 236var tree2 = tree1.WithReplaceFirst("5", "6"); 250var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { const int i = 5; } } }"); 251var tree2 = tree1.WithReplaceFirst("5", "6"); 260var tree1 = SyntaxFactory.ParseSyntaxTree("enum E { i = 5 }"); 261var tree2 = tree1.WithReplaceFirst("5", "6"); 270var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { [Obsolete(true)]class C { const int i = 5; } }"); 271var tree2 = tree1.WithReplaceFirst("true", "false"); 280var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { Console.Write(0); } } }"); 281var tree2 = tree1.WithReplaceFirst("Write", "WriteLine"); 290var tree1 = SyntaxFactory.ParseSyntaxTree("using System; namespace N { class C { void Goo() { Console.Write(0); } } }"); 291var tree2 = tree1.WithReplaceFirst("System", "System.Linq"); 300var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 301var tree2 = tree1.WithInsertBefore("{", ": B "); 310var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 311var tree2 = tree1.WithReplaceFirst("void", "int"); 320var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 321var tree2 = tree1.WithInsertBefore("class", "// Comment\r\n"); 330var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 331var tree2 = tree1.WithInsertBefore("class", "// "); 340var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 341var tree2 = tree1.WithInsertBefore("class", "/// Comment\r\n"); 350var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 351var tree2 = tree1.WithReplaceFirst("Console.Write(0);", "/* Console.Write(0); */"); 360var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { } }"); 361var tree2 = tree1.WithReplaceFirst("void Goo() { }", "/* void Goo() { } */"); 370var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { } }"); 371var tree2 = tree1.WithReplaceFirst("void Goo() { }", "\r\n#if true\r\n void Goo() { }\r\n#endif\r\n"); 380var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { } }"); 381var tree2 = tree1.WithReplaceFirst("void Goo() { }", "\r\n#if false\r\n void Goo() { }\r\n#endif\r\n"); 390var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 391var tree2 = tree1.WithReplaceFirst("int i;", "\r\n#if true\r\n int i;\r\n#endif\r\n"); 400var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 401var tree2 = tree1.WithReplaceFirst("int i;", "\r\n#if false\r\n int i;\r\n#endif\r\n"); 411var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 412var tree2 = SyntaxFactory.ParseSyntaxTree(text.Replace(" ", " /**/ ")); 422var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 423var tree2 = SyntaxFactory.ParseSyntaxTree(text.Replace(" ", " ")); 433var tree1 = SyntaxFactory.ParseSyntaxTree(text); 434var tree2 = SyntaxFactory.ParseSyntaxTree(text.Replace("abc", "hello")); 442var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { Console.Write($\"Hello{123:N1}\"); } } }"); 443var tree2 = tree1.WithReplaceFirst("N1", "N2"); 457var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void M() => 1; }"); 458var tree2 = SyntaxFactory.ParseSyntaxTree("class C { void M() => 2; }"); 479var tree1 = SyntaxFactory.ParseSyntaxTree($@" 484var tree2 = SyntaxFactory.ParseSyntaxTree($@" 494var tree3 = SyntaxFactory.ParseSyntaxTree($@" 502var tree4 = SyntaxFactory.ParseSyntaxTree($@" 523var tree1 = SyntaxFactory.ParseSyntaxTree($@" 532var tree2 = SyntaxFactory.ParseSyntaxTree($@" 548var tree1 = SyntaxFactory.ParseSyntaxTree(@" 556var tree2 = SyntaxFactory.ParseSyntaxTree(@" 571var tree1 = SyntaxFactory.ParseSyntaxTree(@" 580var tree2 = SyntaxFactory.ParseSyntaxTree(@" 597var tree1 = SyntaxFactory.ParseSyntaxTree(@" 606var tree2 = SyntaxFactory.ParseSyntaxTree(@" 621var tree1 = SyntaxFactory.ParseSyntaxTree(@" 630var tree2 = SyntaxFactory.ParseSyntaxTree(@" 646var tree1 = SyntaxFactory.ParseSyntaxTree(@" 655var tree2 = SyntaxFactory.ParseSyntaxTree(@" 670var tree1 = SyntaxFactory.ParseSyntaxTree(@" 679var tree2 = SyntaxFactory.ParseSyntaxTree(@" 695var tree1 = SyntaxFactory.ParseSyntaxTree(@" 704var tree2 = SyntaxFactory.ParseSyntaxTree(@" 719var tree1 = SyntaxFactory.ParseSyntaxTree(@" 728var tree2 = SyntaxFactory.ParseSyntaxTree(@" 744var tree1 = SyntaxFactory.ParseSyntaxTree(@" 753var tree2 = SyntaxFactory.ParseSyntaxTree(@" 769var tree1 = SyntaxFactory.ParseSyntaxTree(@" 778var tree2 = SyntaxFactory.ParseSyntaxTree(@" 794var tree1 = SyntaxFactory.ParseSyntaxTree(@" 803var tree2 = SyntaxFactory.ParseSyntaxTree(@" 818var tree1 = SyntaxFactory.ParseSyntaxTree(@" 827var tree2 = SyntaxFactory.ParseSyntaxTree(@" 843var tree1 = SyntaxFactory.ParseSyntaxTree(@" 852var tree2 = SyntaxFactory.ParseSyntaxTree(@" 868var tree1 = SyntaxFactory.ParseSyntaxTree(@" 877var tree2 = SyntaxFactory.ParseSyntaxTree(@" 893var tree1 = SyntaxFactory.ParseSyntaxTree(@" 902var tree2 = SyntaxFactory.ParseSyntaxTree(@" 918var tree1 = SyntaxFactory.ParseSyntaxTree(@" 927var tree2 = SyntaxFactory.ParseSyntaxTree(@" 943var tree1 = SyntaxFactory.ParseSyntaxTree(@" 952var tree2 = SyntaxFactory.ParseSyntaxTree(@" 967var tree1 = SyntaxFactory.ParseSyntaxTree(@" 976var tree2 = SyntaxFactory.ParseSyntaxTree(@" 992var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1001var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1017var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1026var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1042var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1051var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1067var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1076var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1092var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1103var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1120var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1131var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1149var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1160var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1178var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1189var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1207var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1218var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1236var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1247var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1265var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1276var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1294var tree1 = SyntaxFactory.ParseSyntaxTree($$"""" 1304var tree2 = SyntaxFactory.ParseSyntaxTree($$"""" 1322var tree1 = SyntaxFactory.ParseSyntaxTree($$"""" 1332var tree2 = SyntaxFactory.ParseSyntaxTree($$""""
Syntax\SyntaxListTests.cs (3)
330var tree = CSharpSyntaxTree.ParseText(builder.ToString()); 354var tree = CSharpSyntaxTree.ParseText(builder.ToString()); 400var tree = CSharpSyntaxTree.ParseText(source);
Syntax\SyntaxNodeTests.cs (95)
45var tree = SyntaxFactory.ParseSyntaxTree(builder.ToString()); 534var t1 = SyntaxFactory.ParseSyntaxTree(s1); 547var t1 = SyntaxFactory.ParseSyntaxTree(s1); 560var t1 = SyntaxFactory.ParseSyntaxTree(s1); 577var t1 = SyntaxFactory.ParseSyntaxTree(s1); 589var t1 = SyntaxFactory.ParseSyntaxTree(s1); 601var t1 = SyntaxFactory.ParseSyntaxTree(s1); 614var t1 = SyntaxFactory.ParseSyntaxTree(s1); 661var t1 = SyntaxFactory.ParseSyntaxTree(s1); 672var tree = SyntaxFactory.ParseSyntaxTree(text); 726var tree = SyntaxFactory.ParseSyntaxTree(text); 786var tree = SyntaxFactory.ParseSyntaxTree(code); 801var tree = SyntaxFactory.ParseSyntaxTree(text); 809var tree = SyntaxFactory.ParseSyntaxTree(text); 817var tree1 = SyntaxFactory.ParseSyntaxTree(text); 818var tree2 = SyntaxFactory.ParseSyntaxTree(text); 826var tree1 = SyntaxFactory.ParseSyntaxTree("class goo { }"); 827var tree2 = SyntaxFactory.ParseSyntaxTree("class bar { }"); 835var tree1 = SyntaxFactory.ParseSyntaxTree("class goo { }"); 836var tree2 = SyntaxFactory.ParseSyntaxTree(string.Empty); 844var tree1 = SyntaxFactory.ParseSyntaxTree("class goo { void M() { } }"); 845var tree2 = SyntaxFactory.ParseSyntaxTree("class bar { void M() { } }"); 857var tree1 = SyntaxFactory.ParseSyntaxTree("class goo {void M() { }}"); 858var tree2 = SyntaxFactory.ParseSyntaxTree("class goo { void M() { } }"); 866var tree = SyntaxFactory.ParseSyntaxTree(text); 874var tree = SyntaxFactory.ParseSyntaxTree(text); 882var tree = SyntaxFactory.ParseSyntaxTree(text); 890var tree1 = SyntaxFactory.ParseSyntaxTree(text); 891var tree2 = SyntaxFactory.ParseSyntaxTree(text); 899var tree1 = SyntaxFactory.ParseSyntaxTree(text); 900var tree2 = SyntaxFactory.ParseSyntaxTree(text); 908var tree1 = SyntaxFactory.ParseSyntaxTree(text); 909var tree2 = tree1.WithChangedText(tree1.GetText().WithChanges(new TextChange(default, " "))); 919var tree1 = SyntaxFactory.ParseSyntaxTree(text); 920var tree2 = tree1.WithChangedText(tree1.GetText().WithChanges(new TextChange(new TextSpan(22, 0), " return; "))); 929var tree = SyntaxFactory.ParseSyntaxTree(" class goo {}"); 944var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 952var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 960var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 968var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { "); 981var tree1 = SyntaxFactory.ParseSyntaxTree("class A {} public class B {} public static class C {}"); 1004var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1030var tree = SyntaxFactory.ParseSyntaxTree(text); 1055var tree = SyntaxFactory.ParseSyntaxTree( 1081SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1103var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1130var tree = SyntaxFactory.ParseSyntaxTree(text); 1160var tree = SyntaxFactory.ParseSyntaxTree(text); 1186SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1210var tree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1231SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1252var tree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1276SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1299var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1317var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1336var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1353var tree = SyntaxFactory.ParseSyntaxTree("#define GOO"); 1364var tree = SyntaxFactory.ParseSyntaxTree("#define GOO"); 1400var tree = SyntaxFactory.ParseSyntaxTree("#define GOO"); 1409var tree = SyntaxFactory.ParseSyntaxTree( 1421var tree = SyntaxFactory.ParseSyntaxTree( 1449var tree = SyntaxFactory.ParseSyntaxTree( 1477var tree = SyntaxFactory.ParseSyntaxTree( 1505var tree = SyntaxFactory.ParseSyntaxTree( 1536var tree = SyntaxFactory.ParseSyntaxTree( 1575var tree = SyntaxFactory.ParseSyntaxTree( 1603var tree = SyntaxFactory.ParseSyntaxTree( 1637var tree = SyntaxFactory.ParseSyntaxTree( 1671var tree = SyntaxFactory.ParseSyntaxTree( 1702var tree = SyntaxFactory.ParseSyntaxTree( 1732var tree = SyntaxFactory.ParseSyntaxTree( 1752var tree = SyntaxFactory.ParseSyntaxTree( 1774var tree = SyntaxFactory.ParseSyntaxTree( 1790var tree = SyntaxFactory.ParseSyntaxTree( 1820SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(@"class c1 2017var tree = SyntaxFactory.ParseSyntaxTree( 2032SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("class C {}"); 2053SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("class C {}"); 2073var tree = SyntaxFactory.ParseSyntaxTree("class C { void F() { } }"); 3328var tree = SyntaxFactory.ParseSyntaxTree(s1); 3390var syntaxTree = SyntaxFactory.ParseSyntaxTree(@"namespace n1 { c1<t"); 3402var syntaxTree = SyntaxFactory.ParseSyntaxTree(@" 3440var syntaxTree = SyntaxFactory.ParseSyntaxTree(code); 3459var tree = SyntaxFactory.ParseSyntaxTree(code); 3474var tree = SyntaxFactory.ParseSyntaxTree(code); 3494var tree = SyntaxFactory.ParseSyntaxTree(@" 3627var treeFromSource_invalid2 = SyntaxFactory.ParseSyntaxTree(st); 3648SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(SourceText); 3671SyntaxTree x = ThirdUsingClause.SyntaxTree; 3672SyntaxTree y = newUsingClause.SyntaxTree; 3698SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(SourceText); 3710SyntaxTree BlankTree = null; 3731SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(SourceText); 3743SyntaxTree BlankTree = null; 3869var tree = SyntaxFactory.ParseSyntaxTree(code.ToString());
Syntax\SyntaxNormalizerTests.cs (3)
3722var tree = SyntaxFactory.ParseSyntaxTree(code); 3750var tree = SyntaxFactory.ParseSyntaxTree(code); 3779var tree = SyntaxFactory.ParseSyntaxTree(code);
Syntax\SyntaxRewriterTests.cs (26)
336var tree = SyntaxFactory.ParseSyntaxTree("class Class1<T> { }"); 348var tree = SyntaxFactory.ParseSyntaxTree("class Class1 : Class2<T> { }"); 361var tree = SyntaxFactory.ParseSyntaxTree("System.Console.Write(\"Before\")", TestOptions.Script); 367var newTree = newRoot.SyntaxTree; 376var tree = SyntaxFactory.ParseSyntaxTree("m(a, b)", TestOptions.Script); 386var newTree = newRoot.SyntaxTree; 395var tree = SyntaxFactory.ParseSyntaxTree("m(a, b)", TestOptions.Script); 406var newTree = newNode.SyntaxTree; 413var newTree2 = newNode2.SyntaxTree; 422var tree = SyntaxFactory.ParseSyntaxTree("private class C { }", options: TestOptions.Script); 433var newTree = newRoot.SyntaxTree; 442var tree = SyntaxFactory.ParseSyntaxTree("public class C { }", options: TestOptions.Script); 450var newTree = newRoot.SyntaxTree; 456var newTree2 = newRoot2.SyntaxTree; 465var tree = SyntaxFactory.ParseSyntaxTree("/* c */ identifier", options: TestOptions.Script); 477var newTree = newRoot.SyntaxTree; 483var newTree2 = newRoot2.SyntaxTree; 492var tree = SyntaxFactory.ParseSyntaxTree("/* c */ identifier", options: TestOptions.Script); 505var newTree = newRoot.SyntaxTree; 514var tree = SyntaxFactory.ParseSyntaxTree("private class C { }", options: TestOptions.Script); 518var newTree = newRoot.SyntaxTree; 527var tree = SyntaxFactory.ParseSyntaxTree("private class C { }", options: TestOptions.Script); 531var newTree = newRoot.SyntaxTree; 539var tree = SyntaxFactory.ParseSyntaxTree("class Class1<T> { }"); 600var tree1 = SyntaxFactory.ParseSyntaxTree("class C { static void Main() { if (true) } }"); 649var oldTree = CSharpTestBase.Parse(oldSource, options: TestOptions.RegularWithDocumentationComments);
Syntax\SyntaxTreeTests.cs (27)
109static SyntaxTree WithInitializedDirectives(SyntaxTree tree) 121var tree = CSharpSyntaxTree.Create(root); 131var tree = CSharpSyntaxTree.Create(SyntaxFactory.ParseCompilationUnit(""), options: null, path: null, encoding: null, diagnosticOptions: options); 141var tree = CSharpSyntaxTree.ParseText( 149var newTree = tree.WithChangedText(SourceText.From("class C { }")); 156var tree = CSharpSyntaxTree.ParseText( 172var tree = CSharpSyntaxTree.ParseText( 188var tree = CSharpSyntaxTree.ParseText( 201var tree = SyntaxFactory.SyntaxTree(SyntaxFactory.CompilationUnit()); 209var tree = SyntaxFactory.SyntaxTree(SyntaxFactory.CompilationUnit()); 210var newTree = tree.WithDiagnosticOptions(null); 219var tree = SyntaxFactory.SyntaxTree(SyntaxFactory.CompilationUnit()); 220var newTree = tree.WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty); 230var tree = SyntaxFactory.SyntaxTree(SyntaxFactory.CompilationUnit()); 233var newTree = tree.WithDiagnosticOptions(map); 243var oldTree = SyntaxFactory.ParseSyntaxTree("class B {}"); 246var newTree = oldTree.WithRootAndOptions(newRoot, newOptions); 260var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 264var newTree = oldTree.WithRootAndOptions(newRoot, newOptions); 279var newTree = dummy.WithRootAndOptions(newRoot, newOptions); 287var oldTree = SyntaxFactory.ParseSyntaxTree("class B {}", path: "old.cs"); 288var newTree = oldTree.WithFilePath("new.cs"); 302var oldTree = SyntaxFactory.ParseSyntaxTree(oldText, path: "old.cs"); 304var newTree = oldTree.WithFilePath("new.cs"); 318var newTree = oldTree.WithFilePath("new.cs"); 327SyntaxTree oldTree = new CSharpSyntaxTree.DummySyntaxTree();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (55)
BasicCompilationUtils.cs (1)
36var tree = VisualBasicSyntaxTree.ParseText(SourceText.From(source, encoding: null, SourceHashAlgorithms.Default));
CompilationTestUtils.cs (2)
442internal static void VerifyTypes(this CSharpCompilation compilation, SyntaxTree tree = null) 446foreach (var syntaxTree in compilation.SyntaxTrees)
CSharpTestBase.cs (18)
767protected static T GetSyntax<T>(SyntaxTree tree, string text) 772protected static IEnumerable<T> GetSyntaxes<T>(SyntaxTree tree, string text) 1081public static SyntaxTree Parse(string text, string filename = "", CSharpParseOptions options = null, Encoding encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1) 1084public static SyntaxTree[] Parse(IEnumerable<string> sources, CSharpParseOptions options = null) 1088return new SyntaxTree[] { }; 1094public static SyntaxTree[] Parse(CSharpParseOptions options = null, params string[] sources) 1098return new SyntaxTree[] { }; 1104public static SyntaxTree ParseWithRoundTripCheck(string text, CSharpParseOptions options = null) 1106var tree = Parse(text, options: options ?? TestOptions.RegularPreview); 1335private static CSharpCompilationOptions CheckForTopLevelStatements(SyntaxTree[] syntaxTrees) 1560protected static List<SyntaxNode> GetSyntaxNodeList(SyntaxTree syntaxTree) 1671var tree = compilation.SyntaxTrees[treeIndex]; 1692var tree = compilation.SyntaxTrees[treeIndex]; 1735private static TNode FindBindingNode<TNode>(SyntaxTree tree, string startTag, string endTag) where TNode : SyntaxNode 1819internal static string GetDocumentationCommentText(CSharpCompilation compilation, string outputName = null, SyntaxTree filterTree = null, TextSpan? filterSpanWithinTree = null, bool ensureEnglishUICulture = false, params DiagnosticDescription[] expectedDiagnostics) 2026var tree = compilation.SyntaxTrees[0]; 2092var tree = compilation.SyntaxTrees[0]; 2181SyntaxTree[] testSyntaxes,
CSharpTestSource.cs (10)
34public static SyntaxTree Parse( 42var tree = SyntaxFactory.ParseSyntaxTree(stringText, options ?? TestOptions.RegularPreview, path); 46public SyntaxTree[] GetSyntaxTrees(CSharpParseOptions parseOptions, string sourceFileName = "") 61case SyntaxTree tree: 65case SyntaxTree[] trees: 72return Array.Empty<SyntaxTree>(); 82public static implicit operator CSharpTestSource(SyntaxTree source) => new CSharpTestSource(source); 83public static implicit operator CSharpTestSource(SyntaxTree[] source) => new CSharpTestSource(source); 84public static implicit operator CSharpTestSource(List<SyntaxTree> source) => new CSharpTestSource(source.ToArray()); 85public static implicit operator CSharpTestSource(ImmutableArray<SyntaxTree> source) => new CSharpTestSource(source.ToArray());
DiagnosticTestUtilities.cs (2)
75protected internal static CSharpCompilation VerifyErrorsAndGetCompilationWithMscorlib(SyntaxTree[] trees, IEnumerable<MetadataReference> refs, params ErrorDescription[] expectedErrorDesp) 83protected internal static CSharpCompilation VerifyErrorsAndGetCompilation(IEnumerable<SyntaxTree> synTrees, IEnumerable<MetadataReference> refs = null, params ErrorDescription[] expectedErrorDesp)
Extensions.cs (1)
47public static SyntaxNodeOrToken FindNodeOrTokenByKind(this SyntaxTree syntaxTree, SyntaxKind kind, int occurrence = 1)
MetadataTestHelpers.cs (1)
71var tc1 = CSharpCompilation.Create(assemblyName: "Dummy", options: options ?? TestOptions.ReleaseDll, syntaxTrees: new SyntaxTree[0], references: refs);
SemanticModelTestBase.cs (6)
21protected int GetPositionForBinding(SyntaxTree tree) 33protected List<ExpressionSyntax> GetExprSyntaxList(SyntaxTree syntaxTree) 97var tree = compilation.SyntaxTrees[0]; 128var tree = compilation.SyntaxTrees[0]; 138var tree = compilation.SyntaxTrees[0]; 154var tree = compilation.SyntaxTrees[0];
SyntaxTreeExtensions.cs (14)
17public static SyntaxTree WithReplace(this SyntaxTree syntaxTree, int offset, int length, string newText) 24public static SyntaxTree WithReplaceFirst(this SyntaxTree syntaxTree, string oldText, string newText) 32public static SyntaxTree WithReplace(this SyntaxTree syntaxTree, int startIndex, string oldText, string newText) 40public static SyntaxTree WithInsertAt(this SyntaxTree syntaxTree, int offset, string newText) 45public static SyntaxTree WithInsertBefore(this SyntaxTree syntaxTree, string existingText, string newText) 52public static SyntaxTree WithRemoveAt(this SyntaxTree syntaxTree, int offset, int length) 57public static SyntaxTree WithRemoveFirst(this SyntaxTree syntaxTree, string oldText)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
CodeGen\WinMdEventTests.cs (1)
669var tree = comp.SyntaxTrees[0];
CodeGen\WinRTCollectionTests.cs (1)
7421var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (129)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
34var syntaxTree = semanticModel.SyntaxTree;
ExternalAccess\Pythia\Api\PythiaSyntaxExtensions.cs (2)
13public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 19public static SyntaxToken FindTokenOnLeftOfPosition(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool includeSkipped = true, bool includeDirectives = false, bool includeDocumentationComments = false)
Rename\CSharpRenameRewriterLanguageService.cs (1)
866var tree = location.SourceTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
20public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var syntaxTree = genericIdentifier.SyntaxTree!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (29)
17public static ISet<SyntaxKind> GetPrecedingModifiers(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 21this SyntaxTree syntaxTree, 42this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 48this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 54this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 80this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 92public static bool IsRightOfDotOrArrowOrColonColon(this SyntaxTree syntaxTree, int position, SyntaxToken targetToken, CancellationToken cancellationToken) 99public static bool IsRightOfDotOrArrow(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 102public static bool IsRightOfDot(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken) 119public static bool IsRightOfNumericLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 125public static bool IsAfterKeyword(this SyntaxTree syntaxTree, int position, SyntaxKind kind, CancellationToken cancellationToken) 133public static bool IsEntirelyWithinNonUserCodeComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 145public static bool IsEntirelyWithinComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 155public static bool IsCrefContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 168public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 180this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 224this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 242this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 259this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 273this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 297this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 382this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 389public static bool IsEntirelyWithinStringLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 393this SyntaxTree syntaxTree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken) 442this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 470this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 532public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 540public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
154this SyntaxTrivia trivia, SyntaxTree syntaxTree, CancellationToken cancellationToken, bool findInsideTrivia = false)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
120public bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 124public bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken) 1103public TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1536public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
298var tree = token1.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
184var tree = semanticModel.SyntaxTree; 195var newTree = tree.WithRootAndOptions(newRoot, tree.Options);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (3)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options); 202var contextTree = contextLocation != null && contextLocation.IsInSource
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (7)
185var syntaxTree = semanticModel.SyntaxTree; 355var modifiers = SyntaxTree.GetPrecedingModifiers(positionBeforeRecordKeyword, cancellationToken); 377if (SyntaxTree.IsMemberDeclarationContext( 427=> IsGlobalStatementContext && SyntaxTree.Options.Kind is SourceCodeKind.Regular; 462return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken); 464else if (SyntaxTree.IsScript() 469return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (63)
28public static bool IsAttributeNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 77this SyntaxTree syntaxTree, 137this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 239this SyntaxTree syntaxTree, 319this SyntaxTree syntaxTree, 335public static bool IsLocalFunctionDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 339this SyntaxTree syntaxTree, 368this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 528this SyntaxTree syntaxTree, 614this SyntaxTree syntaxTree, 668public static bool IsNamespaceDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 685public static bool IsPartialTypeDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, [NotNullWhen(true)] out TypeDeclarationSyntax? declarationSyntax) 707public static bool IsDefinitelyNotTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 718this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 768public static bool IsBaseClassOrInterfaceContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 786public static bool IsUsingAliasTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 802public static bool IsUsingStaticContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 814this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 842this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 860public static bool IsTypeParameterConstraintContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 891public static bool IsTypeOfExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 903public static bool IsDefaultExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 916this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 929this SyntaxTree syntaxTree, 954public static bool IsGenericConstraintContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 959this SyntaxTree syntaxTree, 1047this SyntaxTree syntaxTree, 1137this SyntaxTree syntaxTree, 1165this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1180this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1194public static bool IsParameterTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1211public static bool IsPossibleExtensionMethodContext(this SyntaxTree syntaxTree, SyntaxToken tokenOnLeftOfPosition) 1223this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1255this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1282this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1307public static bool IsPossibleTupleContext(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1362public static bool IsAtStartOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1456public static bool IsAtEndOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1599public static bool IsPossibleDeconstructionDesignation(this SyntaxTree syntaxTree, 1709this SyntaxTree syntaxTree, 1749this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1766this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1880this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1897public static bool IsCatchVariableDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1914public static bool IsIsOrAsTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1926this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1944private static bool IsNonConstantExpressionContext(SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1951public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1958public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1976public static bool IsGlobalStatementContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1999public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2030this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 2043public static bool IsDefiniteCastTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2057public static bool IsConstantExpressionContext(this SyntaxTree syntaxTree, int position, 2137public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2163this SyntaxTree syntaxTree, 2741public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2808this SyntaxTree syntaxTree, 2928this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2963public static bool IsCatchFilterContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2988public static bool IsEnumBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3000public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 3055public static bool IsFunctionPointerCallingConventionContext(this SyntaxTree syntaxTree, SyntaxToken targetToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
15public static bool IsPrimaryFunctionExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 23public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 33this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 39this SyntaxTree syntaxTree, 48this SyntaxTree syntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
28public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
192var syntaxTree = SemanticModel.SyntaxTree;
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (2)
58public override SyntaxTree CreateSyntaxTree(string filePath, ParseOptions options, SourceText text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root) 64public override SyntaxTree ParseSyntaxTree(string filePath, ParseOptions options, SourceText text, CancellationToken cancellationToken)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.NodeSyntaxReference.cs (1)
21public override SyntaxTree SyntaxTree
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (2)
76public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 87public override SyntaxTree WithFilePath(string path)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\AddImportsTests.cs (1)
833var tree = CSharpSyntaxTree.ParseText(code);
CodeGeneration\SyntaxGeneratorTests.cs (1)
4989var tree = compilation.SyntaxTrees.Single();
CSharpSyntaxFactsServiceTests.cs (1)
18var tree = SyntaxFactory.ParseSyntaxTree(code);
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
121var tree = SyntaxFactory.ParseSyntaxTree(text);
Formatting\FormattingMultipleSpanTests.cs (1)
167var syntaxTree = await document.GetSyntaxTreeAsync();
Microsoft.CodeAnalysis.EditorFeatures (7)
CommentSelection\AbstractCommentSelectionBase.cs (1)
149var oldSyntaxTree = document.GetSyntaxTreeSynchronously(cancellationToken);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (3)
185var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 191var syntaxTreeWithOriginalName = syntaxTree.WithChangedText(newFullText); 208var syntaxTreeWithOriginalName = await documentWithOriginalName.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (1)
169var syntaxTree = await document.GetSyntaxTreeAsync(_cancellationToken).ConfigureAwait(false);
Shared\Utilities\VirtualTreePoint.cs (2)
14public VirtualTreePoint(SyntaxTree tree, SourceText text, int position, int virtualSpaces = 0) 49public SyntaxTree Tree { get; }
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
Formatting\CoreFormatterTestsBase.cs (2)
281/// Asserts formatting on an arbitrary <see cref="SyntaxNode"/> that is not part of a <see cref="SyntaxTree"/> 284/// <remarks>uses an <see cref="AdhocWorkspace"/> for formatting context, since the <paramref name="node"/> is not associated with a <see cref="SyntaxTree"/> </remarks>
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
68private static void CheckSpans(SyntaxTree tree, IList<TextSpan> expectedHighlightSpans, List<TextSpan> highlightSpans)
Semantics\SpeculationAnalyzerTestsBase.cs (4)
35var initialTree = Parse(UnderTestRegex.Replace(code, m => m.Groups["content"].Value)); 38var replacementTree = Parse(UnderTestRegex.Replace(code, replacementExpression)); 59protected abstract SyntaxTree Parse(string text); 63protected abstract Compilation CreateCompilation(SyntaxTree tree);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeFixes\CodeFixServiceTests.cs (1)
613foreach (var tree in context.Compilation.SyntaxTrees)
CodeGeneration\CodeGenerationTests.cs (1)
844public SyntaxTree SyntaxTree;
Utilities\SymbolEquivalenceComparerTests.cs (2)
1833var c1 = (Compilation)CS.CSharpCompilation.Create("comp1", Array.Empty<SyntaxTree>(), [NetFramework.mscorlib, r1]); 1834var c2 = (Compilation)CS.CSharpCompilation.Create("comp2", Array.Empty<SyntaxTree>(), [NetFramework.mscorlib, r2]);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Interactive\AbstractInteractiveWindowCommandCompletionProvider.cs (1)
18protected abstract bool ShouldDisplayCommandCompletions(SyntaxTree tree, int position, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Diagnostics\DiagnosticServiceTests.vb (2)
2497Public AnalyzedTrees As List(Of SyntaxTree) = New List(Of SyntaxTree)()
FindReferences\FindReferencesTests.vb (1)
473Private Shared Function GetFilePathAndProjectLabel(solution As Solution, syntaxTree As SyntaxTree) As String
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
DocumentationComments\OmniSharpDocumentationCommentsSnippetService.cs (2)
18SyntaxTree syntaxTree, 30SyntaxTree syntaxTree,
Microsoft.CodeAnalysis.ExternalAccess.Razor (2)
RazorBreakpointSpans.cs (1)
13public static bool TryGetBreakpointSpan(SyntaxTree tree, int position, CancellationToken cancellationToken, out TextSpan breakpointSpan)
RazorCSharpProximityExpressionResolverService.cs (1)
13public static IList<string> GetProximityExpressions(SyntaxTree syntaxTree, int absoluteIndex, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (97)
ChangeSignature\AbstractChangeSignatureService.cs (1)
458var tree = location.SourceTree;
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
431var diagnosticSourceTree = _diagnostic?.Location.SourceTree;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
84var t = await document.GetSyntaxTreeAsync(c).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
267var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
69var currentTree = await currentDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
137var tree = removeSuppressionFixesForTree.Key;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
60public abstract SyntaxTree SyntaxTreeToModify { get; }
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
50public override SyntaxTree SyntaxTreeToModify => _attribute.ApplicationSyntaxReference.SyntaxTree;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (2)
62public override SyntaxTree SyntaxTreeToModify => _suppressionTargetInfo.StartToken.SyntaxTree; 204var tree = model.SyntaxTree;
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
96var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
CodeRefactorings\MoveType\AbstractMoveTypeService.State.cs (1)
53var tree = SemanticDocument.SyntaxTree;
Completion\Providers\AbstractAwaitCompletionProvider.cs (3)
64protected abstract SyntaxNode? GetExpressionToPlaceAwaitInFrontOf(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 65protected abstract SyntaxToken? GetDotTokenLeftOfPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 256var syntaxTree = syntaxContext.SyntaxTree;
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
20protected abstract bool IsInstanceContext(SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken);
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
60var syntaxTree = await context.Document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractKeywordCompletionProvider.cs (1)
57var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
36protected abstract SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken);
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
23protected abstract SyntaxNode? GetObjectCreationNewExpression(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
20protected abstract HashSet<string> GetInitializedMembers(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.BaseItemGetter.cs (2)
33protected readonly SyntaxTree SyntaxTree; 41SyntaxTree syntaxTree,
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
18public abstract SyntaxToken FindStartingToken(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (2)
21SyntaxTree syntaxTree, 132var root = SyntaxTree.GetRoot(CancellationToken);
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
36protected abstract bool IsPartialMethodCompletionContext(SyntaxTree tree, int position, CancellationToken cancellationToken, out DeclarationModifiers modifiers, out SyntaxToken token);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
77protected abstract SyntaxNode? GetPartialTypeSyntaxNode(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
24protected abstract bool TryGetStringLiteralToken(SyntaxTree tree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (7)
21protected abstract TMemberNode? GetContainingMember(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 27protected abstract SyntaxToken GetTokenToRight(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 28protected abstract SyntaxToken GetTokenToLeft(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 79var syntaxTree = document.SyntaxTree; 198var syntaxTree = document.SyntaxTree; 275var syntaxTree = document.SyntaxTree; 366var syntaxTree = document.SyntaxTree;
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
306var tree = location.SourceTree;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (7)
82internal abstract bool ExperimentalFeaturesEnabled(SyntaxTree tree); 537SyntaxTree? oldTree; 555var newTree = await newDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 1334private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldStatement, SyntaxTree newTree, TextSpan newSpan, ArrayBuilder<RudeEditDiagnostic> diagnostics, CancellationToken cancellationToken) 1584private ActiveStatementExceptionRegions GetExceptionRegions(List<SyntaxNode> exceptionHandlingAncestors, SyntaxTree tree, CancellationToken cancellationToken) 2045var oldTree = topMatch.OldRoot.SyntaxTree; 2046var newTree = topMatch.NewRoot.SyntaxTree;
EditAndContinue\AbstractSimpleMemberBody.cs (1)
17public sealed override SyntaxTree SyntaxTree
EditAndContinue\ActiveStatementsMap.cs (4)
45private ImmutableDictionary<SyntaxTree, ImmutableArray<UnmappedActiveStatement>> _lazyOldDocumentActiveStatements; 56_lazyOldDocumentActiveStatements = ImmutableDictionary<SyntaxTree, ImmutableArray<UnmappedActiveStatement>>.Empty; 180internal ImmutableArray<UnmappedActiveStatement> GetOldActiveStatements(IEditAndContinueAnalyzer analyzer, SyntaxTree oldSyntaxTree, SourceText oldText, SyntaxNode oldRoot, CancellationToken cancellationToken) 190private ImmutableArray<UnmappedActiveStatement> CalculateOldActiveStatementsAndExceptionRegions(IEditAndContinueAnalyzer analyzer, SyntaxTree oldTree, SourceText oldText, SyntaxNode oldRoot, CancellationToken cancellationToken)
EditAndContinue\DeclarationBody.cs (1)
16public abstract SyntaxTree SyntaxTree { get; }
EditAndContinue\RudeEditDiagnostic.cs (1)
41internal Diagnostic ToDiagnostic(SyntaxTree tree)
EditAndContinue\SemanticEditInfo.cs (2)
18public readonly SyntaxTree NewTree; 24SyntaxTree newTree,
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (1)
196SyntaxTree? tree = null;
ExtractMethod\MethodExtractor.VariableSymbol.cs (1)
247var tree = _localSymbol.Locations[0].SourceTree;
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (1)
57var syntaxTree = await _document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.State.cs (1)
304var sourceTreeToBeGeneratedIn = symbol.Locations.First(loc => loc.IsInSource).SourceTree;
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (1)
67var syntaxTree = semanticModel.SyntaxTree;
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
118protected SemanticModel GetSemanticModel(SyntaxTree tree)
NavigationBar\AbstractNavigationBarItemService.cs (3)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan) 50Solution solution, ISymbol symbol, SyntaxTree tree, 91Solution solution, ISymbol symbol, SyntaxTree tree, ISymbolDeclarationService symbolDeclarationService)
QuickInfo\CommonQuickInfoProvider.cs (1)
47protected async Task<ImmutableArray<SyntaxToken>> GetTokensAsync(SyntaxTree tree, int position, System.Threading.CancellationToken cancellationToken)
Shared\Utilities\AnnotatedSymbolMapping.cs (2)
54using var _1 = PooledDictionary<SyntaxTree, SyntaxNode>.GetInstance(out var currentRoots); 70var tree = location.SourceTree!;
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
56var syntaxTree = context.SyntaxContext.SyntaxTree;
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (3)
109SyntaxTree tree, 117SyntaxTree tree, 147SyntaxTree tree,
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (1)
98internal Location GetLocation(SyntaxTree syntaxTree)
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
46var tree = context.Tree;
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (2)
60var sourceTree = symbolContext.Symbol.Locations.FirstOrDefault()?.SourceTree; 114SyntaxTree sourceTree,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
65var tree = model.SyntaxTree;
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (4)
87var tree = context.SemanticModel.SyntaxTree; 194IEnumerable<TextSpan> contiguousSpans, SyntaxTree tree, 209IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken); 212IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
98var tree = semanticModel.SyntaxTree; 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 508SyntaxTree tree, 545SyntaxTree tree,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
111protected abstract bool SupportsDiscard(SyntaxTree tree); 202private bool TryGetOptions(SyntaxTree syntaxTree, AnalyzerOptions analyzerOptions, CompilationOptions compilationOptions, CancellationToken cancellationToken, out Options options)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
163var tree = model.SyntaxTree; 222private readonly ConcurrentDictionary<SyntaxTree, (StrongBox<bool> completed, TextSpanMutableIntervalTree? intervalTree)> _codeBlockIntervals = [];
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
27var syntaxTree = match.SyntaxTree;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
79var syntaxTree = assignment.SyntaxTree;
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
140var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
21protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 70var syntaxTree = result.Item1;
Structure\BlockStructureContext.cs (2)
13internal readonly struct BlockStructureContext(SyntaxTree syntaxTree, BlockStructureOptions options, CancellationToken cancellationToken) : IDisposable 21public readonly SyntaxTree SyntaxTree = syntaxTree;
Structure\BlockStructureServiceWithProviders.cs (2)
51var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 57SyntaxTree syntaxTree,
Wrapping\Edit.cs (1)
77private readonly SyntaxTree? _tree = left.SyntaxTree;
Microsoft.CodeAnalysis.Features.Test.Utilities (13)
EditAndContinue\ActiveStatementsDescription.cs (6)
36public ActiveStatementsDescription(string oldMarkedSource, string newMarkedSource, Func<string, SyntaxTree> syntaxTreeFactory, ActiveStatementFlags[]? flags) 41var oldTree = syntaxTreeFactory(oldSource); 42var newTree = syntaxTreeFactory(newSource); 95SyntaxTree tree, 132Func<string, string, SyntaxTree> syntaxTreeFactory, 146var tree = syntaxTreeFactory(SourceMarkers.Clear(markedSource), documentName);
EditAndContinue\EditAndContinueTestAnalyzerConfigOptionsProvider.cs (1)
17public override AnalyzerConfigOptions GetOptions(SyntaxTree tree)
EditAndContinue\EditAndContinueTestVerifier.cs (4)
57SyntaxTree oldTree, 58SyntaxTree newTree, 467private static void AssertSpansEqual(IEnumerable<SourceFileSpan> expected, IEnumerable<SourceFileSpan> actual, SyntaxTree newTree) 476private static string DisplaySpan(SyntaxTree tree, SourceFileSpan span)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
414foreach (var syntaxTree in context.Compilation.SyntaxTrees)
EditAndContinue\RuntimeRudeEditDescription.cs (1)
13public string GetMessage(SyntaxTree tree)
Microsoft.CodeAnalysis.Features.UnitTests (11)
EditAndContinue\EditAndContinueMethodDebugInfoReaderTests.cs (1)
63var tree = CSharpTestSource.Parse(source, path: "/a/c.cs", options: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), checksumAlgorithm: SourceHashAlgorithm.Sha1);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (3)
68var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path); 69var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path); 70var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
EditAndContinue\RudeEditDiagnosticTests.cs (1)
22var tree = SyntaxFactory.ParseCompilationUnit("class C { }").SyntaxTree;
FindUsages\DefinitionItemFactoryTests.cs (6)
929var tree = await document.GetSyntaxTreeAsync(); 1334var tree = await document.GetSyntaxTreeAsync(); 1394var tree = await document.GetSyntaxTreeAsync(); 1445var tree = await document.GetSyntaxTreeAsync(); 1509var tree = await document.GetSyntaxTreeAsync(); 1580var tree = await document.GetSyntaxTreeAsync();
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
261var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (3)
261var tree = changedMember.SyntaxTree; 292SyntaxTree tree, 377static DiagnosticData UpdateLocations(DiagnosticData diagnostic, SyntaxTree tree, SourceText text, int delta)
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
60var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\NonLocalDiagnosticTests.cs (2)
89foreach (var tree in compilation.SyntaxTrees) 102foreach (var tree in compilation.SyntaxTrees)
Microsoft.CodeAnalysis.Rebuild (12)
CompilationFactory.cs (3)
43public abstract SyntaxTree CreateSyntaxTree(string filePath, SourceText sourceText); 52ImmutableArray<SyntaxTree> syntaxTrees, 69ImmutableArray<SyntaxTree> syntaxTrees,
CompilationOptionsReader.cs (5)
287public (ImmutableArray<SyntaxTree> SyntaxTrees, ImmutableArray<MetadataReference> MetadataReferences) ResolveArtifacts( 289Func<string, SourceText, SyntaxTree> createSyntaxTreeFunc) 295ImmutableArray<SyntaxTree> ResolveSyntaxTrees() 298var builder = ImmutableArray.CreateBuilder<SyntaxTree>(sourceFileCount); 315var syntaxTree = createSyntaxTreeFunc(sourceTextInfo.OriginalSourceFilePath, sourceText);
CSharpCompilationFactory.cs (2)
44public override SyntaxTree CreateSyntaxTree(string filePath, SourceText sourceText) 48ImmutableArray<SyntaxTree> syntaxTrees,
VisualBasicCompilationFactory.cs (2)
44public override SyntaxTree CreateSyntaxTree(string filePath, SourceText sourceText) 48ImmutableArray<SyntaxTree> syntaxTrees,
Microsoft.CodeAnalysis.Rebuild.UnitTests (24)
BasicDeterministicKeyBuilderTests.cs (5)
30protected override SyntaxTree ParseSyntaxTree(string content, string fileName, SourceHashAlgorithm hashAlgorithm, VisualBasicParseOptions? parseOptions) => 36protected override VisualBasicCompilation CreateCompilation(SyntaxTree[] syntaxTrees, MetadataReference[]? references = null, VisualBasicCompilationOptions? options = null) 80var syntaxTree = VisualBasicSyntaxTree.ParseText( 109var syntaxTree = VisualBasicSyntaxTree.ParseText( 239Array.Empty<SyntaxTree>(),
CSharpDeterministicKeyBuilderTests.cs (6)
27protected override SyntaxTree ParseSyntaxTree(string content, string fileName, SourceHashAlgorithm hashAlgorithm, CSharpParseOptions? parseOptions) => 35protected override CSharpCompilation CreateCompilation(SyntaxTree[] syntaxTrees, MetadataReference[]? references = null, CSharpCompilationOptions? options = null) => 152var source = CSharpTestBase.Parse( 188var syntaxTree = CSharpTestBase.Parse( 417var compilation = CreateCompilation(new SyntaxTree[] { }, options: options); 430Array.Empty<SyntaxTree>(),
DeterministicKeyBuilderTests.cs (13)
170var compilation = CreateCompilation(syntaxTrees: new SyntaxTree[] { }, options: (TCompilationOptions)options); 183var syntaxTree = ParseSyntaxTree("", fileName: "test", SourceHashAlgorithm.Sha256, (TParseOptions)parseOptions); 184var compilation = CreateCompilation(syntaxTrees: new SyntaxTree[] { syntaxTree }); 200var compilation = CreateCompilation(syntaxTrees: new SyntaxTree[] { }, references: new[] { reference }); 244var compilation = CreateCompilation(new SyntaxTree[] { }); 261protected abstract SyntaxTree ParseSyntaxTree(string content, string fileName, SourceHashAlgorithm hashAlgorithm, TParseOptions? parseOptions = null); 264SyntaxTree[] syntaxTrees, 282var syntaxTree = ParseSyntaxTree(content, fileName: "file.cs", hashAlgorithm); 351var compilation = CreateCompilation(syntaxTrees: new SyntaxTree[] { }, options: options); 734CreateCompilation(new SyntaxTree[] { }), 759CreateCompilation(new SyntaxTree[] { }), 778CreateCompilation(Array.Empty<SyntaxTree>()), 804CreateCompilation(Array.Empty<SyntaxTree>()),
Microsoft.CodeAnalysis.Scripting (3)
Hosting\CommandLine\CommandLineRunner.cs (1)
260var tree = _scriptCompiler.ParseSubmission(SourceText.From(input.ToString()), options.ParseOptions, cancellationToken);
ScriptCompiler.cs (2)
20public abstract SyntaxTree ParseSubmission(SourceText text, ParseOptions parseOptions, CancellationToken cancellationToken); 21public abstract bool IsCompleteSubmission(SyntaxTree tree);
Microsoft.CodeAnalysis.Test.Utilities (39)
AssemblyLoadTestFixture.cs (1)
532syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(SourceText.From(csSource, encoding: null, SourceHashAlgorithms.Default)) },
CommonTestBase.cs (2)
388var tree = CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From(code, encoding: null, SourceHashAlgorithms.Default), options: parseOptions); 475var trees = new SyntaxTree[files.Length];
Compilation\CompilationExtensions.cs (3)
201SyntaxTree tree = compilation.SyntaxTrees.First(); 287foreach (var tree in compilation.SyntaxTrees) 392internal static void VerifyChildNodePositions(this SyntaxTree tree)
Compilation\TestSyntaxTreeOptionsProvider.cs (9)
15private readonly Dictionary<SyntaxTree, Dictionary<string, ReportDiagnostic>>? _options; 16private readonly Dictionary<SyntaxTree, GeneratedKind>? _isGenerated; 21params (SyntaxTree, (string, ReportDiagnostic)[])[] options) 38params (SyntaxTree, (string, ReportDiagnostic)[])[] options) 44params (SyntaxTree, (string, ReportDiagnostic)[])[] options) 49SyntaxTree tree, params (string, ReportDiagnostic)[] options) 54params (SyntaxTree, GeneratedKind isGenerated)[] isGenerated 64public override GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken cancellationToken) 68SyntaxTree tree,
Diagnostics\CommonDiagnosticAnalyzers.cs (17)
105var tree = compilation.SyntaxTrees.First(); 183var tree = compilation.SyntaxTrees.First(); 260var tree = compilation.SyntaxTrees.First(); 313var tree = compilation.SyntaxTrees.First(); 941public AnalyzerWithInvalidDiagnosticLocation(SyntaxTree treeInAnotherCompilation, ActionKind actionKind, bool testInvalidAdditionalLocation) 1079foreach (var tree in context.Compilation.SyntaxTrees) 1663private void ReportTreeDiagnostics(SyntaxTree tree, Action<Diagnostic> addDiagnostic) 1718private readonly HashSet<SyntaxTree> _treeCallbackSet; 1758_treeCallbackSet = new HashSet<SyntaxTree>(SyntaxTreeComparer.Instance); 1764private bool IsGeneratedCode(SyntaxTree tree) 2825foreach (var tree in trees) 2832private static void ReportDiagnosticsInAllTrees(string actionName, SyntaxTree analyzedTree, Compilation compilation, Action<Diagnostic> reportDiagnostic) 2835foreach (var tree in compilation.SyntaxTrees) 2841private static void ReportDiagnostics(string actionName, SyntaxTree tree, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic) 2847private static void ReportDiagnosticsInTreeCore(string arg, SyntaxTree tree, Action<Diagnostic> reportDiagnostic) 2982public readonly List<SyntaxTree> AnalyzedTrees = new(); 3093public SyntaxTree CallbackFilterTree { get; private set; }
MarkedSource\SourceWithMarkedNodes.cs (2)
41public SourceWithMarkedNodes(string markedSource, Func<string, SyntaxTree> parser, Func<string, int> getSyntaxKind, bool removeTags = false) 50public SyntaxTree Tree => Root.SyntaxTree;
Syntax\XmlHelpers.cs (4)
98public static XElement ToXml(this SyntaxNodeOrToken node, SyntaxTree syntaxTree, XmlOptions options = null) 113public static XElement ToXml(this SyntaxNode node, SyntaxTree syntaxTree, XmlOptions options = null) 157public static XElement ToXml(this SyntaxToken token, SyntaxTree syntaxTree, XmlOptions options = null) 210public static XElement ToXml(this SyntaxTrivia trivia, SyntaxTree syntaxTree, XmlOptions options = null)
TestBase.cs (1)
192var syntaxTree = Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From(source, encoding: null, SourceHashAlgorithms.Default));
Microsoft.CodeAnalysis.UnitTests (20)
Analyzers\AnalyzerConfigTests.cs (6)
966SyntaxTree.EmptyDiagnosticOptions 1016SyntaxTree.EmptyDiagnosticOptions 1043SyntaxTree.EmptyDiagnosticOptions 1540SyntaxTree.EmptyDiagnosticOptions 1574SyntaxTree.EmptyDiagnosticOptions 2055SyntaxTree.EmptyDiagnosticOptions,
Diagnostics\AnalysisContextInfoTests.cs (1)
113var syntaxTree = CSharpSyntaxTree.ParseText(source, path: fileName, options: parseOptions);
Diagnostics\OperationTests.cs (1)
274var tree = CSharpTestSource.Parse(source);
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
73var syntaxTree = language == LanguageNames.CSharp ?
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (4)
382var syntaxTree = CreateSyntaxTree(source, LanguageNames.CSharp); 1344var syntaxTree = CreateSyntaxTree(source, language); 1425private static Compilation CreateCompilation(SyntaxTree syntaxTree, string language, string rootNamespace) 1451private static SyntaxTree CreateSyntaxTree(string source, string language)
GivesAccessTo.cs (4)
22var csharpTree = CSharpTestSource.Parse(@" 29var csharpTree2 = CSharpTestSource.Parse(@" 34var vbTree = BasicTestSource.Parse(@" 40var vbTree2 = BasicTestSource.Parse(@"
IsSymbolAccessibleWithinTests.cs (2)
23var csharpTree = CSharpTestSource.Parse("class A { }"); 24var vbTree = BasicTestSource.Parse(
Symbols\DocumentationCommentIdTests.cs (1)
174var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.VisualBasic (314)
Binding\AttributeBinder.vb (1)
20Public Sub New(containingBinder As Binder, tree As SyntaxTree, Optional node As VisualBasicSyntaxNode = Nothing)
Binding\Binder.vb (3)
58Private ReadOnly _syntaxTree As SyntaxTree 78Protected Sub New(containingBinder As Binder, syntaxTree As SyntaxTree) 673Public ReadOnly Property SyntaxTree As SyntaxTree
Binding\Binder_Attributes.vb (1)
86Protected Function IsAttributeConditionallyOmitted(attributeType As NamedTypeSymbol, node As AttributeSyntax, syntaxTree As SyntaxTree) As Boolean
Binding\Binder_Delegates.vb (1)
446Dim syntaxTree As SyntaxTree
Binding\Binder_XmlLiterals.vb (1)
2001Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Binding\BinderBuilder.vb (11)
46tree As SyntaxTree) As Binder 64tree As SyntaxTree) As Binder 86tree As SyntaxTree) As Binder 152tree As SyntaxTree) As Binder 173tree As SyntaxTree, 228tree As SyntaxTree, 270tree As SyntaxTree, 304Public Shared Function CreateBinderForAttribute(tree As SyntaxTree, containingBinder As Binder, node As VisualBasicSyntaxNode) As AttributeBinder 309tree As SyntaxTree, 390tree As SyntaxTree, 414tree As SyntaxTree,
Binding\BinderFactory.vb (2)
22Private ReadOnly _tree As SyntaxTree 40Public Sub New(sourceModule As SourceModuleSymbol, tree As SyntaxTree, Optional binderFactoryVisitorPoolOpt As ObjectPool(Of BinderFactoryVisitor) = Nothing)
Binding\MemberSemanticModel.vb (1)
1190Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Binding\ProjectImportsBinder.vb (2)
28Private ReadOnly _tree As SyntaxTree 30Public Sub New(containingBinder As Binder, tree As SyntaxTree)
Binding\SourceFileBinder.vb (1)
29Public Sub New(containingBinder As Binder, sourceFile As SourceFile, tree As SyntaxTree)
BoundTree\BoundNode.vb (1)
98Public ReadOnly Property SyntaxTree As SyntaxTree
CodeGen\CodeGenerator.vb (1)
298Private Function EmitSequencePoint(tree As SyntaxTree, span As TextSpan) As TextSpan
CommandLine\VisualBasicCompiler.vb (3)
60errorLogger As ErrorLogger) As SyntaxTree 100Dim trees(sourceFiles.Length - 1) As SyntaxTree 268tree As SyntaxTree,
Compilation\ClsComplianceChecker.vb (3)
26Private ReadOnly _filterTree As SyntaxTree 40Private Sub New(compilation As VisualBasicCompilation, filterTree As SyntaxTree, filterSpanWithinTree As TextSpan?, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken) 72Public Shared Sub CheckCompliance(compilation As VisualBasicCompilation, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken, Optional filterTree As SyntaxTree = Nothing, Optional filterSpanWithinTree As TextSpan? = Nothing)
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (2)
403symbolName As String, symbol As Symbol, tree As SyntaxTree) 760tree As SyntaxTree,
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (4)
31Private ReadOnly _tree As SyntaxTree 32Private ReadOnly _onlyDiagnosticsFromTree As SyntaxTree 47onlyDiagnosticsFromTree As SyntaxTree, 156onlyDiagnosticsFromTree As SyntaxTree,
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (3)
27Private ReadOnly _filterSyntaxTree As SyntaxTree ' if not null, limit analysis to types residing in this tree 37filterTree As SyntaxTree, filterSpanWithinTree As TextSpan?, 66Optional filterTree As SyntaxTree = Nothing,
Compilation\DocumentationComments\DocumentationCommentWalker.vb (2)
32Private ReadOnly _syntaxTree As SyntaxTree 39syntaxTree As SyntaxTree,
Compilation\DocumentationComments\UnprocessedDocumentationCommentFinder.vb (1)
43Public Shared Sub ReportUnprocessed(tree As SyntaxTree, filterSpanWithinTree As TextSpan?, diagnostics As DiagnosticBag, cancellationToken As CancellationToken)
Compilation\MethodCompiler.vb (2)
122Private Shared Function IsDefinedOrImplementedInSourceTree(symbol As Symbol, tree As SyntaxTree, span As TextSpan?) As Boolean 159tree As SyntaxTree,
Compilation\SemanticModel.vb (2)
2875Public MustOverride Shadows ReadOnly Property SyntaxTree As SyntaxTree 3067Protected NotOverridable Overrides ReadOnly Property SyntaxTreeCore As SyntaxTree
Compilation\SpeculativeSemanticModelWithMemberModel.vb (1)
89Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (1)
69Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Compilation\SyntaxTreeSemanticModel.vb (3)
29Private ReadOnly _syntaxTree As SyntaxTree 36Friend Sub New(compilation As VisualBasicCompilation, sourceModule As SourceModuleSymbol, syntaxTree As SyntaxTree, ignoreAccessibility As Boolean) 65Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Compilation\VisualBasicCompilation.vb (87)
54Private Shared ReadOnly s_myTemplateCache As ConcurrentLruCache(Of VisualBasicParseOptions, SyntaxTree) = 55New ConcurrentLruCache(Of VisualBasicParseOptions, SyntaxTree)(capacity:=5) 88Private ReadOnly _syntaxTrees As ImmutableArray(Of SyntaxTree) 90Private ReadOnly _syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer) 96Private _lazyAllSyntaxTrees As ImmutableArray(Of SyntaxTree) 102Private ReadOnly _rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry) 105''' Imports appearing in <see cref="SyntaxTree"/>s in this compilation. 112Private _lazyImportClauseDependencies As ConcurrentDictionary(Of (SyntaxTree As SyntaxTree, ImportsClausePosition As Integer), ImmutableArray(Of AssemblySymbol)) 131Public ReadOnly Tree As Lazy(Of SyntaxTree) 134Public Sub New(treeOpt As Func(Of SyntaxTree), rootNamespaceOpt As Func(Of RootSingleNamespaceDeclaration)) 135Me.Tree = New Lazy(Of SyntaxTree)(treeOpt) 167Private _lazyMyTemplate As SyntaxTree = VisualBasicSyntaxTree.Dummy 179Private _lazyCompilationUnitCompletedTrees As HashSet(Of SyntaxTree) 240Friend Property MyTemplate As SyntaxTree 250Dim tree As SyntaxTree = Nothing 287Set(value As SyntaxTree) 326Optional syntaxTrees As IEnumerable(Of SyntaxTree) = Nothing, 332If(syntaxTrees IsNot Nothing, syntaxTrees.Cast(Of SyntaxTree), Nothing), 345Optional syntaxTree As SyntaxTree = Nothing, 358If((syntaxTree IsNot Nothing), {syntaxTree}, SpecializedCollections.EmptyEnumerable(Of SyntaxTree)()), 369syntaxTrees As IEnumerable(Of SyntaxTree), 386Dim declMap = ImmutableDictionary.Create(Of SyntaxTree, DeclarationTableEntry)() 393ImmutableArray(Of SyntaxTree).Empty, 394ImmutableDictionary.Create(Of SyntaxTree, Integer)(), 420syntaxTrees As ImmutableArray(Of SyntaxTree), 421syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer), 422rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 440Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer(Of SyntaxTree).Default)) 486Private Function CommonLanguageVersion(syntaxTrees As ImmutableArray(Of SyntaxTree)) As LanguageVersion 526syntaxTrees As ImmutableArray(Of SyntaxTree), 527syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer), 528rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 636declMap = ImmutableDictionary.Create(Of SyntaxTree, DeclarationTableEntry)() 878Public Shadows ReadOnly Property SyntaxTrees As ImmutableArray(Of SyntaxTree) 888Friend Shadows ReadOnly Property AllSyntaxTrees As ImmutableArray(Of SyntaxTree) 891Dim builder = ArrayBuilder(Of SyntaxTree).GetInstance() 909Public Shadows Function ContainsSyntaxTree(syntaxTree As SyntaxTree) As Boolean 913Public Shadows Function AddSyntaxTrees(ParamArray trees As SyntaxTree()) As VisualBasicCompilation 914Return AddSyntaxTrees(DirectCast(trees, IEnumerable(Of SyntaxTree))) 917Public Shadows Function AddSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As VisualBasicCompilation 931Dim builder = ArrayBuilder(Of SyntaxTree).GetInstance() 943For Each tree As SyntaxTree In trees 977tree As SyntaxTree, 980ByRef declMap As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 991Private Shared Function ForTree(tree As SyntaxTree, options As VisualBasicCompilationOptions, isSubmission As Boolean) As RootSingleNamespaceDeclaration 995Public Shadows Function RemoveSyntaxTrees(ParamArray trees As SyntaxTree()) As VisualBasicCompilation 996Return RemoveSyntaxTrees(DirectCast(trees, IEnumerable(Of SyntaxTree))) 999Public Shadows Function RemoveSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As VisualBasicCompilation 1009Dim removeSet As New HashSet(Of SyntaxTree)() 1013For Each tree As SyntaxTree In trees 1032Dim ordinalMap = ImmutableDictionary.Create(Of SyntaxTree, Integer)() 1033Dim builder = ArrayBuilder(Of SyntaxTree).GetInstance() 1048tree As SyntaxTree, 1049ByRef declMap As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 1064Return UpdateSyntaxTrees(ImmutableArray(Of SyntaxTree).Empty, 1065ImmutableDictionary.Create(Of SyntaxTree, Integer)(), 1066ImmutableDictionary.Create(Of SyntaxTree, DeclarationTableEntry)(), 1071Public Shadows Function ReplaceSyntaxTree(oldTree As SyntaxTree, newTree As SyntaxTree) As VisualBasicCompilation 1269Friend Overrides Function GetSyntaxTreeOrdinal(tree As SyntaxTree) As Integer 1704Private Overloads Sub ReportUnusedImports(filterTree As SyntaxTree, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken) 1711Dim infoTree As SyntaxTree = info.Tree 1760Private Sub AddImportsDependencies(diagnostics As BindingDiagnosticBag, infoTree As SyntaxTree, clauseSpan As TextSpan) 1769Friend Overrides Sub CompleteTrees(filterTree As SyntaxTree) 1777For Each tree As SyntaxTree In SyntaxTrees 1784Private Sub CompleteTree(tree As SyntaxTree) 1794Interlocked.CompareExchange(_lazyCompilationUnitCompletedTrees, New HashSet(Of SyntaxTree)(), Nothing) 1820Friend Sub RecordImportsClauseDependencies(syntaxTree As SyntaxTree, importsClausePosition As Integer, dependencies As ImmutableArray(Of AssemblySymbol)) 1831Public ReadOnly Tree As SyntaxTree 2041Public Shadows Function GetSemanticModel(syntaxTree As SyntaxTree, Optional ignoreAccessibility As Boolean = False) As SemanticModel 2052Friend Overrides Function CreateSemanticModel(syntaxTree As SyntaxTree, options As SemanticModelOptions) As SemanticModel 2212Private Sub AddClsComplianceDiagnostics(diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken, Optional filterTree As SyntaxTree = Nothing, Optional filterSpanWithinTree As TextSpan? = Nothing) 2233Private Shared Iterator Function FilterDiagnosticsByLocation(diagnostics As IEnumerable(Of Diagnostic), tree As SyntaxTree, filterSpanWithinTree As TextSpan?) As IEnumerable(Of Diagnostic) 2242tree As SyntaxTree, 2300Private Sub GetDiagnosticsForMethodBodiesInTree(tree As SyntaxTree, filterSpanWithinTree As TextSpan?, hasDeclarationErrors As Boolean, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken) 2618tree As SyntaxTree, 2751Protected Overrides Function CommonGetSemanticModel(syntaxTree As SyntaxTree, options As SemanticModelOptions) As SemanticModel 2755Protected Overrides ReadOnly Property CommonSyntaxTrees As ImmutableArray(Of SyntaxTree) 2761Protected Overrides Function CommonAddSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As Compilation 2762Dim array = TryCast(trees, SyntaxTree()) 2771Return Me.AddSyntaxTrees(trees.Cast(Of SyntaxTree)()) 2774Protected Overrides Function CommonRemoveSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As Compilation 2775Dim array = TryCast(trees, SyntaxTree()) 2784Return Me.RemoveSyntaxTrees(trees.Cast(Of SyntaxTree)()) 2791Protected Overrides Function CommonReplaceSyntaxTree(oldTree As SyntaxTree, newTree As SyntaxTree) As Compilation 2799Protected Overrides Function CommonContainsSyntaxTree(syntaxTree As SyntaxTree) As Boolean
Declarations\DeclarationTreeBuilder.vb (3)
19Private ReadOnly _syntaxTree As SyntaxTree 27Public Shared Function ForTree(tree As SyntaxTree, rootNamespace As ImmutableArray(Of String), scriptClassName As String, isSubmission As Boolean) As RootSingleNamespaceDeclaration 33Private Sub New(syntaxTree As SyntaxTree, rootNamespace As ImmutableArray(Of String), scriptClassName As String, isSubmission As Boolean)
Locations\EmbeddedTreeLocation.vb (1)
37Friend Overrides ReadOnly Property PossiblyEmbeddedOrMySourceTree As SyntaxTree
Locations\LocationExtensions.vb (1)
33Public Function PossiblyEmbeddedOrMySourceTree(location As Location) As SyntaxTree
Locations\MyTemplateLocation.vb (3)
17Private ReadOnly _tree As SyntaxTree 31Friend Overrides ReadOnly Property PossiblyEmbeddedOrMySourceTree As SyntaxTree 37Public Sub New(tree As SyntaxTree, span As TextSpan)
Locations\VBLocation.vb (1)
30Friend Overridable ReadOnly Property PossiblyEmbeddedOrMySourceTree As SyntaxTree
Lowering\LambdaRewriter\LambdaFrameConstructor.vb (1)
66Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Lowering\LambdaRewriter\SynthesizedLambdaMethod.vb (1)
226Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (1)
318Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (1)
161Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Scanner\Blender.vb (1)
186baseTreeRoot As SyntaxTree,
SourceGeneration\VisualBasicGeneratorDriver.vb (1)
36Friend Overrides Function ParseGeneratedSourceText(input As GeneratedSourceText, fileName As String, cancellationToken As CancellationToken) As SyntaxTree
SymbolDisplay\SymbolDisplay.vb (2)
38''' <param name="position">A position within the <see cref="SyntaxTree"/> Or <paramref name="semanticModel"/>.</param> 89''' <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param>
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (1)
179Private Function GetSyntaxTree(semanticModel As SemanticModel) As SyntaxTree
Symbols\AnonymousTypes\PublicSymbols\AnonymousType_PropertyPublicAccessors.vb (1)
39Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_ConstructorSymbol.vb (1)
56Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_EqualsMethodSymbol.vb (1)
99Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_GetHashCodeMethodSymbol.vb (1)
68Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_IEquatable_EqualsMethodSymbol.vb (1)
105Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_PropertyAccessors.vb (1)
58Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_ToStringMethodSymbol.vb (1)
73Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\EmbeddedSymbols\EmbeddedSymbolExtensions.vb (3)
18Public Function IsEmbeddedSyntaxTree(tree As SyntaxTree) As Boolean 23Public Function GetEmbeddedKind(tree As SyntaxTree) As EmbeddedSymbolKind 28Public Function IsEmbeddedOrMyTemplateTree(tree As SyntaxTree) As Boolean
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.vb (9)
18Private Shared s_embeddedSyntax As SyntaxTree = Nothing 19Private Shared s_vbCoreSyntax As SyntaxTree = Nothing 20Private Shared s_internalXmlHelperSyntax As SyntaxTree = Nothing 22Private Shared Function ParseResourceText(text As String) As SyntaxTree 26Friend Shared Function GetEmbeddedKind(tree As SyntaxTree) As EmbeddedSymbolKind 41Friend Shared Function GetEmbeddedTree(kind As EmbeddedSymbolKind) As SyntaxTree 54Public Shared ReadOnly Property EmbeddedSyntax As SyntaxTree 69Public Shared ReadOnly Property VbCoreSyntaxTree As SyntaxTree 81Public Shared ReadOnly Property InternalXmlHelperSyntax As SyntaxTree
Symbols\ErrorMethodSymbol.vb (1)
266Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\LexicalSortKey.vb (3)
84Private Sub New(embeddedKind As SyntaxTreeKind, tree As SyntaxTree, location As Integer, compilation As VisualBasicCompilation) 88Private Shared Function GetEmbeddedKind(tree As SyntaxTree) As SyntaxTreeKind 96Public Sub New(tree As SyntaxTree, position As Integer, compilation As VisualBasicCompilation)
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
1366Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\MethodSymbol.vb (4)
208Friend Overridable Function CallsAreOmitted(atNode As SyntaxNodeOrToken, syntaxTree As SyntaxTree) As Boolean 224Private Function CallsAreConditionallyOmitted(atNode As SyntaxNodeOrToken, syntaxTree As SyntaxTree) As Boolean 885Friend MustOverride Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer 1212Private Function IMethodSymbolInternal_CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer Implements IMethodSymbolInternal.CalculateLocalSyntaxOffset
Symbols\NamedTypeSymbolExtensions.vb (2)
24Friend Function FindMember(container As NamedTypeSymbol, symbolName As String, kind As SymbolKind, nameSpan As TextSpan, tree As SyntaxTree) As Symbol 55Friend Function FindFieldOrProperty(container As NamedTypeSymbol, symbolName As String, nameSpan As TextSpan, tree As SyntaxTree) As Symbol
Symbols\NamespaceSymbol.vb (1)
391Friend Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\ReducedExtensionMethodSymbol.vb (1)
665Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Retargeting\RetargetingMethodSymbol.vb (1)
521Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SignatureOnlyMethodSymbol.vb (1)
326Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\LambdaSymbol.vb (1)
353Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SourceComplexParameterSymbol.vb (1)
200Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\Source\SourceEventSymbol.vb (1)
456Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\Source\SourceFieldSymbol.vb (2)
83Friend ReadOnly Property SyntaxTree As SyntaxTree 881tree As SyntaxTree,
Symbols\Source\SourceFile.vb (2)
19Private ReadOnly _syntaxTree As SyntaxTree 83Public Sub New(sourceModule As SourceModuleSymbol, tree As SyntaxTree)
Symbols\Source\SourceMemberContainerTypeSymbol.vb (3)
3240Friend Function CalculateSyntaxOffsetInSynthesizedConstructor(position As Integer, tree As SyntaxTree, isShared As Boolean) As Integer 3278Friend Function TryCalculateSyntaxOffsetOfPositionInInitializer(position As Integer, tree As SyntaxTree, isShared As Boolean, ByRef syntaxOffset As Integer) As Boolean 3304Private Shared Function GetInitializersInSourceTree(tree As SyntaxTree, initializers As ImmutableArray(Of ImmutableArray(Of FieldOrPropertyInitializer))) As ImmutableArray(Of FieldOrPropertyInitializer)
Symbols\Source\SourceMemberFieldSymbol.vb (1)
51Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\Source\SourceMethodSymbol.vb (6)
775Public ReadOnly Property SyntaxTree As SyntaxTree 803Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean 1048tree As SyntaxTree, 1155Dim syntaxTree As SyntaxTree = Nothing 1178Dim syntaxTree As SyntaxTree = Me.SyntaxTree 1202Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SourceModuleSymbol.vb (6)
68Private ReadOnly _sourceFileMap As New ConcurrentDictionary(Of SyntaxTree, SourceFile) 166Friend Function TryGetSourceFile(tree As SyntaxTree) As SourceFile 216Friend ReadOnly Property SyntaxTrees As IEnumerable(Of SyntaxTree) 584Friend Function GetDeclarationErrorsInTree(tree As SyntaxTree, 586locationFilter As Func(Of IEnumerable(Of Diagnostic), SyntaxTree, TextSpan?, IEnumerable(Of Diagnostic)), 660Dim trees = ArrayBuilder(Of SyntaxTree).GetInstance()
Symbols\Source\SourceNamedTypeSymbol.vb (5)
155Private Function CreateLocationSpecificBinderForType(tree As SyntaxTree, location As BindingLocation) As Binder 632Private Sub CheckDeclarationPart(tree As SyntaxTree, 815Private Sub CreateTypeParameterInfoInPart(tree As SyntaxTree, 995Private Sub MakeDeclaredBaseInPart(tree As SyntaxTree, 1024Private Sub MakeDeclaredInterfacesInPart(tree As SyntaxTree,
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (1)
1388Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SourceNamespaceSymbol.vb (4)
310Friend Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean 354Friend Sub GenerateDeclarationErrorsInTree(tree As SyntaxTree, filterSpanWithinTree As TextSpan?, cancellationToken As CancellationToken) 365Private Sub ValidateDeclaration(tree As SyntaxTree, cancellationToken As CancellationToken) 526Friend Function GetDeclarationSpelling(tree As SyntaxTree, location As Integer) As String
Symbols\Source\SourcePropertySymbol.vb (2)
463Friend Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean 1222Friend ReadOnly Property SyntaxTree As SyntaxTree
Symbols\Source\SynthesizedConstructorSymbol.vb (1)
63Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedEntryPointSymbol.vb (1)
185Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedEventAccessorSymbol.vb (1)
514Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedInteractiveInitializerMethod.vb (1)
144Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (1)
98Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
137Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedSubmissionConstructorSymbol.vb (1)
129Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedWithEventsAccessorSymbol.vb (1)
110Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SubstitutedMethodSymbol.vb (2)
128Friend Overrides Function CallsAreOmitted(atNode As SyntaxNodeOrToken, syntaxTree As SyntaxTree) As Boolean 475Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Symbol.vb (2)
898Friend Overridable Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean Implements ISymbolInternal.IsDefinedInSourceTree 918Friend Shared Function IsDefinedInSourceTree(syntaxNode As SyntaxNode, tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
453Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (1)
354Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionConstructorSymbol.vb (1)
60Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedInterfaceImplementationStubSymbol.vb (1)
210Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedIntrinsicOperatorSymbol.vb (1)
184Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedSimpleConstructorSymbol.vb (1)
67Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedSimpleMethodSymbol.vb (1)
113Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Tuples\TupleMethodSymbol.vb (1)
127Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Syntax\SimpleSyntaxReference.vb (3)
15Private ReadOnly _tree As SyntaxTree 18Friend Sub New(tree As SyntaxTree, node As SyntaxNode) 23Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Syntax\SyntaxEquivalence.vb (2)
10Friend Function AreEquivalent(before As SyntaxTree, after As SyntaxTree, ignoreChildNode As Func(Of SyntaxKind, Boolean), topLevel As Boolean) As Boolean
Syntax\SyntaxExtensions.vb (1)
14Friend Function ReportDocumentationCommentDiagnostics(tree As SyntaxTree) As Boolean
Syntax\SyntaxFactory.vb (3)
943Public Shared Function AreEquivalent(oldTree As SyntaxTree, newTree As SyntaxTree, topLevel As Boolean) As Boolean 1062Friend Shared Function IsCompleteSubmission(tree As SyntaxTree) As Boolean
Syntax\SyntaxNodeFactories.vb (5)
35Optional encoding As Encoding = Nothing) As SyntaxTree 48cancellationToken As CancellationToken) As SyntaxTree 60cancellationToken As CancellationToken) As SyntaxTree 77Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 90Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree
Syntax\SyntaxTreeDiagnosticEnumerator.vb (2)
28Private ReadOnly _tree As SyntaxTree 34Friend Sub New(tree As SyntaxTree, node As InternalSyntax.VisualBasicSyntaxNode, position As Integer, inDocumentationComment As Boolean)
Syntax\VisualBasicLineDirectiveMap.vb (1)
17Public Sub New(tree As SyntaxTree)
Syntax\VisualBasicSyntaxNode.vb (10)
32Friend Sub New(green As GreenNode, position As Integer, syntaxTree As SyntaxTree) 51Friend Shadows ReadOnly Property SyntaxTree As SyntaxTree 55Dim tree As SyntaxTree = Nothing 81Dim alternativeTree As SyntaxTree = Interlocked.CompareExchange(stack.Pop()._syntaxTree, tree, Nothing) 188Friend Function GetSyntaxErrors(tree As SyntaxTree) As ReadOnlyCollection(Of Diagnostic) 192Friend Shared Function DoGetSyntaxErrors(tree As SyntaxTree, nodeOrToken As SyntaxNodeOrToken) As ReadOnlyCollection(Of Diagnostic) 244Private Shared Sub ProcessTrivia(tree As SyntaxTree, 271Private Shared Function CreateSyntaxError(tree As SyntaxTree, nodeOrToken As SyntaxNodeOrToken, errorInfo As DiagnosticInfo) As Diagnostic 278Private Shared Function CreateSyntaxError(tree As SyntaxTree, nodeOrToken As SyntaxTrivia, errorInfo As DiagnosticInfo) As Diagnostic 387Protected Overrides ReadOnly Property SyntaxTreeCore As SyntaxTree
Syntax\VisualBasicSyntaxTree.DummySyntaxTree.vb (4)
71Public Overrides Function WithChangedText(newText As SourceText) As SyntaxTree 90Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 94Public Overrides Function WithFilePath(path As String) As SyntaxTree 98Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (3)
114Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 131Public Overrides Function WithFilePath(path As String) As SyntaxTree 153Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (3)
139Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 156Public Overrides Function WithFilePath(path As String) As SyntaxTree 173Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.vb (19)
77''' Ensure that <see cref="SyntaxTree.HasCompilationUnitRoot"/> is true for this tree prior to invoking this method. 79''' <exception cref="InvalidCastException">Throws this exception if <see cref="SyntaxTree.HasCompilationUnitRoot"/> is false.</exception> 100Public Overrides Function WithChangedText(newText As SourceText) As SyntaxTree 114Private Function WithChanges(newText As SourceText, changes As TextChangeRange()) As SyntaxTree 164Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing) As SyntaxTree 184checksumAlgorithm As SourceHashAlgorithm) As SyntaxTree 200Friend Shared Function CreateForDebugger(root As VisualBasicSyntaxNode, text As SourceText, options As VisualBasicParseOptions) As SyntaxTree 213Friend Shared Function CreateWithoutClone(root As VisualBasicSyntaxNode) As SyntaxTree 230Optional path As String = "") As SyntaxTree 240Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 250Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 267Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 283Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 509Public Overrides Function IsEquivalentTo(tree As SyntaxTree, Optional topLevel As Boolean = False) As Boolean 519Public Overrides Function GetChangedSpans(oldTree As SyntaxTree) As IList(Of TextSpan) 532Public Overrides Function GetChanges(oldTree As SyntaxTree) As IList(Of TextChange) 615cancellationToken As CancellationToken) As SyntaxTree 626cancellationToken As CancellationToken) As SyntaxTree 635encoding As Encoding) As SyntaxTree
Syntax\VisualBasicWarningStateMap.vb (3)
13Public Sub New(tree As SyntaxTree) 17Protected Overrides Function CreateWarningStateMapEntries(syntaxTree As SyntaxTree) As WarningStateMapEntry() 27Private Shared Sub GetAllWarningDirectives(syntaxTree As SyntaxTree, directiveList As ArrayBuilder(Of DirectiveTriviaSyntax))
VisualBasicExtensions.vb (8)
236Friend Function IsMyTemplate(syntaxTree As SyntaxTree) As Boolean 242Friend Function HasReferenceDirectives(syntaxTree As SyntaxTree) As Boolean 248Friend Function IsAnyPreprocessorSymbolDefined(syntaxTree As SyntaxTree, conditionalSymbolNames As IEnumerable(Of String), atNode As SyntaxNodeOrToken) As Boolean 259Friend Function GetVisualBasicRoot(syntaxTree As SyntaxTree, Optional cancellationToken As CancellationToken = Nothing) As VisualBasicSyntaxNode 264Friend Function GetPreprocessingSymbolInfo(syntaxTree As SyntaxTree, identifierNode As IdentifierNameSyntax) As VisualBasicPreprocessingSymbolInfo 280Friend Function GetSyntaxErrors(token As SyntaxToken, tree As SyntaxTree) As ReadOnlyCollection(Of Diagnostic) 504Public Function GetCompilationUnitRoot(tree As SyntaxTree) As CompilationUnitSyntax 512Friend Function GetWarningState(tree As SyntaxTree, id As String, position As Integer) As ReportDiagnostic
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (24)
src\Analyzers\VisualBasic\Analyzers\CodeStyle\VisualBasicAnalyzerOptionsProvider.vb (1)
74Public Function GetVisualBasicAnalyzerOptions(options As AnalyzerOptions, syntaxTree As SyntaxTree) As VisualBasicAnalyzerOptionsProvider
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (1)
55nodes As IEnumerable(Of SyntaxNode), tree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of TextSpan)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
35Protected Overrides Function SupportsDiscard(tree As SyntaxTree) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (1)
38Public Function GetStartDirectives(syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of DirectiveTriviaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
637Public Function ReplaceStatements(tree As SyntaxTree, 713tree As SyntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (14)
121Public Function FindTriviaToLeft(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxTrivia 152Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 161Public Function IsWithinPartialMethodDeclaration(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 177Public Function IsEntirelyWithinComment(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 188Public Function IsEntirelyWithinStringLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 199Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 238Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 265Public Function IsInSkippedText(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 296Public Function IsGlobalStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 313Public Function IsRightOfDot(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 324Public Function IsRightOfIntegerLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 330Public Function IsInPreprocessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 336syntaxTree As SyntaxTree, 357Public Function GetFirstStatementOnLine(syntaxTree As SyntaxTree, lineNumber As Integer, cancellationToken As CancellationToken) As StatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (4)
123Public Function IsPreProcessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsPreProcessorDirectiveContext 127Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsEntirelyWithinStringOrCharOrNumericLiteral 1165Public Function GetInactiveRegionSpanAroundPosition(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TextSpan Implements ISyntaxFacts.GetInactiveRegionSpanAroundPosition 1760Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsInInactiveRegion
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (45)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
40Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxTree, SyntaxNode))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (37)
14Friend Function GetTargetToken(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken 38Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 47Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, preProcessorTokenOnLeftOfPosition As SyntaxToken, cancellationToken As CancellationToken) As Boolean 63Public Function IsNamespaceContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 68Public Function IsNamespaceDeclarationNameContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 82Public Function IsPartialTypeDeclarationNameContext(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, ByRef statementSyntax As TypeStatementSyntax) As Boolean 106Public Function GetContainingTypeBlock(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TypeBlockSyntax 115Friend Function IsTypeDeclarationContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 122syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, allowAfterModifiersOrDim As Boolean, cancellationToken As CancellationToken, ParamArray allowedParentBlocks As SyntaxKind()) As Boolean 188Friend Function IsTypeMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 197Friend Function IsInterfaceMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 205Friend Function IsTypeDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 212Friend Function IsFieldNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 245Friend Function IsParameterNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 268Friend Function IsLabelContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 301Friend Function IsEnumMemberNameContext(syntaxTree As SyntaxTree, context As VisualBasicSyntaxContext) As Boolean 315Public Function IsDelegateCreationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 339syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 346syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 459Public Function IsAttributeNameContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 479Public Function IsTypeContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 545Private Sub PositionOutsideTupleIfApplicable(syntaxTree As SyntaxTree, ByRef position As Integer, 556Public Function IsNameOfContext(syntaxTree As SyntaxTree, position As Integer, Optional cancellationToken As CancellationToken = Nothing) As Boolean 572Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 582Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 625Friend Function IsMultiLineStatementStartContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 662Friend Function IsStartOfSelectCaseBlock(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 670Friend Function IsAfterStatementOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 684Friend Function IsInStatementBlockOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 716Public Function IsQueryIntoClauseContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 750Public Function IsRaiseEventContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 756Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 762Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 775Friend Function IsEnumTypeMemberAccessContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 811syntaxTree As SyntaxTree, 1072Friend Function IsPossibleTupleContext(syntaxTree As SyntaxTree, 1089Public Function IsInPreprocessorExpressionContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
349Return SyntaxTree.IsFollowingCompleteExpression( 369Return SyntaxTree.IsFollowingCompleteExpression(Of JoinClauseSyntax)(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (1)
57Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxFactsService.vb (2)
23Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFactsService.IsInNonUserCode 39Public Function GetSelectedFieldsAndPropertiesAsync(tree As SyntaxTree, textSpan As TextSpan, allowPartialSelection As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) Implements ISyntaxFactsService.GetSelectedFieldsAndPropertiesAsync
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\ModifierCollectionFacts.vb (2)
32Public Sub New(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) 302Private Shared Function ComputeAllowableDeclarationTypes(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As PossibleDeclarationTypes
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (11)
src\Features\VisualBasicTest\Utils.vb (11)
13Friend Function ParseCode(code As String) As SyntaxTree 22Friend Function ParseLines(ParamArray lines As String()) As SyntaxTree 27Friend Function ParseExpression(expr As String) As SyntaxTree 38Friend Function ParseStatement(statement As String) As SyntaxTree 85Friend Function DigToFirstNodeOfType(Of T As SyntaxNode)(syntaxTree As SyntaxTree) As T 97Friend Function DigToFirstTypeBlock(syntaxTree As SyntaxTree) As TypeBlockSyntax 104Friend Function DigToFirstNamespace(syntaxTree As SyntaxTree) As NamespaceBlockSyntax 111Private ReadOnly _tree As SyntaxTree 114Public Sub New(syntaxTree As SyntaxTree, node As T) 123Public ReadOnly Property Tree As SyntaxTree 137Friend Shared Function Create(Of T As SyntaxNode)(syntaxTree As SyntaxTree, node As T) As TreeNodePair(Of T)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (12)
EndConstructGeneration\EndConstructState.vb (3)
11Private ReadOnly _tree As SyntaxTree 15Public Sub New(caretPosition As Integer, semanticModel As AsyncLazy(Of SemanticModel), syntaxTree As SyntaxTree, tokenToLeft As SyntaxToken, newLineCharacter As String) 35Public ReadOnly Property SyntaxTree As SyntaxTree
LineCommit\CommitFormatter.vb (7)
44baseTree As SyntaxTree, 129Private Shared Function AbortForDiagnostics(tree As SyntaxTree, cancellationToken As CancellationToken) As Boolean 147oldTree As SyntaxTree, 149newTree As SyntaxTree, 166oldTree As SyntaxTree, 168newTree As SyntaxTree, 231syntaxTree As SyntaxTree,
LineCommit\ContainingStatementInfo.vb (1)
43syntaxTree As SyntaxTree,
LineCommit\ICommitFormatter.vb (1)
22baseTree As SyntaxTree,
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (4)
Emit\EditAndContinue\EditAndContinueTest.vb (1)
40Protected Overrides Function CreateCompilation(tree As SyntaxTree) As Compilation
Emit\EditAndContinue\EditAndContinueTestBase.vb (1)
331Public Function WithSource(compilation As VisualBasicCompilation, newTree As SyntaxTree) As VisualBasicCompilation
PDB\ChecksumTests.vb (1)
20Dim tree As SyntaxTree
PDB\VisualBasicDeterministicBuildCompilationTests.vb (1)
39Private Sub TestDeterministicCompilationVB(syntaxTrees As SyntaxTree(), compilationOptions As VisualBasicCompilationOptions, emitOptions As EmitOptions, ParamArray metadataReferences() As TestMetadataReferenceInfo)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (5)
Symbols\EEMethodSymbol.vb (1)
622Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\PlaceholderMethodSymbol.vb (1)
153Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedContextMethodSymbol.vb (1)
103Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
SyntaxHelpers.vb (2)
186Private Function CreateSyntaxTree(root As InternalSyntax.VisualBasicSyntaxNode, text As SourceText) As SyntaxTree 201Private Function GetDebuggerStatement(syntaxTree As SyntaxTree) As StatementSyntax
Microsoft.CodeAnalysis.VisualBasic.Features (29)
Completion\CompletionProviders\AwaitCompletionProvider.vb (2)
65Protected Overrides Function GetExpressionToPlaceAwaitInFrontOf(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode 83Protected Overrides Function GetDotTokenLeftOfPosition(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken?
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (1)
40Protected Overrides Function GetObjectCreationNewExpression(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
32Protected Overrides Function GetInitializedMembers(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As HashSet(Of String)
Completion\CompletionProviders\OverrideCompletionProvider.vb (2)
55Protected Overrides Function GetToken(completionItem As CompletionItem, syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As SyntaxToken 60Public Overrides Function FindStartingToken(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
57Protected Overrides Function GetPartialTypeSyntaxNode(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode
Completion\KeywordRecommenders\PreprocessorDirectives\PreprocessorHelpers.vb (2)
12Public Function GetInnermostIfPreprocessorKind(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxKind? 28Public Sub New(syntaxTree As SyntaxTree, maxPosition As Integer, cancellationToken As CancellationToken)
Completion\Providers\ContextVariableArgumentProvider.vb (1)
29Protected Overrides Function IsInstanceContext(syntaxTree As SyntaxTree, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean
Debugging\ProximityExpressionsGetter.vb (2)
34Friend Shared Function [Do](syntaxTree As SyntaxTree, 39Private Shared Function [Do](syntaxTree As SyntaxTree,
Debugging\ProximityExpressionsGetter.Worker.vb (2)
14Private ReadOnly _syntaxTree As SyntaxTree 21Public Sub New(syntaxTree As SyntaxTree, position As Integer)
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (3)
26Protected Overrides Function GetContainingMember(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As DeclarationStatementSyntax 229Protected Overrides Function GetTokenToRight(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken 238Protected Overrides Function GetTokenToLeft(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken
EditAndContinue\BreakpointSpans.vb (1)
13Friend Function TryGetBreakpointSpan(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, <Out> ByRef breakpointSpan As TextSpan) As Boolean
EditAndContinue\DeclarationBody\FieldOrPropertyDeclarationBody.vb (1)
45Public NotOverridable Overrides ReadOnly Property SyntaxTree As SyntaxTree
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (1)
22Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
315Friend Overrides Function ExperimentalFeaturesEnabled(tree As SyntaxTree) As Boolean
NavigationBar\VisualBasicNavigationBarItemService.vb (4)
158tree As SyntaxTree, 184tree As SyntaxTree, 203tree As SyntaxTree, 393tree As SyntaxTree,
src\Analyzers\VisualBasic\Analyzers\CodeStyle\VisualBasicAnalyzerOptionsProvider.vb (1)
74Public Function GetVisualBasicAnalyzerOptions(options As AnalyzerOptions, syntaxTree As SyntaxTree) As VisualBasicAnalyzerOptionsProvider
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (1)
55nodes As IEnumerable(Of SyntaxNode), tree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of TextSpan)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
35Protected Overrides Function SupportsDiscard(tree As SyntaxTree) As Boolean
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
40Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxTree, SyntaxNode))
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (12)
EditAndContinue\Helpers\EditingTestBase.vb (1)
203Private Shared Function ParseSource(markedSource As String, Optional documentIndex As Integer = 0) As SyntaxTree
Utils.vb (11)
13Friend Function ParseCode(code As String) As SyntaxTree 22Friend Function ParseLines(ParamArray lines As String()) As SyntaxTree 27Friend Function ParseExpression(expr As String) As SyntaxTree 38Friend Function ParseStatement(statement As String) As SyntaxTree 85Friend Function DigToFirstNodeOfType(Of T As SyntaxNode)(syntaxTree As SyntaxTree) As T 97Friend Function DigToFirstTypeBlock(syntaxTree As SyntaxTree) As TypeBlockSyntax 104Friend Function DigToFirstNamespace(syntaxTree As SyntaxTree) As NamespaceBlockSyntax 111Private ReadOnly _tree As SyntaxTree 114Public Sub New(syntaxTree As SyntaxTree, node As T) 123Public ReadOnly Property Tree As SyntaxTree 137Friend Shared Function Create(Of T As SyntaxNode)(syntaxTree As SyntaxTree, node As T) As TreeNodePair(Of T)
Microsoft.CodeAnalysis.VisualBasic.Scripting (2)
VisualBasicScriptCompiler.vb (2)
36Public Overrides Function IsCompleteSubmission(tree As SyntaxTree) As Boolean 40Public Overrides Function ParseSubmission(text As SourceText, parseOptions As ParseOptions, cancellationToken As CancellationToken) As SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (251)
Binding\BindingCollectionInitializerTests.vb (5)
1785Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1837Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1882Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1918Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1956Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Binding\BindingErrorTests.vb (1)
24145Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Binding\BindingScopeTests.vb (1)
17Dim tree As SyntaxTree = CompilationUtils.GetTree(comp, treeName)
Binding\LookupTests.vb (11)
24Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 1613Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1663Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1723Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1916Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2087Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2229Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2347Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2450Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2587Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2720Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Compilation\CompilationAPITests.vb (11)
29tree As SyntaxTree, 280Dim listSyntaxTree = New List(Of SyntaxTree) 284Dim t1 As SyntaxTree = VisualBasicSyntaxTree.ParseText(s1) 694comp = comp.AddSyntaxTrees(Enumerable.Empty(Of SyntaxTree)) 730Dim hs = New HashSet(Of SyntaxTree) From {t4, t5, t6} 738Dim col = New ObjectModel.Collection(Of SyntaxTree) From {t4, t5, t6} 746Dim stack = New Concurrent.ConcurrentStack(Of SyntaxTree) 757Dim queue = New Concurrent.ConcurrentQueue(Of SyntaxTree) 788Dim listSyntaxTree = New List(Of SyntaxTree) 804Dim xt As SyntaxTree = Nothing 1389Dim t2 As SyntaxTree = t1
Compilation\MyTemplateTests.vb (2)
16Friend Shared Function GetMyTemplateTree(compilation As VisualBasicCompilation) As SyntaxTree 17Dim MyTemplate As SyntaxTree = Nothing
Compilation\SemanticModelAPITests.vb (56)
67Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 108Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 148Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 190Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 268Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 321Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 370Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 410Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 493Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 587Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 658Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 710Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 750Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 812Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 878Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 929Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 964Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 999Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1038Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1077Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1117Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1160Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1217Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1384Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1416Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1485Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1534Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1575Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1654Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1690Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1765Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1785Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1816Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1855Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1898Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1941Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1975Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2010Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2305Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2442Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2569Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2695Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2738Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2774Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2811Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2847Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3028Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3165Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3632Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3821Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 3842Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 4022Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "sam.vb").Single() 4057Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "sam.vb").Single() 4505Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 4583Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 4613Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (10)
479Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 525Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 754Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 908Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 1164Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 1180Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 1785Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 1898Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 2852Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2886Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Compilation\SemanticModelLookupSymbolsAPITests.vb (9)
51Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 97Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 154Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 214Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 259Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 377Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 431Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1970Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2002Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
DeclaringSyntaxNodeTests.vb (4)
33Dim tree As SyntaxTree = node.SyntaxTree 102Private Sub CheckDeclaringSyntax(Of TNode As VisualBasicSyntaxNode)(comp As VisualBasicCompilation, tree As SyntaxTree, name As String, kind As SymbolKind) 116Private Sub CheckDeclaringSyntaxIsNoDeclaration(Of TNode As VisualBasicSyntaxNode)(comp As VisualBasicCompilation, tree As SyntaxTree, name As String) 127Private Sub CheckLambdaDeclaringSyntax(Of TNode As ExpressionSyntax)(comp As VisualBasicCompilation, tree As SyntaxTree, textToSearchFor As String)
Diagnostics\DiagnosticAnalyzerTests.vb (4)
853Dim builder = ImmutableArray.CreateBuilder(Of SyntaxTree)() 1707Private ReadOnly _cache As New ConcurrentDictionary(Of SyntaxTree, SemanticModel)() 1710Public Overrides Function GetSemanticModel(tree As SyntaxTree, compilation As Compilation, Optional options As SemanticModelOptions = SemanticModelOptions.None) As SemanticModel 1714Public Sub VerifyCachedModel(tree As SyntaxTree, model As SemanticModel)
FlowAnalysis\FlowTestBase.vb (1)
170Private Sub FindRegionNodes(tree As SyntaxTree, region As TextSpan,
Semantics\AsyncAwait.vb (5)
107Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 176Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 933Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1414Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1956Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\BinaryOperators.vb (3)
984Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1324Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1419Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\CompoundAssignment.vb (2)
293Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1016Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\ConditionalAccessTests.vb (3)
639Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1316Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1485Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\Conversions_AnonymousDelegates.vb (27)
45Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 136Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 193Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 278Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 359Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 383Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 427Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 508Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 538Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 945Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1031Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1084Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1186Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1234Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1313Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1344Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1396Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1501Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1587Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1634Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1712Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1735Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1783Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1831Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1886Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1983Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2014Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\FieldInitializerBindingTests.vb (1)
1530Private Shared Sub CheckBoundInitializers(expectedInitializers As IEnumerable(Of ExpectedInitializer), syntaxTree As SyntaxTree, boundInitializers As ImmutableArray(Of BoundInitializer), isStatic As Boolean)
Semantics\GetExtendedSemanticInfoTests.vb (5)
7443Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 7498Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 8735Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 8760Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 8782Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\GetSemanticInfoTests.vb (3)
4425Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName) 4696Dim treeA As SyntaxTree = CompilationUtils.GetTree(compilation, "a.vb") 5017Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\Lambda_AnonymousDelegateInference.vb (2)
202Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 436Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\Lambda_Relaxation.vb (24)
37Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 153Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 251Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 349Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 444Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 850Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 925Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 970Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1024Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1179Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1242Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1293Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1406Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1451Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1517Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1616Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1693Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1747Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1907Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1999Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2053Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2145Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2173Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2227Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\LambdaSemanticInfoTests.vb (7)
167Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 461Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 499Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 532Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 577Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 602Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 625Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\MethodCalls.vb (1)
2925Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\OverloadResolution.vb (2)
4318Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 4426Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\Parenthesized.vb (1)
240Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\QueryExpressions_LookupSymbols.vb (16)
53Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 181Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 282Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 358Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 467Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 549Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 900Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 937Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 986Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1147Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1348Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1540Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1623Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1775Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1935Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2070Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\QueryExpressions_SemanticModel.vb (26)
58Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 284Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 504Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 748Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1066Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1287Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1369Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1472Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1535Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1635Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1778Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 1849Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 1876Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 1903Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 1930Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 2091Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2517Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2657Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 2885Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3291Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3495Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3736Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3814Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3844Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3883Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3915Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\ScriptSemanticsTests.vb (1)
170Private Shared Function ErrorTestsGetNode(syntaxTree As SyntaxTree) As MemberAccessExpressionSyntax
Semantics\SyntaxTreeRootTests.vb (4)
28Dim tree As SyntaxTree = VisualBasicSyntaxTree.ParseText("Module Module1 _ Sub Main() _ System.Console.WriteLine(""Wah"") _ End Sub _ End Module") 35Dim tree As SyntaxTree = VisualBasicSyntaxTree.Create(SyntaxFactory.FromClause(SyntaxFactory.CollectionRangeVariable(SyntaxFactory.ModifiedIdentifier("Nay"), SyntaxFactory.NumericLiteralExpression(SyntaxFactory.Literal(823))))) 55Dim syntaxTreeField = GetType(VisualBasicSyntaxNode).GetFields(BindingFlags.NonPublic Or BindingFlags.Instance).Single(Function(f) f.FieldType Is GetType(SyntaxTree)) 82Private Sub CheckTree(tree As SyntaxTree)
Semantics\UnaryOperators.vb (2)
663Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 815Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
Semantics\VariableTypeInference.vb (1)
702Private Sub CheckVariableType(tree As SyntaxTree, model As SemanticModel, textToFind As String, typeName As String)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (87)
DocumentationComments\DocCommentTests.vb (22)
5456Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 5506Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 5662Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 5842Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6040Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6202Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6455Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6603Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6673Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6866Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6945Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 6983Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7042Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7101Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7163Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7225Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7280Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7328Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 7380Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 11910Public Shared Function FindCref(tree As SyntaxTree) As CrefReferenceSyntax 11915Public Shared Function FindAllCrefs(tree As SyntaxTree) As List(Of CrefReferenceSyntax) 12083Private Shared Function FindNodesOfTypeFromText(Of TNode As VisualBasicSyntaxNode)(tree As SyntaxTree, textToFind As String) As TNode()
SymbolsTests\AnonymousDelegates\AnonymousDelegates_CreationAndEmit.vb (2)
297Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 488Dim tree As SyntaxTree = comp.SyntaxTrees.Single()
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (44)
48Dim tree As SyntaxTree = Nothing 104Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 226Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 299Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 368Dim tree As SyntaxTree = compilation.SyntaxTrees(0) 500Dim tree As SyntaxTree = Nothing 554Dim tree As SyntaxTree = Nothing 582Dim tree As SyntaxTree = Nothing 621Dim tree As SyntaxTree = Nothing 664Dim tree As SyntaxTree = Nothing 701Dim tree As SyntaxTree = Nothing 744Dim tree As SyntaxTree = Nothing 785Dim tree As SyntaxTree = Nothing 821Dim tree As SyntaxTree = Nothing 862Dim tree As SyntaxTree = Nothing 897Dim tree As SyntaxTree = Nothing 924Dim tree As SyntaxTree = Nothing 977Dim tree As SyntaxTree = Nothing 1000Dim tree As SyntaxTree = Nothing 1031Dim tree As SyntaxTree = Nothing 1067Dim tree As SyntaxTree = Nothing 1094Dim tree As SyntaxTree = Nothing 1123Dim tree As SyntaxTree = Nothing 1152Dim tree As SyntaxTree = Nothing 1181Dim tree As SyntaxTree = Nothing 1205Dim tree As SyntaxTree = Nothing 1234Dim tree As SyntaxTree = Nothing 1266Dim tree As SyntaxTree = Nothing 1290Dim tree As SyntaxTree = Nothing 1315Dim tree As SyntaxTree = Nothing 1341Dim tree As SyntaxTree = Nothing 1375Dim tree As SyntaxTree = Nothing 1408Dim tree As SyntaxTree = Nothing 1441Dim tree As SyntaxTree = Nothing 1468Dim tree As SyntaxTree = Nothing 1495Dim tree As SyntaxTree = Nothing 1522Dim tree As SyntaxTree = Nothing 1552Dim tree As SyntaxTree = Nothing 1579Dim tree As SyntaxTree = Nothing 1606Dim tree As SyntaxTree = Nothing 1649Dim tree As SyntaxTree = Nothing 1924Private Sub CheckFieldNameAndLocation(model As SemanticModel, type As ITypeSymbol, tree As SyntaxTree, identifierIndex As Integer, fieldName As String, Optional isKey As Boolean = False) 1967Private Function Compile(text As XElement, ByRef tree As SyntaxTree, nodes As List(Of SyntaxNode), Optional errors As XElement = Nothing) As VisualBasicCompilation 2056Dim tree As SyntaxTree = comp.SyntaxTrees.Single()
SymbolsTests\CompilationCreationTests.vb (2)
2205Private Shared Function CreateSyntaxTree(className As String) As SyntaxTree 2211Private Shared Sub CheckCompilationSyntaxTrees(compilation As VisualBasicCompilation, ParamArray expectedSyntaxTrees As SyntaxTree())
SymbolsTests\MyBaseMyClassSemanticsTests.vb (3)
65Dim tree As SyntaxTree = Nothing 84Private Sub CheckFieldNameAndLocation(type As TypeSymbol, tree As SyntaxTree, identifierIndex As Integer, fieldName As String, Optional isKey As Boolean = False) 116Private Function Compile(text As XElement, ByRef tree As SyntaxTree, nodes As List(Of SyntaxNode), Optional errors As XElement = Nothing) As VisualBasicCompilation
SymbolsTests\Source\BindingsTests.vb (1)
22Dim tree As SyntaxTree = CompilationUtils.GetTree(compilation, treeName)
SymbolsTests\Source\GroupClassTests.vb (6)
15Private Shared Function ParseTemplateTree(text As String, Optional path As String = Nothing) As SyntaxTree 2240Friend Shared ReadOnly WindowsFormsMyTemplateTree As SyntaxTree = ParseTemplateTree(WindowsFormsMyTemplateSource, path:="17d14f5c-a337-4978-8281-53493378c107.vb") ' The name used by native compiler 2599Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "Test3.vb").Single() 3269Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3350Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() 3756Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single()
SymbolsTests\WithStatementSymbolsTests.vb (7)
37Dim tree As SyntaxTree = Nothing 86Dim tree As SyntaxTree = Nothing 117Dim tree As SyntaxTree = Nothing 152Dim tree As SyntaxTree = Nothing 204Dim tree As SyntaxTree = Nothing 250Dim tree As SyntaxTree = Nothing 269Private Function Compile(text As XElement, ByRef tree As SyntaxTree, nodes As List(Of SyntaxNode), Optional errors As XElement = Nothing) As VisualBasicCompilation
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (35)
IncrementalParser\IncrementalParser.vb (5)
82Dim tree As SyntaxTree = Nothing 105Dim tree As SyntaxTree = Nothing 1695Dim extractGreenClassC As Func(Of SyntaxTree, Syntax.InternalSyntax.VisualBasicSyntaxNode) = 2576Private Shared Sub VerifyEquivalent(treeA As SyntaxTree, treeB As SyntaxTree)
IncrementalParser\SyntaxDifferences.vb (2)
15Public Function GetRebuiltNodes(oldTree As SyntaxTree, newTree As SyntaxTree) As ImmutableArray(Of SyntaxNodeOrToken)
LocationTests.vb (3)
28Private Sub AssertMappedSpanEqual(syntaxTree As SyntaxTree, 55Private Function GetSpanIn(tree As SyntaxTree, textToFind As String) As TextSpan 62Private Shared Function InspectLineMapping(tree As SyntaxTree) As IEnumerable(Of String)
Parser\DeclarationTests.vb (1)
14Private Function ParseFile(text As String) As SyntaxTree
Parser\ParseDirectives.vb (2)
3386Private Function GetStartPosition(tree As SyntaxTree, text As String) As Integer 3392Private Function GetEndPosition(tree As SyntaxTree, text As String) As Integer
Parser\ParserRegressionTests.vb (1)
761Dim tree As SyntaxTree = VisualBasicSyntaxTree.ParseText(EncodedStringText.Create(data))
Parser\ParseStatements.vb (1)
4358Private Shared Sub CheckTokensForIncompleteImplements(tree As SyntaxTree, ofMissing As Boolean)
Syntax\SyntaxAnnotationTests.vb (6)
355Private Sub TestCopyAnnotations(tree1 As SyntaxTree, tree2 As SyntaxTree) 431Private Sub TestManyRandomAnnotations(tree As SyntaxTree) 462Private Sub TestRandomAnnotations(tree As SyntaxTree) 516Private Sub TestTriviaAnnotation(tree As SyntaxTree) 528Private Sub TestAnnotation(tree As SyntaxTree)
Syntax\SyntaxEquivalenceTests.vb (4)
15Private Sub VerifyEquivalent(tree1 As SyntaxTree, tree2 As SyntaxTree, topLevel As Boolean) 22Private Sub VerifyNotEquivalent(tree1 As SyntaxTree, tree2 As SyntaxTree, topLevel As Boolean)
Syntax\SyntaxTreeTests.vb (1)
188Dim oldTree As SyntaxTree = New VisualBasicSyntaxTree.DummySyntaxTree()
TestSyntaxNodes.vb (9)
1733Dim tree As SyntaxTree = VisualBasicSyntaxTree.ParseText(SourceText.From(" Module M1" & vbCrLf & "End Module")) 1763Dim tree As SyntaxTree = VisualBasicSyntaxTree.ParseText(SourceText.From("Module M1" & vbCrLf & "End")) 2212Dim tree As SyntaxTree = VisualBasicSyntaxTree.ParseText("public class goo : end class") 2889Dim x As SyntaxTree = ThirdImportsClause.SyntaxTree 2890Dim y As SyntaxTree = newImportsClause.SyntaxTree 2916Dim BlankTree As SyntaxTree = Nothing 2931Dim span2 = CType(newTree, SyntaxTree).GetChangedSpans(CType(oldTree, SyntaxTree)) 2936Dim BlankTree As SyntaxTree = Nothing
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (81)
BasicTestSource.vb (9)
22Optional checksumAlgorithm As SourceHashAlgorithm = SourceHashAlgorithms.Default) As SyntaxTree 32Optional ByRef spans As IEnumerable(Of IEnumerable(Of TextSpan)) = Nothing) As SyntaxTree() 36Return Array.Empty(Of SyntaxTree) 46Return New SyntaxTree() _ 59Dim tree = TryCast(Value, SyntaxTree) 62Return New SyntaxTree() {tree} 65Dim trees = TryCast(Value, SyntaxTree()) 96Public Shared Widening Operator CType(source As SyntaxTree) As BasicTestSource 100Public Shared Widening Operator CType(source As SyntaxTree()) As BasicTestSource
CompilationTestUtils.vb (14)
21Private Function ParseSources(source As IEnumerable(Of String), parseOptions As VisualBasicParseOptions) As IEnumerable(Of SyntaxTree) 215Public Function CreateCompilationWithMscorlib40AndVBRuntime(source As IEnumerable(Of SyntaxTree), 301Optional ByRef spans As IEnumerable(Of IEnumerable(Of TextSpan)) = Nothing) As IEnumerable(Of SyntaxTree) 312Public Function ToSourceTrees(compilationSources As XElement, Optional parseOptions As VisualBasicParseOptions = Nothing) As IEnumerable(Of SyntaxTree) 317Public Function CreateEmptyCompilationWithReferences(source As SyntaxTree, 324Public Function CreateEmptyCompilationWithReferences(source As IEnumerable(Of SyntaxTree), 635Public Function CreateParseTree(programElement As XElement) As SyntaxTree 647Public Function CreateParseTreeAndSpans(programElement As XElement, Optional parseOptions As VisualBasicParseOptions = Nothing) As (tree As SyntaxTree, spans As IList(Of TextSpan)) 658Public Function FindTokenFromText(tree As SyntaxTree, textToFind As String) As SyntaxToken 666Public Function FindPositionFromText(tree As SyntaxTree, textToFind As String) As Integer 673Public Function FindNodeFromText(tree As SyntaxTree, textToFind As String) As SyntaxNode 678Public Function FindNodeOfTypeFromText(Of TNode As SyntaxNode)(tree As SyntaxTree, textToFind As String) As TNode 687Public Function GetTree(compilation As Compilation, name As String) As SyntaxTree 830Public Sub AssertTheseDiagnostics(tree As SyntaxTree, errs As XElement, Optional suppressInfos As Boolean = True)
DiagnosticExtensions.vb (1)
23Friend Function GetDiagnosticsForSyntaxTree(c As VisualBasicCompilation, stage As CompilationStage, tree As SyntaxTree, Optional filterSpan As TextSpan? = Nothing) As ImmutableArray(Of Diagnostic)
MockSymbols.vb (1)
652Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
ParserTestUtilities.vb (40)
23Public Function ParseAndVerify(code As XCData, Optional expectedErrors As XElement = Nothing) As SyntaxTree 28Public Function ParseAndVerify(code As XCData, options As VisualBasicParseOptions, Optional expectedErrors As XElement = Nothing) As SyntaxTree 33Public Function ParseAndVerify(source As String, options As VisualBasicParseOptions, Optional expectedErrors As XElement = Nothing) As SyntaxTree 50Public Function ParseAndVerify(source As String, Optional expectedErrors As XElement = Nothing) As SyntaxTree 54Public Function ParseAndVerify(code As XCData, ParamArray expectedDiagnostics() As DiagnosticDescription) As SyntaxTree 58Public Function ParseAndVerify(code As XCData, options As VisualBasicParseOptions, ParamArray expectedDiagnostics() As DiagnosticDescription) As SyntaxTree 62Public Function ParseAndVerify(source As String, ParamArray expectedDiagnostics() As DiagnosticDescription) As SyntaxTree 66Public Function ParseAndVerify(source As String, options As VisualBasicParseOptions, ParamArray expectedDiagnostics() As DiagnosticDescription) As SyntaxTree 70Public Function ParseAndVerify(source As String, languageVersion As LanguageVersion, ParamArray expectedDiagnostics() As DiagnosticDescription) As SyntaxTree 74Public Function ParseAndVerify(source As String, languageVersion As LanguageVersion, errorCodesOnly As Boolean, ParamArray expectedDiagnostics() As DiagnosticDescription) As SyntaxTree 78Private Function ParseAndVerify(source As String, options As VisualBasicParseOptions, expectedDiagnostics() As DiagnosticDescription, errorCodesOnly As Boolean) As SyntaxTree 100Public Function Parse(code As XCData, Optional options As VisualBasicParseOptions = Nothing) As SyntaxTree 104Public Function Parse(code As String, Optional options As VisualBasicParseOptions = Nothing) As SyntaxTree 108Public Function Parse(source As String, fileName As String, Optional options As VisualBasicParseOptions = Nothing, Optional encoding As Encoding = Nothing) As SyntaxTree 294Public Function VerifySyntaxKinds(tree As SyntaxTree, ParamArray expected As SyntaxKind()) As SyntaxTree 317Public Function VerifyOccurrenceCount(tree As SyntaxTree, kind As SyntaxKind, expectedCount As Integer) As SyntaxTree 325Public Function TraverseAllNodes(tree As SyntaxTree) As SyntaxTree 331Public Function FindNodeOrTokenByKind(tree As SyntaxTree, kind As SyntaxKind, Optional occurrence As Integer = 1) As SyntaxNodeOrToken 370Public Function VerifyNoWhitespaceInKeywords(tree As SyntaxTree) As SyntaxTree 376Public Function VerifyNoMissingChildren(tree As SyntaxTree) As SyntaxTree 386Public Function VerifyNoZeroWidthNodes(tree As SyntaxTree) As SyntaxTree 396Public Function VerifyErrorsOnChildrenAlsoPresentOnParent(tree As SyntaxTree) As SyntaxTree 409Public Sub InternalVerifyErrorsOnChildrenAlsoPresentOnParent(node As SyntaxNodeOrToken, tree As SyntaxTree) 438Public Function VerifyNoAdjacentTriviaHaveSameKind(tree As SyntaxTree) As SyntaxTree 446Public Function VerifySpanOfChildWithinSpanOfParent(tree As SyntaxTree) As SyntaxTree 482Public Function GetMockTree() As SyntaxTree 545Public Overrides Function WithChangedText(newText As SourceText) As SyntaxTree 549Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 553Public Overrides Function WithFilePath(path As String) As SyntaxTree 557Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree 632Private Sub VerifyContainsErrors(node As SyntaxNodeOrToken, tree As SyntaxTree,
SyntaxTreeExtensions.vb (15)
16Public Function WithReplace(syntaxTree As SyntaxTree, offset As Integer, length As Integer, newText As String) As SyntaxTree 23Friend Function WithReplaceFirst(syntaxTree As SyntaxTree, oldText As String, newText As String) As SyntaxTree 31Public Function WithReplace(syntaxTree As SyntaxTree, startIndex As Integer, oldText As String, newText As String) As SyntaxTree 39Public Function WithInsertAt(syntaxTree As SyntaxTree, offset As Integer, newText As String) As SyntaxTree 44Public Function WithInsertBefore(syntaxTree As SyntaxTree, existingText As String, newText As String) As SyntaxTree 51Public Function WithRemoveAt(syntaxTree As SyntaxTree, offset As Integer, length As Integer) As SyntaxTree 56Public Function WithRemoveFirst(syntaxTree As SyntaxTree, oldText As String) As SyntaxTree 68Friend Function Dump(node As SyntaxTree) As String
VBParser.vb (1)
17Public Function Parse(code As String) As SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Workspaces (70)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (1)
38Public Function GetStartDirectives(syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of DirectiveTriviaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
637Public Function ReplaceStatements(tree As SyntaxTree, 713tree As SyntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (14)
121Public Function FindTriviaToLeft(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxTrivia 152Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 161Public Function IsWithinPartialMethodDeclaration(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 177Public Function IsEntirelyWithinComment(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 188Public Function IsEntirelyWithinStringLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 199Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 238Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 265Public Function IsInSkippedText(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 296Public Function IsGlobalStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 313Public Function IsRightOfDot(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 324Public Function IsRightOfIntegerLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 330Public Function IsInPreprocessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 336syntaxTree As SyntaxTree, 357Public Function GetFirstStatementOnLine(syntaxTree As SyntaxTree, lineNumber As Integer, cancellationToken As CancellationToken) As StatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (4)
123Public Function IsPreProcessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsPreProcessorDirectiveContext 127Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsEntirelyWithinStringOrCharOrNumericLiteral 1165Public Function GetInactiveRegionSpanAroundPosition(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TextSpan Implements ISyntaxFacts.GetInactiveRegionSpanAroundPosition 1760Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsInInactiveRegion
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (37)
14Friend Function GetTargetToken(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken 38Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 47Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, preProcessorTokenOnLeftOfPosition As SyntaxToken, cancellationToken As CancellationToken) As Boolean 63Public Function IsNamespaceContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 68Public Function IsNamespaceDeclarationNameContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 82Public Function IsPartialTypeDeclarationNameContext(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, ByRef statementSyntax As TypeStatementSyntax) As Boolean 106Public Function GetContainingTypeBlock(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TypeBlockSyntax 115Friend Function IsTypeDeclarationContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 122syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, allowAfterModifiersOrDim As Boolean, cancellationToken As CancellationToken, ParamArray allowedParentBlocks As SyntaxKind()) As Boolean 188Friend Function IsTypeMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 197Friend Function IsInterfaceMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 205Friend Function IsTypeDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 212Friend Function IsFieldNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 245Friend Function IsParameterNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 268Friend Function IsLabelContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 301Friend Function IsEnumMemberNameContext(syntaxTree As SyntaxTree, context As VisualBasicSyntaxContext) As Boolean 315Public Function IsDelegateCreationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 339syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 346syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 459Public Function IsAttributeNameContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 479Public Function IsTypeContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 545Private Sub PositionOutsideTupleIfApplicable(syntaxTree As SyntaxTree, ByRef position As Integer, 556Public Function IsNameOfContext(syntaxTree As SyntaxTree, position As Integer, Optional cancellationToken As CancellationToken = Nothing) As Boolean 572Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 582Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 625Friend Function IsMultiLineStatementStartContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 662Friend Function IsStartOfSelectCaseBlock(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 670Friend Function IsAfterStatementOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 684Friend Function IsInStatementBlockOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 716Public Function IsQueryIntoClauseContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 750Public Function IsRaiseEventContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 756Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 762Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 775Friend Function IsEnumTypeMemberAccessContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 811syntaxTree As SyntaxTree, 1072Friend Function IsPossibleTupleContext(syntaxTree As SyntaxTree, 1089Public Function IsInPreprocessorExpressionContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
349Return SyntaxTree.IsFollowingCompleteExpression( 369Return SyntaxTree.IsFollowingCompleteExpression(Of JoinClauseSyntax)(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (1)
57Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxFactsService.vb (2)
23Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFactsService.IsInNonUserCode 39Public Function GetSelectedFieldsAndPropertiesAsync(tree As SyntaxTree, textSpan As TextSpan, allowPartialSelection As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) Implements ISyntaxFactsService.GetSelectedFieldsAndPropertiesAsync
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\ModifierCollectionFacts.vb (2)
32Public Sub New(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) 302Private Shared Function ComputeAllowableDeclarationTypes(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As PossibleDeclarationTypes
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.NodeSyntaxReference.vb (1)
18Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (2)
76Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 88Public Overrides Function WithFilePath(path As String) As SyntaxTree
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.vb (2)
65Public Overrides Function ParseSyntaxTree(filePath As String, options As ParseOptions, text As SourceText, cancellationToken As CancellationToken) As SyntaxTree 73Public Overrides Function CreateSyntaxTree(filePath As String, options As ParseOptions, text As SourceText, encoding As Encoding, checksumAlgorithm As SourceHashAlgorithm, root As SyntaxNode) As SyntaxTree
Microsoft.CodeAnalysis.Workspaces (173)
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (1)
46/// will only be examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No
CodeFixes\FixAllOccurrences\FixAllProvider.cs (2)
54/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects 68/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (1)
48/// (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects of document (like it's properties),
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (2)
54/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects 68/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects
Diagnostics\AnalysisResultPair.cs (4)
16private ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedSyntaxDiagnostics; 17private ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedSemanticDiagnostics; 40public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedSyntaxDiagnostics 65public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedSemanticDiagnostics
Diagnostics\CompilationWithAnalyzersPair.cs (1)
82public async Task<AnalysisResultPair?> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
Diagnostics\DiagnosticAnalysisResultBuilder.cs (5)
117public void AddSyntaxDiagnostics(SyntaxTree tree, IEnumerable<Diagnostic> diagnostics) 123public void AddSemanticDiagnostics(SyntaxTree tree, IEnumerable<Diagnostic> diagnostics) 136ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, Diagnostic diagnostic) 159var diagnosticTree = diagnostic.Location.SourceTree; 189ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, IEnumerable<Diagnostic> diagnostics)
Diagnostics\DiagnosticDataLocation.cs (1)
104public DiagnosticDataLocation WithSpan(TextSpan newSourceSpan, SyntaxTree tree)
Diagnostics\Extensions.cs (5)
50var tree = textDocument is Document { SupportsSyntaxTree: true } document 113SyntaxTree? treeToAnalyze = null; 241SyntaxTree? tree, 258SyntaxTree? tree, 353var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Editing\SymbolEditor.cs (3)
210/// An action that make changes to a declaration node within a <see cref="SyntaxTree"/>. 218/// An action that make changes to a declaration node within a <see cref="SyntaxTree"/>. 327var sourceTree = location.SourceTree;
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
27public SyntaxTree SyntaxTree => this.SemanticModel.SyntaxTree;
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
124var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\SymbolFinder.cs (1)
116var syntaxTree = semanticModel.SyntaxTree;
ReassignedVariable\AbstractReassignedVariableService.cs (2)
50using var _3 = PooledDictionary<SyntaxTree, SemanticModel>.GetInstance(out var syntaxTreeToModel); 90SemanticModel GetSemanticModel(SyntaxTree syntaxTree)
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
355var baseSyntaxTree = await baseDocument.GetRequiredSyntaxTreeAsync(_cancellationToken).ConfigureAwait(false); 447var baseSyntaxTree = await baseDocument.GetRequiredSyntaxTreeAsync(_cancellationToken).ConfigureAwait(false);
Rename\IRemoteRenamerService.cs (1)
95var tree = await document.GetRequiredSyntaxTreeAsync(cancellation).ConfigureAwait(false);
Rename\RenameRewriterParameters.cs (1)
38internal readonly SyntaxTree OriginalSyntaxTree = semanticModel.SyntaxTree;
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
401SyntaxTree tree,
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (6)
44var previousSyntaxTree = previousSemanticModel.SyntaxTree; 45var currentSyntaxTree = currentBodyNode.SyntaxTree; 136private readonly SyntaxTree _originalSyntaxTree; 137private readonly SyntaxTree _updatedSyntaxTree; 140public NonEquivalentTreeException(string message, SyntaxTree originalSyntaxTree, SyntaxTree updatedSyntaxTree)
SemanticModelReuse\ISemanticModelReuseLanguageService.cs (1)
32/// at. In other words, they must be <see cref="SyntaxTree.IsEquivalentTo"/><c>(..., topLevel: true)</c>. This
Shared\Extensions\ProjectExtensions.cs (1)
37public static Document GetRequiredDocument(this Project project, SyntaxTree tree)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 106public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
44public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 64public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
13public static SyntaxTree GetSourceTreeOrThrow(this Location location) 38var tree = loc.SourceTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 36public static bool IsScript(this SyntaxTree syntaxTree) 44this SyntaxTree syntaxTree, 54this SyntaxTree syntaxTree, 63this SyntaxTree syntaxTree, 96public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 121public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 130this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 169this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 202this SyntaxTree syntaxTree, 217this SyntaxTree syntaxTree, 228public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 250public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
35public readonly SyntaxTree Tree; 43SyntaxTree tree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
35SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 39SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 43SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
160bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 189bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 421TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 492bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (7)
78var syntaxTree = locations[0].SourceTree; 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 116Compilation compilation, SyntaxTree? syntaxTree, 203SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 274private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 276foreach (var current in trees)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
77/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
453internal SyntaxTree? GetSyntaxTree(string filePath)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
15using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
146public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
242var destinationTree = destinationDeclaration.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
66var syntaxTree = destination.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
16public SyntaxTree SyntaxTree { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (4)
62public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 64if (document.TryGetSyntaxTree(out var syntaxTree)) 72public static SyntaxTree GetRequiredSyntaxTreeSynchronously(this Document document, CancellationToken cancellationToken) 74var syntaxTree = document.GetSyntaxTreeSynchronously(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (3)
20var syntaxTree = document.GetSyntaxTreeSynchronously(cancellationToken); 27var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 31private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
17bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 20Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
30public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Workspace\Host\SyntaxTreeFactory\AbstractSyntaxTreeFactoryService.cs (2)
20public abstract SyntaxTree CreateSyntaxTree(string filePath, ParseOptions options, SourceText text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root); 21public abstract SyntaxTree ParseSyntaxTree(string filePath, ParseOptions options, SourceText text, CancellationToken cancellationToken);
Workspace\Host\SyntaxTreeFactory\ISyntaxTreeFactoryService.cs (2)
30SyntaxTree CreateSyntaxTree(string? filePath, ParseOptions options, SourceText? text, Encoding? encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root); 33SyntaxTree ParseSyntaxTree(string? filePath, ParseOptions options, SourceText text, CancellationToken cancellationToken);
Workspace\Solution\Document.cs (16)
44private Task<SyntaxTree>? _syntaxTreeResultTask; 79public bool TryGetSyntaxTree([NotNullWhen(returnValue: true)] out SyntaxTree? syntaxTree) 160/// Gets the <see cref="SyntaxTree" /> for this document asynchronously. 165/// a cached result every subsequent time. <see cref="SyntaxTree"/>'s can hold onto their roots lazily. So calls 166/// to <see cref="SyntaxTree.GetRoot"/> or <see cref="SyntaxTree.GetRootAsync"/> may end up causing computation 169public Task<SyntaxTree?> GetSyntaxTreeAsync(CancellationToken cancellationToken = default) 174return SpecializedTasks.Null<SyntaxTree>(); 184if (TryGetSyntaxTree(out var tree)) 198internal SyntaxTree? GetSyntaxTreeSynchronously(CancellationToken cancellationToken) 216return this.TryGetSyntaxTree(out var tree) && tree.TryGetRoot(out root) && root != null; 234var tree = (await this.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false))!; 250var tree = this.GetSyntaxTreeSynchronously(cancellationToken)!; 351var syntaxTree = await this.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 477var tree = useAsync ? await GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false) : this.GetSyntaxTreeSynchronously(cancellationToken); 478var oldTree = useAsync ? await oldDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false) : oldDocument.GetSyntaxTreeSynchronously(cancellationToken);
Workspace\Solution\DocumentState.cs (15)
28private static readonly ConditionalWeakTable<SyntaxTree, DocumentId> s_syntaxTreeToIdMap = new(); 172var tree = treeFactory.ParseSyntaxTree(filePath, options, text, cancellationToken); 252private static TreeAndVersion MakeNewTreeAndVersion(SyntaxTree oldTree, SourceText oldText, VersionStamp oldVersion, SyntaxTree newTree, SourceText newText, VersionStamp newVersion) 261private static bool TopLevelChanged(SyntaxTree oldTree, SourceText oldText, SyntaxTree newTree, SourceText newText) 355SyntaxTree? newTree = null; 526var tree = factory.CreateSyntaxTree(attributes.SyntaxTreeFilePath, options, text: null, encoding, checksumAlgorithm, newRoot); 582public bool TryGetSyntaxTree([NotNullWhen(returnValue: true)] out SyntaxTree? syntaxTree) 596public async ValueTask<SyntaxTree> GetSyntaxTreeAsync(CancellationToken cancellationToken) 608internal SyntaxTree GetSyntaxTree(CancellationToken cancellationToken) 650private static void BindSyntaxTreeToId(SyntaxTree tree, DocumentId id) 662public static DocumentId? GetDocumentIdForTree(SyntaxTree tree) 669SyntaxTree newTree, 671SyntaxTree? oldTree = null,
Workspace\Solution\DocumentState_LinkedFileReuse.cs (2)
137var siblingTree = siblingRoot.SyntaxTree; 155var newTree = treeFactory.CreateSyntaxTree(
Workspace\Solution\Project.cs (3)
229public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) 235public Document? GetDocument(SyntaxTree? syntaxTree) 335/// generated. This method exists to implement <see cref="Solution.GetDocument(SyntaxTree?)"/> and is best avoided unless you're doing something
Workspace\Solution\ProjectState.cs (4)
395public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) 467public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) 588public override GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken cancellationToken) 595public override bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken cancellationToken, out ReportDiagnostic severity)
Workspace\Solution\Solution.cs (4)
226public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) => GetDocumentId(syntaxTree, projectId: null); 231public DocumentId? GetDocumentId(SyntaxTree? syntaxTree, ProjectId? projectId) 313public Document? GetDocument(SyntaxTree? syntaxTree) 316internal Document? GetDocument(SyntaxTree? syntaxTree, ProjectId? projectId)
Workspace\Solution\SolutionCompilationState.cs (1)
1199/// generated. This method exists to implement <see cref="Solution.GetDocument(SyntaxTree?)"/> and is best avoided unless you're doing something
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (6)
784using var _ = ArrayBuilder<SyntaxTree>.GetInstance(documentsWithTrees.Length, out var alreadyParsedTrees); 787if (documentState.TryGetSyntaxTree(out var alreadyParsedTree)) 953var syntaxTreesInWorkspaceStates = new HashSet<SyntaxTree>( 961ThrowExceptionIfFalse(documentInProjectState.Value.TryGetSyntaxTree(out var tree), "We should have a tree since we have a compilation that should contain it."); 970ThrowExceptionIfFalse(generatedDocument.Value.TryGetSyntaxTree(out var tree), "We should have a tree since we have a compilation that should contain it."); 977foreach (var tree in compilation.SyntaxTrees)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
253using var _ = ArrayBuilder<SyntaxTree>.GetInstance(out var treesToRemove);
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (3)
15internal DocumentState? GetDocumentState(SyntaxTree? syntaxTree, ProjectId? projectId) 31if (document.TryGetSyntaxTree(out var documentTree) && documentTree == syntaxTree) 81var syntaxTree = symbol.Locations[0].SourceTree;
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (2)
118var replacementSyntaxTree = await replacementState.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 124var existingSyntaxTree = await existingState.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\TreeAndVersion.cs (2)
10internal sealed class TreeAndVersion(SyntaxTree tree, VersionStamp version) 15public SyntaxTree Tree { get; } = tree;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (9)
VisualStudioMSBuildWorkspaceTests.cs (9)
61var tree = await document.GetSyntaxTreeAsync(); 437var tree = await document.GetSyntaxTreeAsync(); 458var tree = await document.GetSyntaxTreeAsync(); 476var tree = await document.GetSyntaxTreeAsync(); 895var tree = await document.GetSyntaxTreeAsync(); 914var tree = await document.GetSyntaxTreeAsync(); 2847var tree = document.UseReference(static d => d.GetSyntaxTreeAsync().Result); 2887var doc2tree = await doc2.GetSyntaxTreeAsync(); 2900var doc3tree = await doc3.GetSyntaxTreeAsync();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
788private static SyntaxTree CreateSyntaxTree(ParseOptions options, string referencedCode)
Microsoft.CodeAnalysis.Workspaces.UnitTests (86)
BatchFixAllProviderTests.cs (1)
124var tree = await document.GetSyntaxTreeAsync(cancellationToken);
FindReferencesTests.cs (3)
141var tree = Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.ParseText( 200var tree = Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.ParseText( 232var tree = Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(
FormattingTests.cs (3)
72var tree = CS.SyntaxFactory.ParseSyntaxTree(input); 78var tree = VB.SyntaxFactory.ParseSyntaxTree(input); 82private static void AssertFormat(string expected, SyntaxTree tree, SyntaxFormattingOptions options)
SolutionTests\SolutionTests.cs (33)
304var tree = CS.SyntaxFactory.ParseSyntaxTree("class NewClass {}"); 338var tree = compilation.SyntaxTrees.Single(); 3187var tree = document.GetSyntaxTreeAsync().Result; 3195var tree2 = doc2.GetSyntaxTreeAsync().Result; 3246var tree = await documentWithAttribute.GetSyntaxTreeAsync(CancellationToken.None); 3399var docTree = doc.GetSyntaxTreeAsync().Result; 3420var docTree = doc.GetSyntaxTreeAsync().Result; 3684var tree = doc.GetSyntaxTreeAsync().Result; 3701var tree2 = doc2.GetSyntaxTreeAsync().Result; 3776var tree = document.GetSyntaxTreeSynchronously(default); 3779var tree2 = tree.WithFilePath("new path"); 3807var tree3 = tree.WithRootAndOptions(newRoot, tree.Options); 3818var tree4 = tree.WithRootAndOptions(tree.GetRoot(), newOptions); 3925var syntaxTree = compilation.SyntaxTrees.Single(); 4081var tree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 4106var tree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 4135var tree = await documentToFreezeChanged.GetSyntaxTreeAsync(); 4180var tree = await documentToFreezeChanged.GetSyntaxTreeAsync(); 4275var singleTree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 4554var strongTree = factory.ParseSyntaxTree("dummy", dummyProject.ParseOptions, text, CancellationToken.None); 4568ImmutableArray<SyntaxTree> GetSyntaxTrees() 4679var originalSyntaxTree = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4690var newSyntaxTree = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4723var syntaxTreeAfterAddingEditorConfig = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4734var syntaxTreeAfterRemovingEditorConfig = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4764var syntaxTreeBeforeEditorConfigChange = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4777var syntaxTreeAfterEditorConfigChange = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4842var originalSyntaxTree = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 4858var newSyntaxTree = await solution.GetDocument(sourceDocumentId).GetSyntaxTreeAsync(); 5446var newDocTree = await newDoc.GetSyntaxTreeAsync(); 5711var syntaxTree1 = await project1.Documents.Single().GetSyntaxTreeAsync(); 5717var forkedSyntaxTree1 = await forkedDocument1.GetSyntaxTreeAsync(); 5744var syntaxTree1 = await project1.Documents.Single().GetSyntaxTreeAsync();
SolutionTests\SolutionWithSourceGeneratorTests.cs (6)
486var generatedTreeBeforeChange = await Assert.Single(await project.GetSourceGeneratedDocumentsAsync()).GetSyntaxTreeAsync(); 491var generatedTreeAfterChange = await Assert.Single(await project.GetSourceGeneratedDocumentsAsync()).GetSyntaxTreeAsync(); 506var generatedTreeBeforeChange = await Assert.Single(await project.GetSourceGeneratedDocumentsAsync()).GetSyntaxTreeAsync(); 512var generatedTreeAfterChange = await Assert.Single(await project.GetSourceGeneratedDocumentsAsync()).GetSyntaxTreeAsync(); 603var generatedTree = await generatedDocument.GetSyntaxTreeAsync(); 650var generatedTree = await generatedDocument.GetSyntaxTreeAsync();
SymbolKeyTests.cs (15)
618var tree = compilation.SyntaxTrees.First(); 654var tree = compilation.SyntaxTrees.First(); 676var tree = compilation.SyntaxTrees.First(); 701var tree = compilation.SyntaxTrees.First(); 719var tree = compilation.SyntaxTrees.First(); 737var tree = compilation.SyntaxTrees.First(); 757var tree = compilation.SyntaxTrees.First(); 780var tree = compilation.SyntaxTrees.First(); 823var tree = compilation.SyntaxTrees.First(); 837var tree = compilation.SyntaxTrees.First(); 1273var tree = compilation1.SyntaxTrees.Single(); 1415var syntaxTree = compilation.SyntaxTrees.Single(); 1419var newTree = syntaxTree.WithChangedText(text.WithChanges(new TextChange(new TextSpan(0, text.Length), text.ToString().Replace(" ", " ")))); 1481var tree = CSharp.SyntaxFactory.ParseSyntaxTree(source, path: path); 1486var tree = VisualBasic.SyntaxFactory.ParseSyntaxTree(source, path: path);
SyntaxNodeTests.cs (2)
29var tree = SyntaxFactory.ParseSyntaxTree(text); 50var tree = SyntaxFactory.ParseSyntaxTree(text);
SyntaxPathTests.cs (22)
80var tree = SyntaxFactory.ParseSyntaxTree(string.Empty); 91var tree = SyntaxFactory.ParseSyntaxTree(string.Empty); 96var newTree = tree.WithChangedText(newText); 105var tree = SyntaxFactory.ParseSyntaxTree(text); 110var newTree = tree.WithChangedText(newText); 119var tree = SyntaxFactory.ParseSyntaxTree(text); 146var tree = SyntaxFactory.ParseSyntaxTree(text); 184var tree = SyntaxFactory.ParseSyntaxTree(text); 217var tree = SyntaxFactory.ParseSyntaxTree(text); 249var tree = SyntaxFactory.ParseSyntaxTree(text); 277var tree = SyntaxFactory.ParseSyntaxTree(text); 308var tree = SyntaxFactory.ParseSyntaxTree(text); 337var tree = SyntaxFactory.ParseSyntaxTree(text); 376var tree = SyntaxFactory.ParseSyntaxTree(text); 398var tree = SyntaxFactory.ParseSyntaxTree(text); 403var newTree = tree.WithChangedText(newText); 419public static SyntaxTree WithReplaceFirst(SyntaxTree syntaxTree, string oldText, string newText) 427public static SyntaxTree WithReplace(SyntaxTree syntaxTree, int offset, int length, string newText) 434public static SyntaxTree WithReplace(SyntaxTree syntaxTree, int startIndex, string oldText, string newText)
UtilityTest\DocumentationCommentIdTests.cs (1)
19var syntaxTree = SyntaxFactory.ParseSyntaxTree(sourceText);
Microsoft.DotNet.GenFacades (9)
NotSupportedAssemblyGenerator.cs (1)
69SyntaxTree syntaxTree;
TypeParser.cs (8)
28foreach (var tree in syntaxTreeCollection) 37private static void AddTypesFromTypeForwards(SyntaxTree tree, HashSet<string> types) 56private static void AddBaseTypes(SyntaxTree tree, HashSet<string> types) 70private static void AddTypesFromDelegates(SyntaxTree tree, HashSet<string> types) 133private static IEnumerable<SyntaxTree> GetSourceTrees(IEnumerable<string> sourceFiles, IEnumerable<string> constants, LanguageVersion languageVersion) 136List<SyntaxTree> result = new List<SyntaxTree>(); 147SyntaxTree tree = CSharpSyntaxTree.ParseText(File.ReadAllText(sourceFile), options);
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
75foreach (IGrouping<SyntaxTree, ClassDeclarationSyntax> group in classes.GroupBy(x => x.SyntaxTree)) 77SyntaxTree syntaxTree = group.Key;
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
35IEnumerable<IGrouping<SyntaxTree, TypeDeclarationSyntax>> typesBySyntaxTree = classes.GroupBy(x => x.SyntaxTree);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
203public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => throw new System.NotSupportedException();
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
EmitterTests.cs (4)
36var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct); 60var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct); 89var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct); 117var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct);
Microsoft.Gen.Logging (1)
Parsing\Parser.cs (1)
53SyntaxTree syntaxTree = group.Key;
Microsoft.Gen.MetricsReports.Unit.Tests (1)
GeneratorTests.cs (1)
193public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => throw new NotSupportedException();
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (2)
572SyntaxTree documentSyntaxTree, 629private static bool ShouldUseCollectionExpression(Document document, SyntaxTree syntaxTree)
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
187var tree = CSharpSyntaxTree.ParseText(trainProgramCSFileContent);
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
170var tree = await document.GetSyntaxTreeAsync(cancellationToken); 181var tree = await document.GetSyntaxTreeAsync(cancellationToken);
Microsoft.VisualStudio.LanguageServices (6)
Progression\GraphBuilder.cs (1)
204var syntaxTree = await contextDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Progression\SymbolContainment.cs (1)
25var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
TaskList\ProjectExternalErrorReporter.cs (1)
321var tree = document.GetSyntaxTreeSynchronously(CancellationToken.None);
Venus\ContainedLanguageCodeSupport.cs (3)
65var tree = document.GetSyntaxTreeSynchronously(cancellationToken); 208var targetSyntaxTree = targetDocument.GetSyntaxTreeSynchronously(cancellationToken); 490var containingTree = document.GetSyntaxTreeSynchronously(cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp (6)
CodeModel\CSharpCodeModelService.cs (2)
41private static readonly SyntaxTree s_emptyTree = SyntaxFactory.ParseSyntaxTree(SourceText.From("", encoding: null, SourceHashAlgorithms.Default)); 3043var tree = compilation.SyntaxTrees.FirstOrDefault();
Interactive\CSharpInteractiveWindowCommandCompletionProvider.cs (1)
47protected override bool ShouldDisplayCommandCompletions(SyntaxTree tree, int position, CancellationToken cancellationToken)
LanguageService\CSharpDebuggerIntelliSenseContext.cs (1)
67var tree = document.GetSyntaxTreeSynchronously(CancellationToken.None);
ProjectSystemShim\TempPECompilerService.cs (1)
41var trees = new List<SyntaxTree>(capacity: sourceCount);
Snippets\SnippetCommandHandler.cs (1)
131var syntaxTree = document.GetSyntaxTreeSynchronously(cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
CodeModel\FileCodeFunctionTests.cs (2)
496var tree = await (GetCurrentDocument()).GetSyntaxTreeAsync(); 509var tree = await (GetCurrentDocument()).GetSyntaxTreeAsync();
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
36Private Shared ReadOnly s_emptyTree As SyntaxTree = SyntaxFactory.ParseSyntaxTree(SourceText.From("", encoding:=Nothing, SourceHashAlgorithms.Default))
Mvc.Api.Analyzers.Test (4)
ActualApiResponseMetadataFactoryTest.cs (4)
74var syntaxTree = returnType.DeclaringSyntaxReferences[0].SyntaxTree; 373var syntaxTree = method.DeclaringSyntaxReferences[0].SyntaxTree; 391var syntaxTree = controllerType.DeclaringSyntaxReferences[0].SyntaxTree; 410var syntaxTree = returnType.DeclaringSyntaxReferences[0].SyntaxTree;
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.cs (1)
32protected abstract Compilation CreateCompilation(SyntaxTree tree);
StackDepthTest (2)
Program.cs (2)
79var tree = SyntaxFactory.ParseSyntaxTree(SourceText.From(stringText, encoding: null, SourceHashAlgorithm.Sha256), parseOptions); 81var comp = CSharpCompilation.Create("assemblyName", new SyntaxTree[] { tree }, references: new MetadataReference[] { reference }, options: options);
System.Windows.Forms.Analyzers.CSharp.Tests (1)
CompilerAnalyzerConfigOptionsProvider.cs (1)
33public override AnalyzerConfigOptions GetOptions(SyntaxTree tree)
System.Windows.Forms.PrivateSourceGenerators (2)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (2)
203var semanticModelCache = new Dictionary<SyntaxTree, SemanticModel>(); 233SemanticModel GetSemanticModel(Compilation compilation, SyntaxTree syntaxTree)
System.Windows.Forms.PrivateSourceGenerators.Tests (2)
EnumValidationTests.cs (2)
291SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); 303CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));