2 writes to Node
Microsoft.CodeAnalysis (2)
Syntax\SyntaxToken.cs (2)
34Node = token; 43Node = token;
145 references to Node
Microsoft.CodeAnalysis (93)
Syntax\SeparatedSyntaxListBuilder.cs (2)
78Debug.Assert(separatorToken.Node is object); 81_builder.AddInternal(separatorToken.Node);
Syntax\SyntaxNodeOrToken.cs (1)
776return new SyntaxNodeOrToken(token.Parent, token.Node, token.Position, token.Index);
Syntax\SyntaxNodeOrTokenListBuilder.cs (2)
77RoslynDebug.Assert(item.Node is object); 78this.Add(item.Node);
Syntax\SyntaxToken.cs (70)
48return GetType().Name + " " + (Node != null ? Node.KindText : "None") + " " + ToString(); 54public int RawKind => Node?.RawKind ?? 0; 59public string Language => Node?.Language ?? string.Empty; 71internal int RawContextualKind => Node?.RawContextualKind ?? 0; 84Debug.Assert(Node is object); 85return Node; 96internal int Width => Node?.Width ?? 0; 101internal int FullWidth => Node?.FullWidth ?? 0; 110return Node != null ? new TextSpan(Position + Node.GetLeadingTriviaWidth(), Node.Width) : default(TextSpan); 116get { return Node != null ? Position + Node.FullWidth : 0; } 127get { return Node != null ? Position + Node.GetLeadingTriviaWidth() : 0; } 140public bool IsMissing => Node?.IsMissing ?? false; 146public object? Value => Node?.GetValue(); 152public string ValueText => Node?.GetValueText() ?? string.Empty; 163return Node != null ? Node.ToString() : string.Empty; 173return Node != null ? Node.ToFullString() : string.Empty; 181Node?.WriteTo(writer); 189Node?.WriteTo(writer, leading, trailing); 205internal int LeadingWidth => Node?.GetLeadingTriviaWidth() ?? 0; 210internal int TrailingWidth => Node?.GetTrailingTriviaWidth() ?? 0; 215public bool ContainsDiagnostics => Node?.ContainsDiagnostics ?? false; 220public bool ContainsDirectives => Node?.ContainsDirectives ?? false; 233public bool HasStructuredTrivia => Node?.ContainsStructuredTrivia ?? false; 240public bool ContainsAnnotations => Node?.ContainsAnnotations ?? false; 247return Node?.HasAnnotations(annotationKind) ?? false; 255return Node?.HasAnnotations(annotationKinds) ?? false; 263return Node?.HasAnnotation(annotation) ?? false; 271return Node?.GetAnnotations(annotationKind) ?? SpecializedCollections.EmptyEnumerable<SyntaxAnnotation>(); 287return Node?.GetAnnotations(annotationKinds) ?? SpecializedCollections.EmptyEnumerable<SyntaxAnnotation>(); 310if (this.Node != null) 314token: Node.WithAdditionalAnnotationsGreen(annotations), 340if (this.Node != null) 344token: Node.WithoutAnnotationsGreen(annotations), 378if (token.Node == null) 383if (Node == null) 388var annotations = this.Node.GetAnnotations(); 393token: token.Node.WithAdditionalAnnotationsGreen(annotations), 410return Node != null 411? new SyntaxTriviaList(this, Node.GetLeadingTriviaCore(), this.Position) 424if (Node == null) 429var leading = Node.GetLeadingTriviaCore(); 436var trailingGreen = Node.GetTrailingTriviaCore(); 479return Node != null 480? new SyntaxToken(null, Node.WithLeadingTrivia(GreenNode.CreateList(trivia, static t => t.RequiredUnderlyingNode)), position: 0, index: 0) 505return Node != null 506? new SyntaxToken(null, Node.WithTrailingTrivia(GreenNode.CreateList(trivia, static t => t.RequiredUnderlyingNode)), position: 0, index: 0) 556Node == other.Node && 575return Hash.Combine(Parent, Hash.Combine(Node, Hash.Combine(Position, Index))); 584if (Node == null) 601if (Node == null) 615if (Node == null) 659if (Node == null) 668var diagnostics = Node.GetDiagnostics(); 684(Node == null && token.Node == null) || 685(Node != null && token.Node != null && Node.IsEquivalentTo(token.Node)); 703=> this.Node != null && this.Node == token.Node;
Syntax\SyntaxTokenList.cs (10)
43Node = token.Node; 79case 1: return tokens[0].Node; 80case 2: return Syntax.InternalSyntax.SyntaxList.List(tokens[0].Node!, tokens[1].Node!); 81case 3: return Syntax.InternalSyntax.SyntaxList.List(tokens[0].Node!, tokens[1].Node!, tokens[2].Node!); 86copy[i].Value = tokens[i].Node!; 103Debug.Assert(token.Node is object); 104builder.Add(token.Node);
Syntax\SyntaxTokenListBuilder.cs (3)
36Debug.Assert(item.Node is object); 37this.Add(item.Node); 68_nodes[_count + i] = list[offset + i].Node;
Syntax\SyntaxTriviaList.Enumerator.cs (5)
57Debug.Assert(token.Node is object); 58var node = token.Node.GetLeadingTriviaCore(); 68Debug.Assert(token.Node is object); 69var leading = token.Node.GetLeadingTriviaCore(); 76var trailingGreen = token.Node.GetTrailingTriviaCore();
Microsoft.CodeAnalysis.CSharp (13)
Compilation\CSharpSemanticModel.cs (1)
1322if (firstToken.Node is object)
CSharpExtensions.cs (1)
329return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.Node!).ApplyDirectives(stack);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
625Debug.Assert(keyword.Node != null || type != null); 630var startSpan = modifiers.Node != null ? modifiers.Span : (keyword.Node != null ? keyword.Span : type!.Span);
Parser\Blender.Reader.cs (2)
211token: (InternalSyntax.SyntaxToken)currentNodeOrToken.AsToken().Node); 242(nodeOrToken.IsToken && ((CSharpSyntaxNode)nodeOrToken.AsToken().Node).ContainsSkippedText && nodeOrToken.Parent.ContainsDiagnostics))
Syntax\CSharpSyntaxRewriter.cs (1)
61var node = token.Node;
Syntax\CSharpSyntaxTree.cs (2)
818if (token.Node == null) 822return GetDiagnostics(token.Node, token.Position);
Syntax\ShebangDirectiveTriviaSyntax.cs (1)
25.WithContent((InternalSyntax.SyntaxToken)content.Node!).CreateRed();
Syntax\SyntaxEquivalence.cs (3)
53return before.RawKind == after.RawKind && (before.Node == null || AreTokensEquivalent(before.Node, after.Node, ignoreChildNode: null));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (39)
Diagnostics\LocationsTests.cs (1)
586var nodeWithBadError = SyntaxFactory.IdentifierName(new SyntaxToken(node.Node.WithDiagnosticsGreen(new DiagnosticInfo[] { new SyntaxDiagnosticInfo(10, 10, ErrorCode.ERR_NoBaseClass) })));
Parsing\SyntaxExtensions.cs (3)
56return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.Node).ErrorsOrWarnings(errorsOnly: true); 61return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.Node).ErrorsOrWarnings(errorsOnly: false); 66return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.Node).ErrorsAndWarnings();
Syntax\SyntaxFactoryTests.cs (3)
197var actualGreen = actualRed.Node; 224Assert.IsType<InternalSyntax.SyntaxToken.SyntaxTokenWithTrivia>(token.Node); 228Assert.IsType<InternalSyntax.SyntaxToken.SyntaxTokenWithValueAndTrivia<string>>(token.Node);
Syntax\SyntaxTokenListTests.cs (12)
25EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0), new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0)); 28EqualityTesting.AssertNotEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 1), new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0)); 31EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 1, 0), new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0)); 41EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0).Reverse(), new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0).Reverse()); 44EqualityTesting.AssertNotEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 1).Reverse(), new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0).Reverse()); 47EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 1, 0).Reverse(), new SyntaxTokenList(node1, node1.ReturnKeyword.Node, 0, 0).Reverse());
Syntax\SyntaxTriviaListTests.cs (20)
25EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 0, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); 26EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node1.Node, 0, 1), new SyntaxTriviaList(node1, node1.Node, 0, 0)); 27EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node2.Node, 0, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); 28EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node2, node1.Node, 0, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); 31EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 1, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); 41EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); 42EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node1.Node, 0, 1).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); 43EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node2.Node, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); 44EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node2, node1.Node, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); 47EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 1, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse());