260 references to SyntaxTree
Microsoft.CodeAnalysis.CSharp (106)
Binder\Binder_Attributes.cs (1)
115bool isConditionallyOmitted = binder.IsAttributeConditionallyOmitted(attribute.AttributeClass, attributeSyntax.SyntaxTree, ref useSiteInfo);
Binder\Binder_Crefs.cs (4)
1102Debug.Assert(typeArgumentSyntax.ContainsDiagnostics || !typeArgumentSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics() || 1164Debug.Assert(!this.Compilation.ContainsSyntaxTree(typeSyntax.SyntaxTree) || 1165this.Compilation.GetBinderFactory(typeSyntax.SyntaxTree).GetBinder(typeSyntax).Flags == 1192Debug.Assert(type.TypeKind != TypeKind.Error || typeSyntax.ContainsDiagnostics || !typeSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(), "Why wasn't there a diagnostic?");
Binder\Binder_Expressions.cs (3)
2263return node.SyntaxTree == declarator.SyntaxTree; 7355diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 1, 1))); 7359diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 2, 1)));
Binder\Binder_InterpolatedString.cs (1)
78var text = node.SyntaxTree.GetText();
Binder\Binder_Lookup.cs (1)
336bool isSubmissionTree = Compilation.IsSubmissionSyntaxTree(declarationSyntax.SyntaxTree);
Binder\Binder_Operators.cs (2)
4654((CSharpParseOptions)node.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeaturePatternMatching)) 4701if (wasUnderscore && ((CSharpParseOptions)node.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeatureRecursivePatterns))
Binder\Binder_Patterns.cs (1)
907Debug.Assert(designation.SyntaxTree.Options.Kind != SourceCodeKind.Regular);
Binder\Binder_Query.cs (1)
738SourceLocation errorLocation = new SourceLocation(let.SyntaxTree, new TextSpan(let.Identifier.SpanStart, let.Expression.Span.End - let.Identifier.SpanStart));
Binder\Binder_Statements.cs (3)
3443return Location.Create(lambdaSyntax.SyntaxTree, 3447return Location.Create(anonymousMethodSyntax.SyntaxTree, 3918BinderFactory binderFactory = compilation.GetBinderFactory(containerNode.SyntaxTree);
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
970bool isSubmissionTree = compilation.IsSubmissionSyntaxTree(compilationUnit.SyntaxTree); 1265if (primaryConstructor.SyntaxRef.SyntaxTree == memberSyntax.SyntaxTree &&
Binder\SwitchBinder.cs (1)
36((CSharpParseOptions)SwitchSyntax.SyntaxTree.Options)?.IsFeatureEnabled(MessageID.IDS_FeaturePatternMatching) != false;
Binder\WithExternAndUsingAliasesBinder.cs (1)
180if (declaration.HasGlobalUsings && compilationUnit.SyntaxTree != declaration.SyntaxReference.SyntaxTree)
CodeGen\CodeGenerator.cs (1)
338EmitSequencePoint(blockSyntax.SyntaxTree, blockSyntax.CloseBraceToken.Span);
Compilation\CSharpCompilation.cs (6)
1271RoslynDebug.Assert(directive.SyntaxTree.FilePath is object); 1274return ReferenceDirectiveMap.TryGetValue((directive.SyntaxTree.FilePath, directive.File.ValueText), out reference) ? reference : null; 2548var key = (node.SyntaxTree.GetText().GetContentHash(), node.Position); 2663return GetBinderFactory(syntax.SyntaxTree).GetBinder(syntax); 2833TryAdd(new ImportInfo(syntax.SyntaxTree, syntax.Kind(), syntax.Span), default); 2839_lazyImportInfos.TryUpdate(new ImportInfo(syntax.SyntaxTree, syntax.Kind(), syntax.Span), dependencies, default);
Compilation\CSharpSemanticModel.cs (3)
1389if (this.Compilation.ContainsSyntaxTree(syntax.SyntaxTree)) 5243&& primaryConstructor.SyntaxRef.SyntaxTree == node.SyntaxTree 5445var syntaxTree = (CSharpSyntaxTree)Root.SyntaxTree;
Compilation\MemberSemanticModel.cs (4)
1153return _root.SyntaxTree; 2422if (node.SyntaxTree == _semanticModel.SyntaxTree) 2451if (statement.WasCompilerGenerated && node.SyntaxTree == _semanticModel.SyntaxTree) 2476if (node.SyntaxTree == _semanticModel.SyntaxTree)
Compilation\SpeculativeSyntaxTreeSemanticModel.cs (1)
50: base(parentSemanticModel.Compilation, parentSemanticModel.SyntaxTree, root.SyntaxTree, parentSemanticModel.Options)
Compiler\DocumentationCommentCompiler.cs (2)
661bool reportDiagnosticsForCurrentTrivia = trivia.SyntaxTree.ReportDocumentationCommentDiagnostics(); 699Location location = new SourceLocation(trivia.SyntaxTree, new TextSpan(trivia.SpanStart, 0));
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (2)
149BinderFactory factory = _compilation.GetBinderFactory(cref.SyntaxTree); 186BinderFactory factory = _compilation.GetBinderFactory(nameAttr.SyntaxTree);
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
104Debug.Assert(sourceIncludeElementNodes.All(syntax => syntax.SyntaxTree.Options.DocumentationMode < DocumentationMode.Diagnose), 271bool diagnose = originatingSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(); 516Binder binder = BinderFactory.MakeCrefBinder(crefSyntax, memberDeclSyntax, _compilation.GetBinderFactory(memberDeclSyntax.SyntaxTree)); 539Binder binder = MakeNameBinder(isParameter, isTypeParameterRef, _memberSymbol, _compilation, originatingSyntax.SyntaxTree);
Declarations\DeclarationTreeBuilder.cs (1)
253syntaxReference: firstGlobalStatement.SyntaxTree.GetReference(firstGlobalStatement.Parent),
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
35if (syntaxNode.SyntaxTree.Options.DocumentationMode < DocumentationMode.Parse)
FlowAnalysis\NullableWalker.cs (1)
9288location = Location.Create(lambdaSyntax.SyntaxTree, new Text.TextSpan(start, lambdaSyntax.ArrowToken.Span.End - start));
Parser\Blender.cs (1)
151var column = oldTree.SyntaxTree.GetLineSpan(new TextSpan(start, 0)).Span.Start.Character;
Symbols\AliasSymbol.cs (1)
401.GetBinderFactory(syntax.SyntaxTree)
Symbols\ConstantValueUtils.cs (1)
37var binderFactory = compilation.GetBinderFactory(equalsValueNode.SyntaxTree);
Symbols\Extensions\SynthesizedExtensionMarker.cs (1)
75BinderFactory binderFactory = this.DeclaringCompilation.GetBinderFactory(parameterList.SyntaxTree);
Symbols\LexicalSortKey.cs (1)
83: this(node.SyntaxTree, node.SpanStart, compilation)
Symbols\NamespaceOrTypeSymbol.cs (1)
228if (loc.IsInSource && loc.SourceTree == syntax.SyntaxTree && syntax.Span.Contains(loc.SourceSpan))
Symbols\Source\ModifierUtils.cs (1)
124if (MessageID.IDS_FeatureRefFields.GetFeatureAvailabilityDiagnosticInfo((CSharpParseOptions)syntax.SyntaxTree.Options) is { } diagnosticInfo)
Symbols\Source\SourceAssemblySymbol.cs (4)
1684QuickAttributeChecker checker = this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker; 1690QuickAttributeChecker checker = this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker; 1696QuickAttributeChecker checker = this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker; 1763this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker;
Symbols\Source\SourceConstructorSymbolBase.cs (3)
37var binderFactory = this.DeclaringCompilation.GetBinderFactory(syntax.SyntaxTree); 184if (tree == ctorSyntax.SyntaxTree) 203if (tree == ctorInitializer?.SyntaxTree)
Symbols\Source\SourceMemberContainerSymbol.cs (4)
3356Debug.Assert(declaredMembers.DeclarationWithParameters.SyntaxTree == InstanceInitializersForPositionalMembers[0].Syntax.SyntaxTree); 3382declaredMembers.DeclarationWithParameters.SyntaxTree == declaredMembers.InstanceInitializers[insertAt][0].Syntax.SyntaxTree && 3404Debug.Assert(!declaredMembers.InstanceInitializers.Any(g => declaredMembers.DeclarationWithParameters.SyntaxTree == g[0].Syntax.SyntaxTree && 4541Debug.Assert(node.SyntaxTree == initializers.Last().Syntax.SyntaxTree);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
654return fieldDeclaration.SyntaxTree.HasCompilationUnitRoot && fieldDeclaration.Span.IntersectsWith(definedWithinSpan.Value);
Symbols\Source\SourceMemberMethodSymbol.cs (2)
773Binder result = (binderFactoryOpt ?? this.DeclaringCompilation.GetBinderFactory(contextNode.SyntaxTree)).GetBinder(contextNode); 1092Debug.Assert(this.SyntaxNode.SyntaxTree == localTree);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
996if (!hasError && !CallsAreOmitted(arguments.AttributeSyntaxOpt.SyntaxTree)) 1039var interceptorsNamespaces = ((CSharpParseOptions)attributeNameSyntax.SyntaxTree.Options).InterceptorsNamespaces; 1176var interceptorsNamespaces = ((CSharpParseOptions)attributeSyntax.SyntaxTree.Options).InterceptorsNamespaces;
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (6)
74if (declarationSyntaxRef.SyntaxTree != declarationSyntax.SyntaxTree) 765declarationBinder ??= compilation.GetBinderFactory(declarationSyntax.SyntaxTree).GetBinder(usingDirective.NamespaceOrType).WithAdditionalFlags(flags); 779diagnostics.Add(!globalUsingNamespacesOrTypes.IsEmpty && getOrCreateUniqueGlobalUsingsNotInTree(ref uniqueGlobalUsings, globalUsingNamespacesOrTypes, declarationSyntax.SyntaxTree).Contains(imported) ? 805diagnostics.Add(!globalUsingNamespacesOrTypes.IsEmpty && getOrCreateUniqueGlobalUsingsNotInTree(ref uniqueGlobalUsings, globalUsingNamespacesOrTypes, declarationSyntax.SyntaxTree).Contains(imported) ? 1044if (!Compilation.ReportUnusedImportsInTree(alias.ExternAliasDirective!.SyntaxTree)) 1068if (Compilation.ReportUnusedImportsInTree(usingDirective.SyntaxTree))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (3)
117var withTypeParamsBinder = this.DeclaringCompilation.GetBinderFactory(syntax.SyntaxTree).GetBinder(syntax.ReturnType, syntax, this); 1082.GetBinderFactory(syntax.SyntaxTree) 1109.GetBinderFactory(syntax.SyntaxTree)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
408var binderFactory = compilation.GetBinderFactory(syntax.SyntaxTree);
Symbols\Source\SourcePropertySymbol.cs (1)
53((CSharpParseOptions)syntax.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeatureFieldKeyword));
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
316GetBinderFactory(declarationSyntax.SyntaxTree).GetBinder(returnTypeSyntax, declarationSyntax, this);
Symbols\Symbol_Attributes.cs (1)
696var parseOptions = (CSharpParseOptions)targetOpt.SyntaxTree.Options;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (2)
108InMethodBinder result = (binderFactoryOpt ?? this.DeclaringCompilation.GetBinderFactory(typeDecl.SyntaxTree)).GetPrimaryConstructorInMethodBinder(this); 173if (attributeDeclarationSyntax.SyntaxTree == SyntaxRef.SyntaxTree &&
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
99if (entryPoint.SyntaxTree == compilationUnit.SyntaxTree && entryPoint.SyntaxNode == compilationUnit) 222Binder result = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxNode.SyntaxTree, compilation.Options.SourceReferenceResolver));
Syntax\CSharpSyntaxNode.cs (16)
41/// Returns a non-null <see cref="SyntaxTree"/> that owns this node. 42/// If this node was created with an explicit non-null <see cref="SyntaxTree"/>, returns that tree. 43/// Otherwise, if this node has a non-null parent, then returns the parent's <see cref="SyntaxTree"/>. 44/// Otherwise, returns a newly created <see cref="SyntaxTree"/> rooted at this node, preserving this node's reference identity. 205return this.SyntaxTree.GetReference(this); 215return this.SyntaxTree.GetDiagnostics(this); 458return this.SyntaxTree; 470return SyntaxReplacer.Replace(this, nodes, computeReplacementNode, tokens, computeReplacementToken, trivia, computeReplacementTrivia).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 475return SyntaxReplacer.ReplaceNodeInList(this, originalNode, replacementNodes).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 480return SyntaxReplacer.InsertNodeInList(this, nodeInList, nodesToInsert, insertBefore).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 485return SyntaxReplacer.ReplaceTokenInList(this, originalToken, newTokens).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 490return SyntaxReplacer.InsertTokenInList(this, originalToken, newTokens, insertBefore).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 495return SyntaxReplacer.ReplaceTriviaInList(this, originalTrivia, newTrivia).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 500return SyntaxReplacer.InsertTriviaInList(this, originalTrivia, newTrivia, insertBefore).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 505return SyntaxNodeRemover.RemoveNodes(this, nodes.Cast<CSharpSyntaxNode>(), options).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 510return SyntaxNormalizer.Normalize(this, indentation, eol, elasticTrivia).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree);
Syntax\CSharpSyntaxTree.cs (1)
391/// <para>NOTE: This method is only intended to be used from <see cref="CSharpSyntaxNode.SyntaxTree"/> property and <c>SyntaxFactory.Parse*</c> methods.</para>
Syntax\SyntaxFacts.cs (1)
540return IsTopLevelStatement(syntax) && syntax.SyntaxTree.Options.Kind == SourceCodeKind.Regular;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyTestBase.cs (1)
283var model = _compilation.GetSemanticModel(declarator.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\PDBTests.cs (2)
135").SyntaxTree; 138").SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (50)
FirstClassSpanTests.cs (1)
8876var model = comp.GetSemanticModel(invocation.SyntaxTree);
Semantics\OutVarTests.cs (18)
3467tree = initializer.SyntaxTree; 3508tree = initializer.SyntaxTree; 4007tree = statement.SyntaxTree; 5113tree = statement.SyntaxTree; 8807tree = statement.SyntaxTree; 9646tree = statement.SyntaxTree; 10214tree = statement.SyntaxTree; 10863tree = statement.SyntaxTree; 13343tree = statement.SyntaxTree; 13742tree = statement.SyntaxTree; 15263tree = statement.SyntaxTree; 16541tree = statement.SyntaxTree; 17100tree = statement.SyntaxTree; 17536tree = statement.SyntaxTree; 21302tree = statement.SyntaxTree; 32511var tree = node1.SyntaxTree; 34339syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 34553syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree;
Semantics\PatternMatchingTests_Scope.cs (13)
412tree = statement.SyntaxTree; 717tree = statement.SyntaxTree; 986tree = statement.SyntaxTree; 1290tree = statement.SyntaxTree; 5346tree = statement.SyntaxTree; 6476tree = statement.SyntaxTree; 6887tree = statement.SyntaxTree; 7216tree = statement.SyntaxTree; 7539tree = statement.SyntaxTree; 9645tree = statement.SyntaxTree; 10208tree = statement.SyntaxTree; 10724tree = statement.SyntaxTree; 12149tree = statement.SyntaxTree;
Semantics\PrimaryConstructorTests.cs (11)
2187var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx"); 2188var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray(); 3803Assert.Same(literal.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3829Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3847Assert.Same(initializer.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3878Assert.Same(baseType.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3905Assert.Same(@class.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 5292Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5310Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5328Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5357Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\RecordTests.cs (7)
22403var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx"); 22404var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray(); 26347Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26373Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26391Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26422Assert.Same(baseType.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26445Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_IVariableDeclaration.cs (4)
1218syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 2304syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 2365syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 2833syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\ReadOnlyStructsTests.cs (1)
1267var semanticModel = comp.GetSemanticModel(testMethodSyntax.SyntaxTree);
Semantics\RecordStructTests.cs (4)
6062Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6080Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6098Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6127Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\ScriptSemanticsTests.cs (3)
1180var syntaxTree = compilationUnit.SyntaxTree; 1268var syntaxTree1 = compilationUnit.SyntaxTree; 1307var syntaxTree = compilationUnit.SyntaxTree;
Semantics\SyntaxTreeRootTests.cs (5)
84var tree = node.SyntaxTree; 85Assert.Equal(tree, node.SyntaxTree); 93var childTree = node.Operand.SyntaxTree; 94var parentTree = node.SyntaxTree; 103Assert.Equal(tree, tree.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single().SyntaxTree);
Semantics\TopLevelStatementsTests.cs (1)
6510Assert.Same(globalStatement.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
SourceGeneration\GeneratorDriverTests.cs (1)
2720Assert.True(compilation.SyntaxTrees.Contains(node.SyntaxTree));
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (7)
192step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single())); 222step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single())); 249step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First())); 276step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Last())); 304step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First()), 305step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Last())); 1594steps.Select(s => ((ClassDeclarationSyntax)s.Outputs.Single().Value).SyntaxTree),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (13)
Compilation\CompilationAPITests.cs (1)
786SyntaxTree withExpressionRootTree = SyntaxFactory.ParseExpression(s3).SyntaxTree;
DocumentationComments\CrefTests.cs (12)
2014var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2053var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2107var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 5850var model = compilation.GetSemanticModel(cref.SyntaxTree); 5899var model = compilation.GetSemanticModel(cref.SyntaxTree); 5923var model = compilation.GetSemanticModel(cref.SyntaxTree); 5947var model = compilation.GetSemanticModel(cref.SyntaxTree); 5972var model = compilation.GetSemanticModel(cref.SyntaxTree); 5996var model = compilation.GetSemanticModel(cref.SyntaxTree); 6024var model = compilation.GetSemanticModel(cref.SyntaxTree); 6046var model = compilation.GetSemanticModel(typeParameterSyntax.SyntaxTree); 6070var model = compilation.GetSemanticModel(methodNameSyntax.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (60)
Parsing\LocalFunctionParsingTests.cs (6)
1182file.SyntaxTree.GetDiagnostics().Verify(); 1247file.SyntaxTree.GetDiagnostics().Verify( 1291file.SyntaxTree.GetDiagnostics().Verify(); 1293Assert.Equal(0, file.SyntaxTree.Options.Features.Count); 1345Assert.Equal(0, file.SyntaxTree.Options.Features.Count); 1706file.SyntaxTree.GetDiagnostics().Verify();
Syntax\SyntaxFactoryTests.cs (11)
53var text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText(); 688Assert.Same(parseOptions, argList.SyntaxTree.Options); 691Assert.Same(parseOptions, attrArgList.SyntaxTree.Options); 694Assert.Same(parseOptions, bracketedArgList.SyntaxTree.Options); 697Assert.Same(parseOptions, bracketedParamList.SyntaxTree.Options); 700Assert.Same(parseOptions, compUnit.SyntaxTree.Options); 703Assert.Same(parseOptions, expr.SyntaxTree.Options); 706Assert.Same(parseOptions, memberDecl.SyntaxTree.Options); 709Assert.Same(parseOptions, paramList.SyntaxTree.Options); 712Assert.Same(parseOptions, statement.SyntaxTree.Options); 715Assert.Same(parseOptions, typeName.SyntaxTree.Options);
Syntax\SyntaxNodeTests.cs (12)
3656var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChanges(SecondUsingClause.SyntaxTree); 3667var ChangesFromTransform = ThirdUsingClause.SyntaxTree.GetChanges(newUsingClause.SyntaxTree); 3671SyntaxTree x = ThirdUsingClause.SyntaxTree; 3672SyntaxTree y = newUsingClause.SyntaxTree; 3706var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChanges(SecondUsingClause.SyntaxTree); 3711Assert.Throws<ArgumentNullException>(() => FirstUsingClause.SyntaxTree.GetChanges(BlankTree)); 3739var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChangedSpans(SecondUsingClause.SyntaxTree); 3744Assert.Throws<ArgumentNullException>(() => FirstUsingClause.SyntaxTree.GetChangedSpans(BlankTree));
Syntax\SyntaxRewriterTests.cs (30)
315Assert.NotNull(node.SyntaxTree); 316Assert.False(node.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 317Assert.Same(node, node.SyntaxTree.GetRoot()); 324Assert.NotNull(node1.SyntaxTree); 325Assert.True(node1.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 326Assert.Same(node1, node1.SyntaxTree.GetRoot()); 328Assert.NotNull(node2.SyntaxTree); 329Assert.False(node2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 330Assert.Same(node2, node2.SyntaxTree.GetRoot()); 338Assert.Same(tree, tree.GetCompilationUnitRoot().ReplaceToken(tokenT, tokenT).SyntaxTree); 340Assert.NotNull(newRoot.SyntaxTree); 341Assert.True(newRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 342Assert.Same(newRoot, newRoot.SyntaxTree.GetRoot()); 350Assert.Same(tree, tree.GetCompilationUnitRoot().ReplaceNode(typeName, typeName).SyntaxTree); 352Assert.NotNull(newRoot.SyntaxTree); 353Assert.True(newRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 354Assert.Same(newRoot, newRoot.SyntaxTree.GetRoot()); 406var newTree = newNode.SyntaxTree; 413var newTree2 = newNode2.SyntaxTree; 540Assert.NotNull(tree.GetCompilationUnitRoot().SyntaxTree); 558Assert.NotNull(expr1.SyntaxTree); 559Assert.False(expr1.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 560Assert.Same(ifStmt1, expr1.SyntaxTree.GetRoot()); 576Assert.NotNull(expr2.SyntaxTree); 577Assert.False(expr2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 578Assert.Same(ifStmt2, expr2.SyntaxTree.GetRoot()); 606Assert.Equal(tree1, expr1.SyntaxTree); 622Assert.NotNull(expr2.SyntaxTree); 623Assert.False(expr2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 624Assert.Same(ifStmt2, expr2.SyntaxTree.GetRoot());
Syntax\SyntaxTreeTests.cs (1)
88SyntaxTreeFactoryKind.SynthesizedSyntaxTree => SyntaxNode.CloneNodeAsRoot(root, syntaxTree: null).SyntaxTree,
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
2407var binderFactory = compilation.GetBinderFactory(crefSyntax.SyntaxTree);
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\RudeEditDiagnosticTests.cs (1)
22var tree = SyntaxFactory.ParseCompilationUnit("class C { }").SyntaxTree;