366 references to RawKind
Microsoft.AspNetCore.App.Analyzers (12)
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (8)
70if (token.RawKind == (int)SyntaxKind.StringLiteralToken || 71token.RawKind == (int)SyntaxKind.Utf8StringLiteralToken || 72token.RawKind == (int)SyntaxKind.CharacterLiteralToken) 83if (token.RawKind == (int)SyntaxKind.StringLiteralToken || 84token.RawKind == (int)SyntaxKind.CharacterLiteralToken) 111if (token.RawKind == (int)SyntaxKind.StringLiteralToken || 112token.RawKind == (int)SyntaxKind.CharacterLiteralToken) 116else if (token.RawKind == (int)SyntaxKind.Utf8StringLiteralToken)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
34if (token.Parent?.Parent is InterpolatedStringExpressionSyntax { StringStartToken.RawKind: (int)SyntaxKind.InterpolatedMultiLineRawStringStartToken })
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
23if (!IsAnyStringLiteral(token.RawKind))
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (2)
92token = skippedToken.RawKind != 0 101token = skippedToken.RawKind != 0 ? skippedToken : token;
Microsoft.CodeAnalysis (26)
Syntax\SeparatedSyntaxList.cs (1)
578if (newSeparator.RawKind != nodesWithSeps[index].RawKind ||
Syntax\SyntaxNavigator.cs (23)
112if (token.RawKind != None) 159if (token.RawKind != None) 196if (token.RawKind != None) 240return token.RawKind != None; 253if (firstToken.RawKind != None) 268if (firstToken.RawKind != None) 287if (lastToken.RawKind != None) 302if (lastToken.RawKind != None) 320if (token.RawKind != None) 333if (token.RawKind != None) 352if (token.RawKind != None) 365if (token.RawKind != None) 389if (token.RawKind != None) 447if (token.RawKind != None) 456if (token.RawKind != None) 497if (token.RawKind != None) 506if (token.RawKind != None) 539if (firstToken.RawKind != None) 555if (token.RawKind != None) 564if (token.RawKind != None) 593if (lastToken.RawKind != None) 609if (token.RawKind != None) 618if (token.RawKind != None)
Syntax\SyntaxToken.cs (1)
62/// cref="RawKind"/> when a contextual keyword is used in a place in the syntax that gives it
Syntax\SyntaxTokenList.cs (1)
301if (this[i].RawKind == rawKind)
Microsoft.CodeAnalysis.CodeStyle (85)
src\Analyzers\Core\Analyzers\OrderModifiers\OrderModifiersHelpers.cs (1)
30var currentOrder = preferredOrder.TryGetValue(modifier.RawKind, out var value) ? value : int.MaxValue;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
74if (token.RawKind == syntaxKinds.StringLiteralToken || 75token.RawKind == syntaxKinds.Utf8StringLiteralToken || 76token.RawKind == syntaxKinds.CharacterLiteralToken) 87if (token.RawKind == syntaxKinds.StringLiteralToken || 88token.RawKind == syntaxKinds.CharacterLiteralToken) 115if (token.RawKind == syntaxKinds.StringLiteralToken || 116token.RawKind == syntaxKinds.CharacterLiteralToken) 120else if (token.RawKind == syntaxKinds.Utf8StringLiteralToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
84=> token1.RawKind != 0 && 85token2.RawKind != 0 &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (5)
627token = skippedToken.RawKind != 0 ? skippedToken : token; 634token = skippedToken.RawKind != 0 638while (token.RawKind != 0 && token.Span.End <= position && token.Span.End <= root.FullSpan.End); 668token = skippedToken.RawKind != 0 677token = skippedToken.RawKind != 0 ? skippedToken : token;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (4)
41Contract.ThrowIfTrue(token1.RawKind == 0 || token2.RawKind == 0); 76previousToken.RawKind != 0 && 94return nextToken.RawKind == 0
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
135if (result.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (3)
75if (nextToken.RawKind != 0 && 80if (alignmentBaseToken.RawKind != 0) 373lastVisibleToken = (lastVisibleToken.RawKind == 0) ? root.GetLastToken() : lastVisibleToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (1)
460if (token.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (4)
360if (token.RawKind == 0 || token.Width() <= 0) 478Contract.ThrowIfFalse(baseToken.RawKind != 0 && startToken.RawKind != 0 && endToken.RawKind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (2)
78var span = TextSpan.FromBounds(token1.RawKind == 0 ? this.TreeInfo.StartPosition : token1.Span.End, token2.RawKind == 0 ? this.TreeInfo.EndPosition : token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (3)
290for (; previousToken.Token.RawKind != 0; previousToken = previousToken.GetPreviousTokenData()) 478Contract.ThrowIfTrue(token.RawKind == 0); 489if (tokenData1.Token.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (3)
18Contract.ThrowIfFalse(root.GetFirstToken(includeZeroWidth: true).RawKind != 0); 23Contract.ThrowIfTrue(token.RawKind == 0); 38while (currentToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
26Contract.ThrowIfTrue(token.RawKind == 0); 35if (token1.RawKind == 0) 41if (token2.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
136var initialColumn = baseToken.RawKind == 0 ? 0 /* the very beginning of the file */ : treeInfo.GetOriginalColumn(tabSize, baseToken); 295if (previousToken.RawKind != 0) 300if (nextToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (4)
141if (token1.RawKind == 0 || token2.RawKind == 0) 184if (token1.RawKind == 0) 200if (token2.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (2)
18Contract.ThrowIfTrue(anchorToken.RawKind == 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (4)
20Contract.ThrowIfTrue(startToken.RawKind == 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0); 42Contract.ThrowIfTrue(startToken.RawKind == 0); 43Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (2)
23Contract.ThrowIfTrue(startToken.RawKind == 0); 24Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
201if (this.Token1.RawKind == 0) 214if (this.Token2.RawKind == 0) 403if (token1.RawKind == 0 || token2.RawKind == 0) 898var initialColumn = this.Token1.RawKind == 0 ? 0 : this.TokenStream.GetCurrentColumn(this.Token1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
81if (tokenToRightOrIn.FullSpan.Start != position && tokenToRightOrIn.RawKind != SyntaxFacts.SyntaxKinds.EndOfFileToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (9)
104if (syntaxFacts.SyntaxKinds.StringLiteralToken == token.RawKind || 105syntaxFacts.SyntaxKinds.InterpolatedStringTextToken == token.RawKind) 703=> token.RawKind == syntaxFacts.SyntaxKinds.AwaitKeyword; 706=> token.RawKind == syntaxFacts.SyntaxKinds.GlobalKeyword; 713=> token.RawKind == syntaxFacts.SyntaxKinds.CharacterLiteralToken; 716=> token.RawKind == syntaxFacts.SyntaxKinds.StringLiteralToken; 723=> token.RawKind == syntaxFacts.SyntaxKinds.IdentifierToken; 726=> token.RawKind == syntaxFacts.SyntaxKinds.HashToken; 729=> token.RawKind == syntaxFacts.SyntaxKinds.InterpolatedStringTextToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (15)
120startToken = (startToken.RawKind != 0) ? startToken : root.GetFirstToken(includeZeroWidth: true); 121endToken = (endToken.RawKind != 0) ? endToken : root.GetLastToken(includeZeroWidth: true); 131if (startToken.RawKind == 0 || endToken.RawKind == 0) 149Contract.ThrowIfTrue(token.RawKind == 0); 158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 170Contract.ThrowIfTrue(token1.RawKind == 0 && token2.RawKind == 0); 173if (token1.RawKind == 0) 179if (token2.RawKind == 0) 273if (nextToken.RawKind != 0) 290Contract.ThrowIfTrue(nextToken.RawKind == 0); 298if (previousToken.RawKind != 0) 316Contract.ThrowIfTrue(previousToken.RawKind == 0); 366var endPosition = endToken.RawKind == 0 ? root.Span.End : endToken.Span.End;
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
86=> preferredOrder.TryGetValue(token.RawKind, out var value) ? value : int.MaxValue;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
37if (nextToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
164if (tokenOnLocation.RawKind == syntaxKinds.CommaToken && location >= tokenOnLocation.Span.End)
Microsoft.CodeAnalysis.CSharp (8)
CSharpExtensions.cs (3)
27return token.RawKind == (int)kind; 187/// Returns <see cref="SyntaxKind"/> for <see cref="SyntaxToken"/> from <see cref="SyntaxToken.RawKind"/> property. 191var rawKind = token.RawKind;
Syntax\CSharpSyntaxRewriter.cs (1)
202if (visitedSeparator.RawKind == 0)
Syntax\SyntaxEquivalence.cs (2)
53return before.RawKind == after.RawKind && (before.Node == null || AreTokensEquivalent(before.Node, after.Node, ignoreChildNode: null));
Syntax\SyntaxFacts.cs (1)
497return nameToken.RawKind != 0 ? nameToken.ValueText : null;
Syntax\SyntaxNormalizer.cs (1)
883if (next is { RawKind: (int)SyntaxKind.OpenParenToken, Parent.Parent: ParenthesizedLambdaExpressionSyntax lambda } &&
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
39typeofExpression is not { Type: PredefinedTypeSyntax { Keyword.RawKind: (int)SyntaxKind.VoidKeyword } };
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
150argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword, Expression: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
39if (token.Parent?.Parent is InterpolatedStringExpressionSyntax { StringStartToken.RawKind: (int)SyntaxKind.InterpolatedMultiLineRawStringStartToken })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
214ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (1)
132var initialColumn = (token1.RawKind == 0) ? 0 : this.TreeInfo.GetOriginalColumn(Options.TabSize, token1) + token1.Span.Length;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (5)
57if (pair.Key.Item1.RawKind != 0) 62if (pair.Key.Item2.RawKind != 0) 74if (pair.Key.Item1.RawKind == 0) 101if (pair.Item1.RawKind == 0) 106if (pair.Item2.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
366switch ((SyntaxKind)token.RawKind) 510switch ((SyntaxKind)token.RawKind)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
201=> member is OperatorDeclarationSyntax { OperatorToken.RawKind: (int)SyntaxKind.EqualsEqualsToken }); 203=> member is OperatorDeclarationSyntax { OperatorToken.RawKind: (int)SyntaxKind.ExclamationEqualsToken });
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
58=> typeSyntax is PredefinedTypeSyntax { Keyword.RawKind: (int)SyntaxKind.VoidKeyword };
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (1)
62=> preferredOrder.TryGetValue(token.RawKind, out var value) ? value : int.MaxValue;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
41if (token is { RawKind: (int)SyntaxKind.StaticKeyword, Parent: UsingDirectiveSyntax }) 48token.GetPreviousToken() is { RawKind: (int)SyntaxKind.StaticKeyword, Parent: UsingDirectiveSyntax })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
126if (attributeList.Target is { Identifier.RawKind: var kind }) 2875if (token.Parent.Parent is ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.OutKeyword })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
62if (nextToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
124|| token is { RawKind: (int)SyntaxKind.CloseBraceToken, Parent: InterpolationSyntax })
Microsoft.CodeAnalysis.CSharp.EditorFeatures (6)
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (1)
140StringStartToken.RawKind: (int)SyntaxKind.InterpolatedSingleLineRawStringStartToken,
StringCopyPaste\StringCopyPasteHelpers.cs (5)
152stringExpression is InterpolatedStringExpressionSyntax { StringStartToken.RawKind: (int)SyntaxKind.InterpolatedVerbatimStringStartToken }; 160=> expression is LiteralExpressionSyntax { Token.RawKind: (int)SyntaxKind.MultiLineRawStringLiteralToken } or 161InterpolatedStringExpressionSyntax { StringStartToken.RawKind: (int)SyntaxKind.InterpolatedMultiLineRawStringStartToken }; 266Token.RawKind: (int)SyntaxKind.StringLiteralToken or 276StringStartToken.RawKind: (int)SyntaxKind.InterpolatedStringStartToken or
Microsoft.CodeAnalysis.CSharp.Features (22)
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
253=> token.RawKind == (int)SyntaxKind.XmlTextLiteralNewLineToken;
ExtractMethod\CSharpMethodExtractor.FormattingProvider.cs (1)
39if (previousToken.RawKind == (int)SyntaxKind.OpenBraceToken)
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
67if (token.RawKind != 0)
ExtractMethod\Extensions.cs (1)
262if (token1.RawKind != (int)SyntaxKind.SemicolonToken || !(token1.Parent is FieldDeclarationSyntax))
FullyQualify\CSharpFullyQualifyService.cs (1)
59simpleName.Parent is UsingDirectiveSyntax { Alias: null, StaticKeyword.RawKind: 0 } usingDirective)
Snippets\CSharpConsoleSnippetProvider.cs (1)
35if (syntaxContext.TargetToken is { RawKind: (int)SyntaxKind.EqualsGreaterThanToken, Parent: LambdaExpressionSyntax lambda })
Snippets\CSharpForEachLoopSnippetProvider.cs (4)
46if (token is { RawKind: (int)SyntaxKind.AwaitKeyword, Parent: ExpressionSyntax { Parent: ExpressionStatementSyntax } } || 47token is { RawKind: (int)SyntaxKind.IdentifierToken, ValueText: "await", Parent: IdentifierNameSyntax { Parent: ExpressionStatementSyntax } }) 68var isAsync = syntaxContext.TargetToken is { RawKind: (int)SyntaxKind.AwaitKeyword } or { RawKind: (int)SyntaxKind.IdentifierToken, ValueText: "await" };
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
39typeofExpression is not { Type: PredefinedTypeSyntax { Keyword.RawKind: (int)SyntaxKind.VoidKeyword } };
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
150argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword, Expression: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } }
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
201=> member is OperatorDeclarationSyntax { OperatorToken.RawKind: (int)SyntaxKind.EqualsEqualsToken }); 203=> member is OperatorDeclarationSyntax { OperatorToken.RawKind: (int)SyntaxKind.ExclamationEqualsToken });
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
58=> typeSyntax is PredefinedTypeSyntax { Keyword.RawKind: (int)SyntaxKind.VoidKeyword };
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (1)
62=> preferredOrder.TryGetValue(token.RawKind, out var value) ? value : int.MaxValue;
src\Compilers\CSharp\Portable\Syntax\SyntaxBindingUtilities.cs (5)
16node is CommonForEachStatementSyntax { AwaitKeyword.RawKind: not 0 } 17or VariableDeclaratorSyntax { Parent.Parent: UsingStatementSyntax { AwaitKeyword.RawKind: not 0 } or LocalDeclarationStatementSyntax { AwaitKeyword.RawKind: not 0 } } 18or UsingStatementSyntax { Expression: not null, AwaitKeyword.RawKind: not 0 }; 21=> node is VariableDeclaratorSyntax { Parent.Parent: UsingStatementSyntax { } or LocalDeclarationStatementSyntax { UsingKeyword.RawKind: not 0 } }
StringIndentation\CSharpStringIndentationService.cs (1)
42StringStartToken.RawKind: (int)SyntaxKind.InterpolatedMultiLineRawStringStartToken
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (5)
Syntax\SyntaxNodeTests.cs (5)
1086while (token.RawKind != 0) 1192while (token.RawKind != 0) 1236while (token.RawKind != 0) 1281while (token.RawKind != 0) 2067Assert.True(expectedTokenKinds.SequenceEqual(actualTokens.Select(t => (SyntaxKind)t.RawKind)));
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
39if (token.Parent?.Parent is InterpolatedStringExpressionSyntax { StringStartToken.RawKind: (int)SyntaxKind.InterpolatedMultiLineRawStringStartToken })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
214ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (1)
132var initialColumn = (token1.RawKind == 0) ? 0 : this.TreeInfo.GetOriginalColumn(Options.TabSize, token1) + token1.Span.Length;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (5)
57if (pair.Key.Item1.RawKind != 0) 62if (pair.Key.Item2.RawKind != 0) 74if (pair.Key.Item1.RawKind == 0) 101if (pair.Item1.RawKind == 0) 106if (pair.Item2.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
366switch ((SyntaxKind)token.RawKind) 510switch ((SyntaxKind)token.RawKind)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
41if (token is { RawKind: (int)SyntaxKind.StaticKeyword, Parent: UsingDirectiveSyntax }) 48token.GetPreviousToken() is { RawKind: (int)SyntaxKind.StaticKeyword, Parent: UsingDirectiveSyntax })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
126if (attributeList.Target is { Identifier.RawKind: var kind }) 2875if (token.Parent.Parent is ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.OutKeyword })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
62if (nextToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
124|| token is { RawKind: (int)SyntaxKind.CloseBraceToken, Parent: InterpolationSyntax })
Microsoft.CodeAnalysis.Features (37)
BraceMatching\AbstractBraceMatcher.cs (4)
34where tok.RawKind == _openBrace.Kind || tok.RawKind == _closeBrace.Kind 70if (token.RawKind == _openBrace.Kind && AllowedForToken(token)) 78else if (token.RawKind == _closeBrace.Kind && AllowedForToken(token))
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
355if (foreachIdentifier.RawKind == 0)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
174=> oldToken.RawKind == newToken.RawKind && oldToken.Span.Length == newToken.Span.Length && AreEquivalentImpl(oldToken, newToken);
EmbeddedLanguages\AbstractLanguageDetector.cs (2)
84if (Info.IsAnyStringLiteral(token.RawKind)) 87if (token.RawKind == Info.SyntaxKinds.InterpolatedStringTextToken)
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
122if (token.Span.IntersectsWith(_textSpan) && _owner.SyntaxTokenKinds.Contains(token.RawKind))
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (1)
34if (!_supportedKinds.Contains(token.RawKind))
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeEmbeddedLanguage.cs (3)
45if (token.RawKind == syntaxKinds.CloseBraceToken) 52if (previous.RawKind == syntaxKinds.InterpolatedStringTextToken) 55if (previous.RawKind == syntaxKinds.ColonToken)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (2)
69if (Info.IsAnyStringLiteral(token.RawKind)) 72if (token.RawKind == Info.SyntaxKinds.InterpolatedStringTextToken)
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionAnalyzer.cs (1)
82if (_info.IsAnyStringLiteral(token.RawKind) &&
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDiagnosticAnalyzer.cs (1)
71if (_info.IsAnyStringLiteral(token.RawKind))
EmbeddedLanguages\Json\LanguageServices\JsonClassifier.cs (1)
43if (!info.IsAnyStringLiteral(token.RawKind))
EmbeddedLanguages\RegularExpressions\LanguageServices\AbstractRegexDiagnosticAnalyzer.cs (1)
83if (_info.IsAnyStringLiteral(token.RawKind))
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexClassifier.cs (1)
45if (!info.IsAnyStringLiteral(token.RawKind))
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (3)
113tokens[TriviaLocation.AfterBeginningOfSpan].RawKind == 0 /* don't care */ || 114tokens[TriviaLocation.BeforeEndOfSpan].RawKind == 0 /* don't care */ || 147if (tokenPair.PreviousToken.RawKind == 0)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractMetadataFormattingRule.cs (2)
24if (previousToken.RawKind == 0 || currentToken.RawKind == 0)
QuickInfo\AbstractEmbeddedLanguageQuickInfoProvider.cs (1)
31if (!_embeddedLanguageProviderFeature.SyntaxTokenKinds.Contains(token.RawKind))
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
116if (nameToken.RawKind != identifierTokenKind)
SignatureHelp\CommonSignatureHelpUtilities.cs (2)
87if (closeToken.RawKind != 0 && !closeToken.IsMissing) 95if (nextToken.RawKind == 0)
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
56if (token.RawKind != 0 && token.Span == span)
SpellCheck\AbstractSpellCheckSpanService.cs (4)
96token.RawKind == _syntaxKinds.SingleLineRawStringLiteralToken || 97token.RawKind == _syntaxKinds.MultiLineRawStringLiteralToken) 101else if (token.RawKind == _syntaxKinds.InterpolatedStringTextToken && 106else if (token.RawKind == _syntaxKinds.IdentifierToken)
src\Analyzers\Core\Analyzers\OrderModifiers\OrderModifiersHelpers.cs (1)
30var currentOrder = preferredOrder.TryGetValue(modifier.RawKind, out var value) ? value : int.MaxValue;
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
86=> preferredOrder.TryGetValue(token.RawKind, out var value) ? value : int.MaxValue;
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\ControlFlowGraphVerifier.cs (1)
1285PostfixUnaryExpressionSyntax { OperatorToken: { RawKind: (int)CSharp.SyntaxKind.ExclamationToken } })
Syntax\TokenUtilities.cs (2)
64return token.RawKind == (int)VB.SyntaxKind.StatementTerminatorToken; 69return token.RawKind == (int)CS.SyntaxKind.OmittedArraySizeExpressionToken;
Microsoft.CodeAnalysis.VisualBasic (6)
Syntax\SyntaxEquivalence.vb (2)
37Return before.RawKind = after.RawKind AndAlso (before.Node Is Nothing OrElse AreTokensEquivalent(before.Node, after.Node))
Syntax\VisualBasicSyntaxRewriter.vb (1)
152If visitedSeparator.RawKind = 0 Then
VisualBasicExtensions.vb (3)
41Return token.RawKind = kind 196''' Returns <see cref="SyntaxKind"/> for <see cref="SyntaxToken"/> from <see cref="SyntaxToken.RawKind"/> property. 200Dim rawKind = token.RawKind
Microsoft.CodeAnalysis.VisualBasic.Features (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
1320If(thenKeywordOpt.RawKind <> 0, thenKeywordOpt.Span.End, condition.Span.End))
Microsoft.CodeAnalysis.Workspaces (111)
CodeCleanup\AbstractCodeCleanerService.cs (16)
161var hasNoPreviousToken = previousToken.RawKind == 0; 162var hasNoNextToken = nextToken.RawKind == 0; 240Contract.ThrowIfTrue(previousToken.RawKind == 0); 256Contract.ThrowIfTrue(nextToken.RawKind == 0); 286var startMarker = new SpanMarker(type: (previousToken.RawKind == 0) ? SpanMarkerType.BeginningOfFile : SpanMarkerType.Normal, 287oppositeMarkerType: (nextToken.RawKind == 0) ? SpanMarkerType.EndOfFile : SpanMarkerType.Normal); 289var endMarker = new SpanMarker(type: (nextToken.RawKind == 0) ? SpanMarkerType.EndOfFile : SpanMarkerType.Normal, 290oppositeMarkerType: (previousToken.RawKind == 0) ? SpanMarkerType.BeginningOfFile : SpanMarkerType.Normal); 293previousToken = (previousToken.RawKind == 0) ? root.GetFirstToken(includeZeroWidth: true) : previousToken; 294nextToken = (nextToken.RawKind == 0) ? root.GetLastToken(includeZeroWidth: true) : nextToken; 337previousToken = (previousToken.RawKind == 0) ? root.GetFirstToken(includeZeroWidth: true) : previousToken; 342nextToken = (nextToken.RawKind == 0) ? root.GetLastToken(includeZeroWidth: true) : nextToken; 371Contract.ThrowIfTrue(startToken.RawKind == 0 || endToken.RawKind == 0); 407if (token.RawKind == 0) 422if (token.RawKind == 0)
Editing\SyntaxGenerator.cs (4)
1445token => Any(original, token.RawKind) 1446? original.First(tk => tk.RawKind == token.RawKind) 1454if (token.RawKind == rawKind)
ExtensionManager\IExtensionManagerExtensions.cs (1)
134return t => map.TryGetValue(t.RawKind, out var extensions) ? extensions : [];
FindSymbols\FindReferences\FindReferenceCache.cs (1)
250static (_, token, syntaxKinds) => token.RawKind == syntaxKinds.NewKeyword,
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (2)
19/// The <see cref="SyntaxToken.RawKind"/> of the <see langword="Dim"/> keyword in Visual Basic, or 165else if (token.RawKind == _dimKeywordKind)
Shared\Extensions\SemanticModelExtensions.cs (1)
94if (token.RawKind == syntaxKinds.UsingKeyword &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (8)
74if (token.RawKind == syntaxKinds.StringLiteralToken || 75token.RawKind == syntaxKinds.Utf8StringLiteralToken || 76token.RawKind == syntaxKinds.CharacterLiteralToken) 87if (token.RawKind == syntaxKinds.StringLiteralToken || 88token.RawKind == syntaxKinds.CharacterLiteralToken) 115if (token.RawKind == syntaxKinds.StringLiteralToken || 116token.RawKind == syntaxKinds.CharacterLiteralToken) 120else if (token.RawKind == syntaxKinds.Utf8StringLiteralToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
84=> token1.RawKind != 0 && 85token2.RawKind != 0 &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (5)
627token = skippedToken.RawKind != 0 ? skippedToken : token; 634token = skippedToken.RawKind != 0 638while (token.RawKind != 0 && token.Span.End <= position && token.Span.End <= root.FullSpan.End); 668token = skippedToken.RawKind != 0 677token = skippedToken.RawKind != 0 ? skippedToken : token;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (4)
41Contract.ThrowIfTrue(token1.RawKind == 0 || token2.RawKind == 0); 76previousToken.RawKind != 0 && 94return nextToken.RawKind == 0
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
135if (result.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (3)
75if (nextToken.RawKind != 0 && 80if (alignmentBaseToken.RawKind != 0) 373lastVisibleToken = (lastVisibleToken.RawKind == 0) ? root.GetLastToken() : lastVisibleToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (1)
460if (token.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (4)
360if (token.RawKind == 0 || token.Width() <= 0) 478Contract.ThrowIfFalse(baseToken.RawKind != 0 && startToken.RawKind != 0 && endToken.RawKind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (2)
78var span = TextSpan.FromBounds(token1.RawKind == 0 ? this.TreeInfo.StartPosition : token1.Span.End, token2.RawKind == 0 ? this.TreeInfo.EndPosition : token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (3)
290for (; previousToken.Token.RawKind != 0; previousToken = previousToken.GetPreviousTokenData()) 478Contract.ThrowIfTrue(token.RawKind == 0); 489if (tokenData1.Token.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (3)
18Contract.ThrowIfFalse(root.GetFirstToken(includeZeroWidth: true).RawKind != 0); 23Contract.ThrowIfTrue(token.RawKind == 0); 38while (currentToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
26Contract.ThrowIfTrue(token.RawKind == 0); 35if (token1.RawKind == 0) 41if (token2.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
136var initialColumn = baseToken.RawKind == 0 ? 0 /* the very beginning of the file */ : treeInfo.GetOriginalColumn(tabSize, baseToken); 295if (previousToken.RawKind != 0) 300if (nextToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (4)
141if (token1.RawKind == 0 || token2.RawKind == 0) 184if (token1.RawKind == 0) 200if (token2.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (2)
18Contract.ThrowIfTrue(anchorToken.RawKind == 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (4)
20Contract.ThrowIfTrue(startToken.RawKind == 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0); 42Contract.ThrowIfTrue(startToken.RawKind == 0); 43Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (2)
23Contract.ThrowIfTrue(startToken.RawKind == 0); 24Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
201if (this.Token1.RawKind == 0) 214if (this.Token2.RawKind == 0) 403if (token1.RawKind == 0 || token2.RawKind == 0) 898var initialColumn = this.Token1.RawKind == 0 ? 0 : this.TokenStream.GetCurrentColumn(this.Token1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
81if (tokenToRightOrIn.FullSpan.Start != position && tokenToRightOrIn.RawKind != SyntaxFacts.SyntaxKinds.EndOfFileToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (9)
104if (syntaxFacts.SyntaxKinds.StringLiteralToken == token.RawKind || 105syntaxFacts.SyntaxKinds.InterpolatedStringTextToken == token.RawKind) 703=> token.RawKind == syntaxFacts.SyntaxKinds.AwaitKeyword; 706=> token.RawKind == syntaxFacts.SyntaxKinds.GlobalKeyword; 713=> token.RawKind == syntaxFacts.SyntaxKinds.CharacterLiteralToken; 716=> token.RawKind == syntaxFacts.SyntaxKinds.StringLiteralToken; 723=> token.RawKind == syntaxFacts.SyntaxKinds.IdentifierToken; 726=> token.RawKind == syntaxFacts.SyntaxKinds.HashToken; 729=> token.RawKind == syntaxFacts.SyntaxKinds.InterpolatedStringTextToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (15)
120startToken = (startToken.RawKind != 0) ? startToken : root.GetFirstToken(includeZeroWidth: true); 121endToken = (endToken.RawKind != 0) ? endToken : root.GetLastToken(includeZeroWidth: true); 131if (startToken.RawKind == 0 || endToken.RawKind == 0) 149Contract.ThrowIfTrue(token.RawKind == 0); 158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 170Contract.ThrowIfTrue(token1.RawKind == 0 && token2.RawKind == 0); 173if (token1.RawKind == 0) 179if (token2.RawKind == 0) 273if (nextToken.RawKind != 0) 290Contract.ThrowIfTrue(nextToken.RawKind == 0); 298if (previousToken.RawKind != 0) 316Contract.ThrowIfTrue(previousToken.RawKind == 0); 366var endPosition = endToken.RawKind == 0 ? root.Span.End : endToken.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
37if (nextToken.RawKind != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
164if (tokenOnLocation.RawKind == syntaxKinds.CommaToken && location >= tokenOnLocation.Span.End)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (2)
793return oldPredefinedType.Keyword.RawKind == newPredefinedType.Keyword.RawKind;
LanguageService\CSharpHelpContextService.cs (1)
232text = Keyword(syntaxFacts.GetText(token.RawKind));