244 references to SyntaxTree
Microsoft.CodeAnalysis.CSharp (102)
Binder\Binder_Attributes.cs (1)
116bool isConditionallyOmitted = binder.IsAttributeConditionallyOmitted(attribute.AttributeClass, attributeSyntax.SyntaxTree, ref useSiteInfo);
Binder\Binder_Crefs.cs (4)
904Debug.Assert(typeArgumentSyntax.ContainsDiagnostics || !typeArgumentSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics() || 961Debug.Assert(!this.Compilation.ContainsSyntaxTree(typeSyntax.SyntaxTree) || 962this.Compilation.GetBinderFactory(typeSyntax.SyntaxTree).GetBinder(typeSyntax).Flags == 989Debug.Assert(type.TypeKind != TypeKind.Error || typeSyntax.ContainsDiagnostics || !typeSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(), "Why wasn't there a diagnostic?");
Binder\Binder_Expressions.cs (3)
2024if (node.SyntaxTree == localSymbolLocation.SourceTree) 6230diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 1, 1))); 6234diagnostics.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)
262bool isSubmissionTree = Compilation.IsSubmissionSyntaxTree(declarationSyntax.SyntaxTree);
Binder\Binder_Operators.cs (2)
3184((CSharpParseOptions)node.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeaturePatternMatching)) 3231if (wasUnderscore && ((CSharpParseOptions)node.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeatureRecursivePatterns))
Binder\Binder_Patterns.cs (1)
897Debug.Assert(designation.SyntaxTree.Options.Kind != SourceCodeKind.Regular);
Binder\Binder_Query.cs (1)
731SourceLocation errorLocation = new SourceLocation(let.SyntaxTree, new TextSpan(let.Identifier.SpanStart, let.Expression.Span.End - let.Identifier.SpanStart));
Binder\Binder_Statements.cs (3)
3303return Location.Create(lambdaSyntax.SyntaxTree, 3307return Location.Create(anonymousMethodSyntax.SyntaxTree, 3769BinderFactory binderFactory = compilation.GetBinderFactory(containerNode.SyntaxTree);
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
947bool isSubmissionTree = compilation.IsSubmissionSyntaxTree(compilationUnit.SyntaxTree); 1229if (primaryConstructor.SyntaxRef.SyntaxTree == memberSyntax.SyntaxTree &&
Binder\ForEachLoopBinder.cs (2)
1248else if (result.CallsAreOmitted(_syntax.SyntaxTree)) 1310if (result.CallsAreOmitted(_syntax.SyntaxTree))
Binder\SwitchBinder.cs (1)
35((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)
322EmitSequencePoint(blockSyntax.SyntaxTree, blockSyntax.CloseBraceToken.Span);
Compilation\CSharpCompilation.cs (5)
1131RoslynDebug.Assert(directive.SyntaxTree.FilePath is object); 1134return ReferenceDirectiveMap.TryGetValue((directive.SyntaxTree.FilePath, directive.File.ValueText), out reference) ? reference : null; 2348return GetBinderFactory(syntax.SyntaxTree).GetBinder(syntax); 2513TryAdd(new ImportInfo(syntax.SyntaxTree, syntax.Kind(), syntax.Span), default); 2519_lazyImportInfos.TryUpdate(new ImportInfo(syntax.SyntaxTree, syntax.Kind(), syntax.Span), dependencies, default);
Compilation\CSharpSemanticModel.cs (2)
1386if (this.Compilation.ContainsSyntaxTree(syntax.SyntaxTree)) 5350var syntaxTree = (CSharpSyntaxTree)Root.SyntaxTree;
Compilation\MemberSemanticModel.cs (4)
1142return _root.SyntaxTree; 2385if (node.SyntaxTree == _semanticModel.SyntaxTree) 2406if (statement.WasCompilerGenerated && node.SyntaxTree == _semanticModel.SyntaxTree) 2431if (node.SyntaxTree == _semanticModel.SyntaxTree)
Compilation\SpeculativeSyntaxTreeSemanticModel.cs (1)
50: base(parentSemanticModel.Compilation, parentSemanticModel.SyntaxTree, root.SyntaxTree, parentSemanticModel.IgnoresAccessibility)
Compilation\SyntaxTreeSemanticModel.cs (1)
1255if (symbol?.SyntaxRef.SyntaxTree != node.SyntaxTree || symbol.GetSyntax() != node)
Compiler\DocumentationCommentCompiler.cs (2)
518bool reportDiagnosticsForCurrentTrivia = trivia.SyntaxTree.ReportDocumentationCommentDiagnostics(); 556Location location = new SourceLocation(trivia.SyntaxTree, new TextSpan(trivia.SpanStart, 0));
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (2)
149BinderFactory factory = _compilation.GetBinderFactory(cref.SyntaxTree); 180BinderFactory 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)
168syntaxReference: firstGlobalStatement.SyntaxTree.GetReference(firstGlobalStatement.Parent),
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
35if (syntaxNode.SyntaxTree.Options.DocumentationMode < DocumentationMode.Parse)
FlowAnalysis\NullableWalker.cs (1)
7828location = Location.Create(lambdaSyntax.SyntaxTree, new Text.TextSpan(start, lambdaSyntax.ArrowToken.Span.End - start));
Parser\Blender.cs (1)
154var column = oldTree.SyntaxTree.GetLineSpan(new TextSpan(start, 0)).Span.Start.Character;
Symbols\AliasSymbol.cs (1)
406.GetBinderFactory(syntax.SyntaxTree)
Symbols\LexicalSortKey.cs (1)
83: this(node.SyntaxTree, node.SpanStart, compilation)
Symbols\NamespaceOrTypeSymbol.cs (1)
217if (loc.IsInSource && loc.SourceTree == syntax.SyntaxTree && syntax.Span.Contains(loc.SourceSpan))
Symbols\Source\ModifierUtils.cs (1)
123if (MessageID.IDS_FeatureRefFields.GetFeatureAvailabilityDiagnosticInfo((CSharpParseOptions)syntax.SyntaxTree.Options) is { } diagnosticInfo)
Symbols\Source\SourceAssemblySymbol.cs (4)
1674QuickAttributeChecker checker = this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker; 1680QuickAttributeChecker checker = this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker; 1686QuickAttributeChecker checker = this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker; 1753this.DeclaringCompilation.GetBinderFactory(node.SyntaxTree).GetBinder(node).QuickAttributeChecker;
Symbols\Source\SourceConstructorSymbolBase.cs (3)
36var binderFactory = this.DeclaringCompilation.GetBinderFactory(syntax.SyntaxTree); 199if (tree == ctorSyntax.SyntaxTree) 218if (tree == ctorInitializer?.SyntaxTree)
Symbols\Source\SourceMemberContainerSymbol.cs (4)
2916Debug.Assert(declaredMembers.DeclarationWithParameters.SyntaxTree == InstanceInitializersForPositionalMembers[0].Syntax.SyntaxTree); 2942declaredMembers.DeclarationWithParameters.SyntaxTree == declaredMembers.InstanceInitializers[insertAt][0].Syntax.SyntaxTree && 2964Debug.Assert(!declaredMembers.InstanceInitializers.Any(g => declaredMembers.DeclarationWithParameters.SyntaxTree == g[0].Syntax.SyntaxTree && 3757Debug.Assert(node.SyntaxTree == initializers.Last().Syntax.SyntaxTree);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
639return fieldDeclaration.SyntaxTree.HasCompilationUnitRoot && fieldDeclaration.Span.IntersectsWith(definedWithinSpan.Value);
Symbols\Source\SourceMemberMethodSymbol.cs (2)
638Binder result = (binderFactoryOpt ?? this.DeclaringCompilation.GetBinderFactory(contextNode.SyntaxTree)).GetBinder(contextNode); 1018Debug.Assert(this.SyntaxNode.SyntaxTree == localTree);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
926if (!hasError && !CallsAreOmitted(arguments.AttributeSyntaxOpt.SyntaxTree))
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (6)
73if (declarationSyntaxRef.SyntaxTree != declarationSyntax.SyntaxTree) 731declarationBinder ??= compilation.GetBinderFactory(declarationSyntax.SyntaxTree).GetBinder(usingDirective.NamespaceOrType).WithAdditionalFlags(BinderFlags.SuppressConstraintChecks); 744diagnostics.Add(!globalUsingNamespacesOrTypes.IsEmpty && getOrCreateUniqueGlobalUsingsNotInTree(ref uniqueGlobalUsings, globalUsingNamespacesOrTypes, declarationSyntax.SyntaxTree).Contains(imported) ? 770diagnostics.Add(!globalUsingNamespacesOrTypes.IsEmpty && getOrCreateUniqueGlobalUsingsNotInTree(ref uniqueGlobalUsings, globalUsingNamespacesOrTypes, declarationSyntax.SyntaxTree).Contains(imported) ? 996if (!Compilation.ReportUnusedImportsInTree(alias.ExternAliasDirective!.SyntaxTree)) 1020if (Compilation.ReportUnusedImportsInTree(usingDirective.SyntaxTree))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (4)
125var withTypeParamsBinder = this.DeclaringCompilation.GetBinderFactory(syntax.SyntaxTree).GetBinder(syntax.ReturnType, syntax, this); 178Binder.CheckFeatureAvailability(syntax.SyntaxTree, MessageID.IDS_OverrideWithConstraints, diagnostics, 319.GetBinderFactory(syntax.SyntaxTree) 344.GetBinderFactory(syntax.SyntaxTree)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
408var binderFactory = compilation.GetBinderFactory(syntax.SyntaxTree);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
222GetBinderFactory(declarationSyntax.SyntaxTree).GetBinder(returnTypeSyntax, declarationSyntax, this);
Symbols\Symbol_Attributes.cs (1)
675var parseOptions = (CSharpParseOptions)targetOpt.SyntaxTree.Options;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
70InMethodBinder result = (binderFactoryOpt ?? this.DeclaringCompilation.GetBinderFactory(typeDecl.SyntaxTree)).GetPrimaryConstructorInMethodBinder(this);
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
82if (entryPoint.SyntaxTree == compilationUnit.SyntaxTree && entryPoint.SyntaxNode == compilationUnit) 223Binder result = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxNode.SyntaxTree));
Syntax\CSharpSyntaxNode.cs (16)
42/// Returns a non-null <see cref="SyntaxTree"/> that owns this node. 43/// If this node was created with an explicit non-null <see cref="SyntaxTree"/>, returns that tree. 44/// Otherwise, if this node has a non-null parent, then returns the parent's <see cref="SyntaxTree"/>. 45/// Otherwise, returns a newly created <see cref="SyntaxTree"/> rooted at this node, preserving this node's reference identity. 225return this.SyntaxTree.GetReference(this); 235return this.SyntaxTree.GetDiagnostics(this); 478return this.SyntaxTree; 490return SyntaxReplacer.Replace(this, nodes, computeReplacementNode, tokens, computeReplacementToken, trivia, computeReplacementTrivia).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 495return SyntaxReplacer.ReplaceNodeInList(this, originalNode, replacementNodes).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 500return SyntaxReplacer.InsertNodeInList(this, nodeInList, nodesToInsert, insertBefore).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 505return SyntaxReplacer.ReplaceTokenInList(this, originalToken, newTokens).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 510return SyntaxReplacer.InsertTokenInList(this, originalToken, newTokens, insertBefore).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 515return SyntaxReplacer.ReplaceTriviaInList(this, originalTrivia, newTrivia).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 520return SyntaxReplacer.InsertTriviaInList(this, originalTrivia, newTrivia, insertBefore).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 525return SyntaxNodeRemover.RemoveNodes(this, nodes.Cast<CSharpSyntaxNode>(), options).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree); 530return SyntaxNormalizer.Normalize(this, indentation, eol, elasticTrivia).AsRootOfNewTreeWithOptionsFrom(this.SyntaxTree);
Syntax\CSharpSyntaxTree.cs (1)
392/// <para>NOTE: This method is only intended to be used from <see cref="CSharpSyntaxNode.SyntaxTree"/> property.</para>
Syntax\SyntaxFacts.cs (1)
525return 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.Emit.UnitTests (2)
PDB\PDBTests.cs (2)
128").SyntaxTree; 131").SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (13)
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;
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 (57)
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; 21288tree = statement.SyntaxTree; 32452var tree = node1.SyntaxTree; 34280syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 34494syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree;
Semantics\PrimaryConstructorTests.cs (11)
2078var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx"); 2079var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray(); 3217Assert.Same(literal.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3243Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3261Assert.Same(initializer.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3295Assert.Same(baseType.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3322Assert.Same(@class.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 4710Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 4728Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 4746Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 4775Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\ReadOnlyStructsTests.cs (1)
1267var semanticModel = comp.GetSemanticModel(testMethodSyntax.SyntaxTree);
Semantics\RecordStructTests.cs (4)
5960Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5978Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5996Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6025Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\RecordTests.cs (7)
22309var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx"); 22310var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray(); 26255Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26281Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26299Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26333Assert.Same(baseType.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26356Assert.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)
89var tree = node.SyntaxTree; 90Assert.Equal(tree, node.SyntaxTree); 98var childTree = node.Operand.SyntaxTree; 99var parentTree = node.SyntaxTree; 108Assert.Equal(tree, tree.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single().SyntaxTree);
Semantics\TopLevelStatementsTests.cs (1)
6443Assert.Same(globalStatement.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
SourceGeneration\GeneratorDriverTests.cs (1)
2294Assert.True(compilation.SyntaxTrees.Contains(node.SyntaxTree));
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (6)
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()));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Compilation\CompilationAPITests.cs (1)
788SyntaxTree withExpressionRootTree = SyntaxFactory.ParseExpression(s3).SyntaxTree;
DocumentationComments\CrefTests.cs (13)
2014var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2053var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2107var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 5853var model = compilation.GetSemanticModel(cref.SyntaxTree); 5902var model = compilation.GetSemanticModel(cref.SyntaxTree); 5926var model = compilation.GetSemanticModel(cref.SyntaxTree); 5950var model = compilation.GetSemanticModel(cref.SyntaxTree); 5975var model = compilation.GetSemanticModel(cref.SyntaxTree); 5999var model = compilation.GetSemanticModel(cref.SyntaxTree); 6027var model = compilation.GetSemanticModel(cref.SyntaxTree); 6049var model = compilation.GetSemanticModel(typeParameterSyntax.SyntaxTree); 6073var model = compilation.GetSemanticModel(methodNameSyntax.SyntaxTree); 6635var binderFactory = compilation.GetBinderFactory(crefSyntax.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (50)
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 (1)
41var text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText();
Syntax\SyntaxNodeTests.cs (12)
3584var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChanges(SecondUsingClause.SyntaxTree); 3595var ChangesFromTransform = ThirdUsingClause.SyntaxTree.GetChanges(newUsingClause.SyntaxTree); 3599SyntaxTree x = ThirdUsingClause.SyntaxTree; 3600SyntaxTree y = newUsingClause.SyntaxTree; 3634var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChanges(SecondUsingClause.SyntaxTree); 3639Assert.Throws<ArgumentNullException>(() => FirstUsingClause.SyntaxTree.GetChanges(BlankTree)); 3667var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChangedSpans(SecondUsingClause.SyntaxTree); 3672Assert.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.EditorFeatures.UnitTests (1)
EditAndContinue\RudeEditDiagnosticTests.cs (1)
22var tree = SyntaxFactory.ParseCompilationUnit("class C { }").SyntaxTree;