917 references to IsKind
Microsoft.CodeAnalysis.CSharp (106)
Binder\Binder_Constraints.cs (1)
151
if (questionToken.
IsKind
(SyntaxKind.QuestionToken))
Binder\Binder_Crefs.cs (2)
226
bool isChecked = syntax.CheckedKeyword.
IsKind
(SyntaxKind.CheckedKeyword);
267
bool isChecked = syntax.CheckedKeyword.
IsKind
(SyntaxKind.CheckedKeyword);
Binder\Binder_Expressions.cs (3)
2344
Debug.Assert(node.OperatorToken.
IsKind
(SyntaxKind.CaretToken));
2870
if (argumentSyntax.RefKindKeyword.
IsKind
(SyntaxKind.InKeyword))
2875
if (argumentSyntax.RefKindKeyword.
IsKind
(SyntaxKind.OutKeyword))
Binder\Binder_Lambda.cs (2)
106
if (modifier.
IsKind
(SyntaxKind.AsyncKeyword))
111
else if (modifier.
IsKind
(SyntaxKind.StaticKeyword))
Binder\Binder_Statements.cs (2)
597
if (modifier.
IsKind
(SyntaxKind.StaticKeyword))
599
else if (modifier.
IsKind
(SyntaxKind.ExternKeyword))
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (1)
103
if (endGreaterThanToken.GetNextToken() is SyntaxToken newLineToken && newLineToken.
IsKind
(SyntaxKind.XmlTextLiteralNewLineToken))
CSharpExtensions.cs (1)
244
return token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text.Length > 0 && token.Text[0] == '@';
Declarations\DeclarationTreeBuilder.cs (5)
358
if (directive.GlobalKeyword.
IsKind
(SyntaxKind.GlobalKeyword))
517
if (directive.GlobalKeyword.
IsKind
(SyntaxKind.GlobalKeyword))
661
if (modifier.
IsKind
(SyntaxKind.StaticKeyword) && kind == DeclarationKind.Class)
665
else if (modifier.
IsKind
(SyntaxKind.ReadOnlyKeyword) && kind is DeclarationKind.Struct or DeclarationKind.RecordStruct)
669
else if (modifier.
IsKind
(SyntaxKind.RefKeyword) && kind is DeclarationKind.Struct or DeclarationKind.RecordStruct)
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (2)
54
return SyntaxFacts.IsInNamespaceOrTypeContext(startNode as ExpressionSyntax) || token.
IsKind
(SyntaxKind.NewKeyword) || this.inNamespaceOrType;
275
if (token.
IsKind
(SyntaxKind.IdentifierToken))
Symbols\Source\LambdaSymbol.cs (1)
360
var isParams = paramSyntax?.Modifiers.Any(static m => m.
IsKind
(SyntaxKind.ParamsKeyword)) ?? false;
Symbols\Source\QuickAttributeChecker.cs (1)
98
(!onlyGlobalAliases || usingDirective.GlobalKeyword.
IsKind
(SyntaxKind.GlobalKeyword)))
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2690
foreach (var m in modifiers) { if (m.
IsKind
(modifier)) return true; };
Symbols\Source\SourceMemberFieldSymbol.cs (1)
198
if (modifier.
IsKind
(SyntaxKind.FixedKeyword))
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
642
if (applyIsGlobalFilter.HasValue && usingDirective.GlobalKeyword.
IsKind
(SyntaxKind.GlobalKeyword) != applyIsGlobalFilter.GetValueOrDefault())
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
60
syntax.Keyword.
IsKind
(SyntaxKind.InitKeyword),
Symbols\Source\SourcePropertySymbol.cs (1)
202
if (accessor.Keyword.
IsKind
(SyntaxKind.InitKeyword))
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
32
else if (syntax.CheckedKeyword.
IsKind
(SyntaxKind.CheckedKeyword))
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (1)
32
else if (!syntax.OperatorToken.IsMissing && syntax.CheckedKeyword.
IsKind
(SyntaxKind.CheckedKeyword))
Syntax\AnonymousFunctionExpressionSyntax.cs (1)
40
return new SyntaxTokenList(Modifiers.Where(m => !m.
IsKind
(SyntaxKind.AsyncKeyword)));
Syntax\SyntaxFactory.cs (3)
1205
if (rewrittenToken.
IsKind
(SyntaxKind.LessThanToken) && string.Equals("<", rewrittenToken.Text, StringComparison.Ordinal))
1208
if (rewrittenToken.
IsKind
(SyntaxKind.GreaterThanToken) && string.Equals(">", rewrittenToken.Text, StringComparison.Ordinal))
2369
!token.
IsKind
(SyntaxKind.SemicolonToken))
Syntax\SyntaxFacts.cs (3)
537
case LocalDeclarationStatementSyntax local when local.AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword):
538
case CommonForEachStatementSyntax @foreach when @foreach.AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword):
539
case UsingStatementSyntax @using when @using.AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword):
Syntax\SyntaxNormalizer.cs (71)
174
return !token.
IsKind
(SyntaxKind.EndOfFileToken);
184
if (currentToken.
IsKind
(SyntaxKind.EndOfDirectiveToken))
200
if (nextToken.
IsKind
(SyntaxKind.CloseBraceToken))
235
if (nextToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
279
if ((nextToken.
IsKind
(SyntaxKind.FromKeyword) && nextToken.Parent.IsKind(SyntaxKind.FromClause)) ||
280
(nextToken.
IsKind
(SyntaxKind.LetKeyword) && nextToken.Parent.IsKind(SyntaxKind.LetClause)) ||
281
(nextToken.
IsKind
(SyntaxKind.WhereKeyword) && nextToken.Parent.IsKind(SyntaxKind.WhereClause)) ||
282
(nextToken.
IsKind
(SyntaxKind.JoinKeyword) && nextToken.Parent.IsKind(SyntaxKind.JoinClause)) ||
283
(nextToken.
IsKind
(SyntaxKind.JoinKeyword) && nextToken.Parent.IsKind(SyntaxKind.JoinIntoClause)) ||
284
(nextToken.
IsKind
(SyntaxKind.OrderByKeyword) && nextToken.Parent.IsKind(SyntaxKind.OrderByClause)) ||
285
(nextToken.
IsKind
(SyntaxKind.SelectKeyword) && nextToken.Parent.IsKind(SyntaxKind.SelectClause)) ||
286
(nextToken.
IsKind
(SyntaxKind.GroupKeyword) && nextToken.Parent.IsKind(SyntaxKind.GroupClause)))
318
Debug.Assert(openBraceToken.
IsKind
(SyntaxKind.OpenBraceToken));
335
Debug.Assert(closeBraceToken.
IsKind
(SyntaxKind.CloseBraceToken));
411
=> currentToken.
IsKind
(SyntaxKind.CloseBraceToken) &&
483
var tokenIsOpenBrace = token.
IsKind
(SyntaxKind.OpenBraceToken);
484
var nextIsOpenBrace = next.
IsKind
(SyntaxKind.OpenBraceToken);
485
var tokenIsCloseBrace = token.
IsKind
(SyntaxKind.CloseBraceToken);
486
var nextIsCloseBrace = next.
IsKind
(SyntaxKind.CloseBraceToken);
543
var tokenIsOpenParen = token.
IsKind
(SyntaxKind.OpenParenToken);
544
var nextIsOpenParen = next.
IsKind
(SyntaxKind.OpenParenToken);
545
var tokenIsCloseParen = token.
IsKind
(SyntaxKind.CloseParenToken);
546
var nextIsCloseParen = next.
IsKind
(SyntaxKind.CloseParenToken);
600
if (next.
IsKind
(SyntaxKind.OpenBracketToken))
606
if (token.
IsKind
(SyntaxKind.OpenBracketToken))
626
return !next.
IsKind
(SyntaxKind.SemicolonToken);
649
if (token.
IsKind
(SyntaxKind.GreaterThanToken) && token.Parent.IsKind(SyntaxKind.TypeArgumentList))
657
if (token.
IsKind
(SyntaxKind.GreaterThanToken) &&
664
if (token.
IsKind
(SyntaxKind.CommaToken) &&
665
!next.
IsKind
(SyntaxKind.CommaToken) &&
677
if (next.
IsKind
(SyntaxKind.SwitchKeyword) && next.Parent is SwitchExpressionSyntax)
682
if (token.
IsKind
(SyntaxKind.QuestionToken))
693
if (token.
IsKind
(SyntaxKind.ColonToken))
699
if (next.
IsKind
(SyntaxKind.ColonToken))
709
if (token.
IsKind
(SyntaxKind.CloseBracketToken) && IsWord(next.Kind()))
715
if (token.
IsKind
(SyntaxKind.CloseParenToken) && IsWord(next.Kind()) && token.Parent.IsKind(SyntaxKind.TupleType) == true)
720
if ((next.
IsKind
(SyntaxKind.QuestionToken) || next.
IsKind
(SyntaxKind.ColonToken))
726
if (token.
IsKind
(SyntaxKind.EqualsToken))
731
if (next.
IsKind
(SyntaxKind.EqualsToken))
741
if (next.
IsKind
(SyntaxKind.AsteriskToken) && token.
IsKind
(SyntaxKind.DelegateKeyword))
747
if (token.
IsKind
(SyntaxKind.AsteriskToken) && next.Parent.IsKind(SyntaxKind.FunctionPointerCallingConvention))
759
if (next.Parent.IsKind(SyntaxKind.FunctionPointerParameterList) && next.
IsKind
(SyntaxKind.LessThanToken))
779
next.
IsKind
(SyntaxKind.OpenBracketToken))
787
if (next.
IsKind
(SyntaxKind.IdentifierToken))
789
if (token.
IsKind
(SyntaxKind.OpenBracketToken))
795
else if (token.
IsKind
(SyntaxKind.CommaToken))
803
if (next.
IsKind
(SyntaxKind.CommaToken))
810
if (next.
IsKind
(SyntaxKind.CloseBracketToken))
818
if (token.
IsKind
(SyntaxKind.LessThanToken) && token.Parent.IsKind(SyntaxKind.FunctionPointerParameterList))
825
if (next.
IsKind
(SyntaxKind.GreaterThanToken) && next.Parent.IsKind(SyntaxKind.FunctionPointerParameterList))
830
if (token.
IsKind
(SyntaxKind.EqualsGreaterThanToken) || next.
IsKind
(SyntaxKind.EqualsGreaterThanToken))
842
if (next.
IsKind
(SyntaxKind.AsteriskToken) && next.Parent is PointerTypeSyntax)
848
if (token.
IsKind
(SyntaxKind.AsteriskToken) && token.Parent is PointerTypeSyntax &&
849
(next.
IsKind
(SyntaxKind.IdentifierToken) || next.Parent.IsKind(SyntaxKind.IndexerDeclaration)))
864
next.
IsKind
(SyntaxKind.OpenBraceToken))
870
token.
IsKind
(SyntaxKind.OpenBraceToken))
876
next.
IsKind
(SyntaxKind.CloseBraceToken))
891
if (!next.
IsKind
(SyntaxKind.ColonToken) &&
892
!next.
IsKind
(SyntaxKind.DotToken) &&
893
!next.
IsKind
(SyntaxKind.QuestionToken) &&
894
!next.
IsKind
(SyntaxKind.SemicolonToken) &&
895
!next.
IsKind
(SyntaxKind.OpenBracketToken) &&
896
(!next.
IsKind
(SyntaxKind.OpenParenToken) || KeywordNeedsSeparatorBeforeOpenParen(token.Kind()) || next.Parent.IsKind(SyntaxKind.TupleType)) &&
897
!next.
IsKind
(SyntaxKind.CloseParenToken) &&
898
!next.
IsKind
(SyntaxKind.CloseBraceToken) &&
899
!next.
IsKind
(SyntaxKind.ColonColonToken) &&
900
!next.
IsKind
(SyntaxKind.GreaterThanToken) &&
901
!next.
IsKind
(SyntaxKind.CommaToken))
Microsoft.CodeAnalysis.CSharp.CodeStyle (95)
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
94
if (!token.
IsKind
(SyntaxKind.CloseBraceToken))
98
if (!nextToken.
IsKind
(SyntaxKind.CloseBraceToken))
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
343
&& predefinedType.Keyword.
IsKind
(SyntaxKind.ObjectKeyword)
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (9)
57
if (directive.DirectiveNameToken.
IsKind
(SyntaxKind.NullableKeyword))
81
if (!directive.TargetToken.
IsKind
(SyntaxKind.None))
89
if (directive.TargetToken.
IsKind
(SyntaxKind.AnnotationsKeyword))
93
else if (directive.TargetToken.
IsKind
(SyntaxKind.WarningsKeyword))
102
if (directive.SettingToken.
IsKind
(SyntaxKind.EnableKeyword))
106
else if (directive.SettingToken.
IsKind
(SyntaxKind.DisableKeyword))
116
if (directive.SettingToken.
IsKind
(SyntaxKind.EnableKeyword))
120
else if (directive.SettingToken.
IsKind
(SyntaxKind.DisableKeyword))
124
else if (directive.SettingToken.
IsKind
(SyntaxKind.RestoreKeyword))
CSharpSemanticFacts.cs (2)
333
return token.
IsKind
(SyntaxKind.InKeyword) ? queryInfo.CastInfo.GetBestOrAllSymbols() : queryInfo.OperationInfo.GetBestOrAllSymbols();
345
if (token.
IsKind
(SyntaxKind.CommaToken))
CSharpSmartTokenFormatter.cs (4)
73
return endToken.
IsKind
(SyntaxKind.CloseBraceToken) &&
95
if (token.
IsKind
(SyntaxKind.OpenBraceToken) &&
100
if (nextToken.
IsKind
(SyntaxKind.CloseBraceToken))
109
if (token.
IsKind
(SyntaxKind.OpenBraceToken) &&
CSharpSyntaxFacts.cs (1)
1521
interpolatedString.StringStartToken.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken);
CSharpTriviaFormatter.cs (2)
98
var lines = (trivia1.IsKind(SyntaxKind.None) && this.Token1.
IsKind
(SyntaxKind.None)) ? 0 : 1;
200
var isAtEndOfFileToken = (Token2.
IsKind
(SyntaxKind.EndOfFileToken) && trivia2.Kind() == 0);
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
234
if (element.Identifier.
IsKind
(SyntaxKind.None))
ElasticTriviaFormattingRule.cs (5)
103
currentToken.
IsKind
(SyntaxKind.WhereKeyword) &&
118
firstTokenAfterTypeConstraint.
IsKind
(SyntaxKind.WhereKeyword) &&
130
currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
281
if (previousToken.
IsKind
(SyntaxKind.CloseBracketToken) && previousToken.Parent is AttributeListSyntax
327
if (!currentToken.
IsKind
(SyntaxKind.EndOfFileToken) && !(currentToken.Parent is AttributeListSyntax))
FormattingHelpers.cs (8)
56
if (bracketOrBracePair.openBracketOrBrace.
IsKind
(SyntaxKind.None) ||
58
bracketOrBracePair.closeBracketOrBrace.
IsKind
(SyntaxKind.None))
63
if (bracketOrBracePair.openBracketOrBrace.
IsKind
(SyntaxKind.OpenBraceToken))
65
return bracketOrBracePair.closeBracketOrBrace.
IsKind
(SyntaxKind.CloseBraceToken);
68
if (bracketOrBracePair.openBracketOrBrace.
IsKind
(SyntaxKind.OpenBracketToken))
70
return bracketOrBracePair.closeBracketOrBrace.
IsKind
(SyntaxKind.CloseBracketToken);
277
return token.
IsKind
(SyntaxKind.EqualsToken) &&
536
return currentToken.
IsKind
(SyntaxKind.CommaToken) &&
FormattingRangeHelper.cs (1)
348
return previousToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
137
(targetToken.
IsKind
(SyntaxKind.DotDotToken) && position == targetToken.SpanStart + 1) ||
570
if (token.
IsKind
(SyntaxKind.HashToken))
NewLineUserSettingFormattingRule.cs (32)
83
if (previousToken.
IsKind
(SyntaxKind.CloseBraceToken)
84
&& currentToken.
IsKind
(SyntaxKind.ElseKeyword)
94
if (currentToken.
IsKind
(SyntaxKind.CatchKeyword))
103
if (currentToken.
IsKind
(SyntaxKind.FinallyKeyword))
112
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax)
121
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
130
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
148
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax)
160
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax)
169
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression))
178
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement))
187
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
197
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression))
206
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent))
226
if (previousToken.
IsKind
(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.ObjectInitializerExpression))
240
if (previousToken.
IsKind
(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
254
if (previousToken.
IsKind
(SyntaxKind.CloseBraceToken) && currentToken.
IsKind
(SyntaxKind.ElseKeyword))
268
if (currentToken.
IsKind
(SyntaxKind.CatchKeyword))
281
if (currentToken.
IsKind
(SyntaxKind.FinallyKeyword))
294
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax)
307
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
323
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
340
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
349
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax)
366
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax)
379
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression))
392
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement))
405
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
419
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression))
432
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent))
447
if (previousToken.
IsKind
(SyntaxKind.SemicolonToken)
SpacingFormattingRule.cs (2)
254
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken) &&
261
if (currentToken.
IsKind
(SyntaxKind.EndOfFileToken))
SuppressFormattingRule.cs (3)
334
Debug.Assert(!startToken.
IsKind
(SyntaxKind.None) && !endToken.
IsKind
(SyntaxKind.None));
347
if (!pragmaWarningDirectiveTrivia.DisableOrRestoreKeyword.
IsKind
(disableOrRestoreKeyword))
SyntaxTokenExtensions.cs (3)
46
return (token.
IsKind
(SyntaxKind.OpenBraceToken) || token.
IsKind
(SyntaxKind.CommaToken)) &&
51
=> token.
IsKind
(SyntaxKind.OpenBraceToken) && token.Parent.IsKind(SyntaxKind.AccessorList);
SyntaxTriviaExtensions.cs (1)
206
isDisable = pragmaWarning.DisableOrRestoreKeyword.
IsKind
(SyntaxKind.DisableKeyword);
TokenBasedFormattingRule.cs (7)
89
if (!currentToken.
IsKind
(SyntaxKind.SemicolonToken) &&
285
if (previousToken.
IsKind
(SyntaxKind.CloseBracketToken) &&
289
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken))
372
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken) &&
391
if (currentToken.
IsKind
(SyntaxKind.ColonToken))
451
if (currentToken.
IsKind
(SyntaxKind.QuestionToken) && currentToken.Parent.IsKind(SyntaxKind.ConditionalAccessExpression))
464
if (currentToken.
IsKind
(SyntaxKind.QuestionToken) &&
TriviaDataFactory.Analyzer.cs (1)
66
for (var currentToken = token1; !currentToken.
IsKind
(SyntaxKind.None);)
TypeSyntaxExtensions.cs (2)
15
predefinedType.Keyword.
IsKind
(SyntaxKind.VoidKeyword);
20
((IdentifierNameSyntax)typeSyntax).Identifier.
IsKind
(SyntaxKind.PartialKeyword);
UsingsAndExternAliasesOrganizer.cs (2)
61
var directive1IsUsingStatic = using1.StaticKeyword.
IsKind
(SyntaxKind.StaticKeyword);
62
var directive2IsUsingStatic = using2.StaticKeyword.
IsKind
(SyntaxKind.StaticKeyword);
WrappingFormattingRule.cs (4)
94
if (!firstToken.
IsKind
(SyntaxKind.None) || !lastToken.
IsKind
(SyntaxKind.None))
124
if (!tokens.firstToken.
IsKind
(SyntaxKind.None) || !tokens.lastToken.
IsKind
(SyntaxKind.None))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (202)
ConsecutiveBracePlacementCodeFixProvider.cs (2)
73
if (!token.
IsKind
(SyntaxKind.CloseBraceToken))
80
if (!firstBrace.
IsKind
(SyntaxKind.CloseBraceToken))
ConvertToRecordEngine.cs (3)
34
if (typeDeclaration.Modifiers.Any(modifier => modifier.
IsKind
(SyntaxKind.PartialKeyword)))
716
if (prevToken.
IsKind
(SyntaxKind.XmlTextLiteralNewLineToken))
773
token.
IsKind
(SyntaxKind.XmlTextLiteralToken)
CSharpCodeGenerationService.cs (1)
463
ComputePositionAndTriviaForRemoveAttributeFromAttributeList(attributeToRemove, (SyntaxToken t) => t.
IsKind
(SyntaxKind.CommaToken), out positionOfRemovedNode, out trivia);
CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
91
if (!methodDeclaration.Modifiers.Any(m => m.
IsKind
(SyntaxKind.AsyncKeyword)))
CSharpIndentationService.cs (4)
80
if (token.
IsKind
(SyntaxKind.None) ||
110
return token.
IsKind
(SyntaxKind.None) ||
111
token.
IsKind
(SyntaxKind.EndOfDirectiveToken) ||
112
token.
IsKind
(SyntaxKind.EndOfFileToken);
CSharpIndentationService.Indenter.cs (6)
84
if (token.
IsKind
(SyntaxKind.MultiLineRawStringLiteralToken))
128
if (interpolatedExpression.StringStartToken.
IsKind
(SyntaxKind.InterpolatedMultiLineRawStringStartToken))
142
if (!indenter.Root.FindToken(currentLine.Start, findInsideTrivia: true).
IsKind
(SyntaxKind.InterpolatedStringTextToken))
178
token.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken) ||
179
token.
IsKind
(SyntaxKind.InterpolatedStringTextToken) ||
180
(token.
IsKind
(SyntaxKind.CloseBraceToken) && token.Parent.IsKind(SyntaxKind.Interpolation)))
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
49
token.
IsKind
(SyntaxKind.DefaultKeyword) &&
CSharpSyntaxContext.cs (6)
227
var isDestructorTypeContext = targetToken.
IsKind
(SyntaxKind.TildeToken) &&
259
isCrefContext: syntaxTree.IsCrefContext(position, cancellationToken) && !leftToken.
IsKind
(SyntaxKind.DotToken),
348
if (!previousToken.
IsKind
(SyntaxKind.RecordKeyword))
432
if (targetToken.
IsKind
(SyntaxKind.AwaitKeyword))
443
&& targetToken.
IsKind
(SyntaxKind.IdentifierToken)
482
if (targetToken.
IsKind
(SyntaxKind.InKeyword))
CSharpTypeInferenceService.TypeInferrer.cs (2)
346
if (previousToken.
IsKind
(SyntaxKind.CommaToken))
2025
if (previousToken.HasValue && (previousToken.Value != yieldStatement.ReturnOrBreakKeyword || yieldStatement.ReturnOrBreakKeyword.
IsKind
(SyntaxKind.BreakKeyword)))
CSharpUseLocalFunctionCodeFixProvider.cs (1)
218
if (anonymousFunction.AsyncKeyword.
IsKind
(SyntaxKind.AsyncKeyword))
ITypeSymbolExtensions.cs (1)
100
if (reference.GetSyntax().ChildTokens().Any(t => t.
IsKind
(SyntaxKind.UnsafeKeyword)))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
25
if (token.
IsKind
(SyntaxKind.UsingKeyword))
40
if (token.
IsKind
(SyntaxKind.StaticKeyword))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (170)
35
if (token.
IsKind
(SyntaxKind.OpenBracketToken) &&
43
if (token.
IsKind
(SyntaxKind.CommaToken) &&
51
if (token.
IsKind
(SyntaxKind.ColonToken) &&
94
if (token.
IsKind
(SyntaxKind.CloseBracketToken)
165
if (token.
IsKind
(SyntaxKind.OpenBraceToken))
176
if (token.
IsKind
(SyntaxKind.SemicolonToken))
193
if (token.
IsKind
(SyntaxKind.CloseBraceToken))
219
if (token.
IsKind
(SyntaxKind.CloseBracketToken) &&
425
if (token.
IsKind
(SyntaxKind.None))
439
if (token.
IsKind
(SyntaxKind.OpenBraceToken) && token.Parent is NamespaceDeclarationSyntax or TypeDeclarationSyntax)
454
if (token.
IsKind
(SyntaxKind.SemicolonToken))
476
if (token.
IsKind
(SyntaxKind.CloseBraceToken))
506
if (token.
IsKind
(SyntaxKind.CloseBracketToken) &&
630
if (token.
IsKind
(SyntaxKind.ColonColonToken) &&
631
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.GlobalKeyword))
643
if (token.
IsKind
(SyntaxKind.UsingKeyword))
691
if ((token.
IsKind
(SyntaxKind.ClassKeyword) ||
692
token.
IsKind
(SyntaxKind.StructKeyword) ||
693
token.
IsKind
(SyntaxKind.InterfaceKeyword)) &&
694
token.GetPreviousToken().
IsKind
(SyntaxKind.PartialKeyword))
775
if (token.
IsKind
(SyntaxKind.ColonToken) ||
776
token.
IsKind
(SyntaxKind.CommaToken))
794
if (token.
IsKind
(SyntaxKind.EqualsToken) &&
823
if (token.
IsKind
(SyntaxKind.WhereKeyword) &&
829
if (token.
IsKind
(SyntaxKind.IdentifierToken) &&
850
if (token.
IsKind
(SyntaxKind.ColonToken) &&
851
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.IdentifierToken) &&
852
token.GetPreviousToken(includeSkipped: true).GetPreviousToken().
IsKind
(SyntaxKind.WhereKeyword))
876
if (token.
IsKind
(SyntaxKind.CommaToken) &&
895
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.TypeOfExpression))
907
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.DefaultExpression))
920
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.SizeOfExpression))
1048
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
1055
if (token.
IsKind
(SyntaxKind.LessThanToken) && token.Parent.IsKind(SyntaxKind.FunctionPointerParameterList))
1061
if (token.
IsKind
(SyntaxKind.CommaToken) &&
1071
if (token.
IsKind
(SyntaxKind.CommaToken) &&
1080
if (token.
IsKind
(SyntaxKind.CloseBracketToken) &&
1096
else if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName)
1132
if (token.
IsKind
(SyntaxKind.OpenBracketToken) || token.
IsKind
(SyntaxKind.CommaToken))
1146
if (token.
IsKind
(SyntaxKind.DelegateKeyword) &&
1161
if (token.
IsKind
(SyntaxKind.OperatorKeyword))
1163
if (token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.ImplicitKeyword) ||
1164
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.ExplicitKeyword))
1184
if (token.
IsKind
(SyntaxKind.OpenParenToken) ||
1185
token.
IsKind
(SyntaxKind.OpenBracketToken) ||
1186
token.
IsKind
(SyntaxKind.CommaToken))
1251
else if (token.
IsKind
(SyntaxKind.ScopedKeyword) && token.Parent.IsKind(SyntaxKind.Parameter))
1255
else if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName && scopedIdentifierName.Parent.IsKind(SyntaxKind.Parameter))
1306
if (leftToken.
IsKind
(SyntaxKind.CloseParenToken))
1323
if (leftToken.
IsKind
(SyntaxKind.IdentifierToken))
1334
if (leftToken.
IsKind
(SyntaxKind.IdentifierToken) &&
1352
if (leftToken.
IsKind
(SyntaxKind.OpenParenToken))
1398
if (leftToken.
IsKind
(SyntaxKind.DotDotToken) && leftToken.Parent.IsKind(SyntaxKind.SlicePattern))
1406
if (leftToken.
IsKind
(SyntaxKind.ColonToken) && leftToken.Parent is (kind: SyntaxKind.NameColon or SyntaxKind.ExpressionColon) &&
1424
if (leftToken.
IsKind
(SyntaxKind.NotKeyword) && leftToken.Parent.IsKind(SyntaxKind.NotPattern))
1449
if (leftToken.
IsKind
(SyntaxKind.DotToken))
1510
binaryExpressionSyntax.OperatorToken.
IsKind
(SyntaxKind.IsKeyword) &&
1613
if (leftToken.
IsKind
(SyntaxKind.OpenParenToken) && leftToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
1769
if (token.
IsKind
(SyntaxKind.ConstKeyword) &&
1801
if (token.
IsKind
(SyntaxKind.OutKeyword) &&
1813
if (token.
IsKind
(SyntaxKind.OpenParenToken))
1816
if (previous.
IsKind
(SyntaxKind.ForKeyword) ||
1817
previous.
IsKind
(SyntaxKind.ForEachKeyword) ||
1818
previous.
IsKind
(SyntaxKind.UsingKeyword))
1826
if (token.
IsKind
(SyntaxKind.UsingKeyword) &&
1841
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.JoinKeyword) &&
1853
if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent.IsKind(SyntaxKind.IdentifierName) && token.Parent.Parent is VariableDeclarationSyntax or ExpressionStatementSyntax or IncompleteMemberSyntax)
1859
if (token.
IsKind
(SyntaxKind.ScopedKeyword) && token.Parent is IncompleteMemberSyntax)
1876
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
1877
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.FixedKeyword))
1893
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
1894
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.CatchKeyword))
1907
if (token.
IsKind
(SyntaxKind.IsKeyword) ||
1908
token.
IsKind
(SyntaxKind.AsKeyword))
1921
if (token.
IsKind
(SyntaxKind.NewKeyword))
1975
if (token.
IsKind
(SyntaxKind.None))
2025
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.OpenParenToken) &&
2039
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2059
if (token.
IsKind
(SyntaxKind.CaseKeyword) &&
2065
if (token.
IsKind
(SyntaxKind.EqualsToken) &&
2102
(token.
IsKind
(SyntaxKind.CommaToken) ||
2103
token.
IsKind
(SyntaxKind.OpenParenToken)))
2109
if (token.
IsKind
(SyntaxKind.ColonToken) &&
2117
if (token.
IsKind
(SyntaxKind.EqualsToken) &&
2188
if (token.
IsKind
(SyntaxKind.DotToken) ||
2189
token.
IsKind
(SyntaxKind.ColonColonToken) ||
2190
token.
IsKind
(SyntaxKind.MinusGreaterThanToken))
2197
if (token.
IsKind
(SyntaxKind.EqualsToken))
2219
if (token.
IsKind
(SyntaxKind.EqualsToken) ||
2220
token.
IsKind
(SyntaxKind.MinusEqualsToken) ||
2221
token.
IsKind
(SyntaxKind.AsteriskEqualsToken) ||
2222
token.
IsKind
(SyntaxKind.PlusEqualsToken) ||
2223
token.
IsKind
(SyntaxKind.SlashEqualsToken) ||
2224
token.
IsKind
(SyntaxKind.ExclamationEqualsToken) ||
2225
token.
IsKind
(SyntaxKind.CaretEqualsToken) ||
2226
token.
IsKind
(SyntaxKind.AmpersandEqualsToken) ||
2227
token.
IsKind
(SyntaxKind.BarEqualsToken) ||
2228
token.
IsKind
(SyntaxKind.PercentEqualsToken) ||
2229
token.
IsKind
(SyntaxKind.LessThanLessThanEqualsToken) ||
2230
token.
IsKind
(SyntaxKind.GreaterThanGreaterThanEqualsToken) ||
2231
token.
IsKind
(SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken) ||
2232
token.
IsKind
(SyntaxKind.QuestionQuestionEqualsToken))
2238
if (token.
IsKind
(SyntaxKind.OpenParenToken))
2313
if (token.
IsKind
(SyntaxKind.AsteriskToken) && semanticModel != null)
2330
tokenOnLeftOfPosition.
IsKind
(SyntaxKind.IdentifierToken))
2333
if (previousToken.
IsKind
(SyntaxKind.AsteriskToken) ||
2334
previousToken.
IsKind
(SyntaxKind.QuestionToken))
2360
if (token.
IsKind
(SyntaxKind.OpenBracketToken) ||
2361
token.
IsKind
(SyntaxKind.CommaToken))
2371
if (token.
IsKind
(SyntaxKind.DotDotToken) &&
2379
if (token.
IsKind
(SyntaxKind.QuestionToken) &&
2388
if (token.
IsKind
(SyntaxKind.ColonToken) &&
2397
if (token.
IsKind
(SyntaxKind.OpenParenToken))
2419
if (token.
IsKind
(SyntaxKind.OpenParenToken) ||
2420
token.
IsKind
(SyntaxKind.OpenBracketToken) ||
2421
token.
IsKind
(SyntaxKind.CommaToken))
2433
if (token.
IsKind
(SyntaxKind.OpenParenToken) ||
2434
token.
IsKind
(SyntaxKind.CommaToken))
2447
if (token.
IsKind
(SyntaxKind.RefKeyword) ||
2448
token.
IsKind
(SyntaxKind.InKeyword) ||
2449
token.
IsKind
(SyntaxKind.OutKeyword))
2469
if (token.
IsKind
(SyntaxKind.ColonToken) &&
2477
if (token.
IsKind
(SyntaxKind.EqualsGreaterThanToken))
2484
if (token.
IsKind
(SyntaxKind.OpenBraceToken) ||
2485
token.
IsKind
(SyntaxKind.CommaToken))
2491
if (token.Parent.IsKind(SyntaxKind.ObjectInitializerExpression) && token.
IsKind
(SyntaxKind.OpenBraceToken))
2494
if (!token.IntersectsWith(position) && token.GetNextToken().GetNextToken().
IsKind
(SyntaxKind.EqualsToken))
2521
if (token.
IsKind
(SyntaxKind.SemicolonToken) &&
2532
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2541
if (token.
IsKind
(SyntaxKind.CommaToken) &&
2551
if (token.
IsKind
(SyntaxKind.InKeyword))
2565
if (token.
IsKind
(SyntaxKind.OnKeyword) ||
2566
token.
IsKind
(SyntaxKind.EqualsKeyword))
2575
if (token.
IsKind
(SyntaxKind.WhereKeyword) &&
2583
if (token.
IsKind
(SyntaxKind.OrderByKeyword) ||
2584
token.
IsKind
(SyntaxKind.CommaToken))
2593
if (token.
IsKind
(SyntaxKind.SelectKeyword) &&
2601
if (token.
IsKind
(SyntaxKind.GroupKeyword) ||
2602
token.
IsKind
(SyntaxKind.ByKeyword))
2613
if (token.
IsKind
(SyntaxKind.ReturnKeyword))
2622
if (token.
IsKind
(SyntaxKind.ThrowKeyword))
2628
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2629
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.WhileKeyword))
2638
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.UsingStatement))
2644
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2645
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.LockKeyword))
2651
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2652
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.IfKeyword))
2658
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2659
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.SwitchKeyword))
2665
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2666
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.CheckedKeyword))
2672
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2673
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.UncheckedKeyword))
2679
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2680
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.WhenKeyword))
2686
if (token.
IsKind
(SyntaxKind.WhenKeyword) && token.Parent.IsKind(SyntaxKind.WhenClause))
2703
if (token.
IsKind
(SyntaxKind.OpenBraceToken) || token.
IsKind
(SyntaxKind.CommaToken))
2726
if (token.
IsKind
(SyntaxKind.OpenBraceToken))
2747
if (token.
IsKind
(SyntaxKind.DotToken))
2819
if (token.
IsKind
(SyntaxKind.NumericLiteralToken))
2862
if (token.
IsKind
(SyntaxKind.IdentifierToken) &&
2946
if (token.
IsKind
(SyntaxKind.CloseBraceToken))
2974
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.CatchKeyword))
2979
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.CloseParenToken) &&
2998
token.
IsKind
(SyntaxKind.ColonToken) &&
3009
if (!token.
IsKind
(SyntaxKind.DotToken))
3060
return targetToken.
IsKind
(SyntaxKind.AsteriskToken) &&
TypeDeclarationSyntaxExtensions.cs (2)
100
if (token.IsMissing || token.
IsKind
(SyntaxKind.None))
115
if (typeDeclaration.SemicolonToken.
IsKind
(SyntaxKind.SemicolonToken))
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
14639
if ((context.Node as PragmaWarningDirectiveTriviaSyntax).DisableOrRestoreKeyword.
IsKind
(SyntaxKind.RestoreKeyword))
14694
if ((nodeContext.Node as PragmaWarningDirectiveTriviaSyntax).DisableOrRestoreKeyword.
IsKind
(SyntaxKind.DisableKeyword))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (10)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (2)
634
if (syntaxToken.IsMissing || syntaxToken.
IsKind
(SyntaxKind.None))
673
if (token.
IsKind
(SyntaxKind.None))
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (3)
381
if (nextToken.
IsKind
(SyntaxKind.SemicolonToken)
761
return openBrace.
IsKind
(SyntaxKind.None) && closeBrace.
IsKind
(SyntaxKind.None)
CompleteStatement\CompleteStatementCommandHandler.cs (2)
163
if (!openingDelimiter.
IsKind
(SyntaxKind.None) && openingDelimiter.Span.Start >= caretPosition
164
|| !closingDelimiter.
IsKind
(SyntaxKind.None) && closingDelimiter.Span.End <= caretPosition)
DocumentationComments\XmlTagCompletionCommandHandler.cs (2)
41
if (token.
IsKind
(SyntaxKind.GreaterThanToken))
65
else if (token.
IsKind
(SyntaxKind.LessThanSlashToken))
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandler.cs (1)
80
if (token.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3422
if (position == endToken.SpanStart && !endToken.GetPreviousToken().
IsKind
(SyntaxKind.None))
Microsoft.CodeAnalysis.CSharp.Features (145)
BraceCompletion\BracketBraceCompletionService.cs (3)
39
protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.OpenBracketToken);
41
protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.CloseBracketToken);
57
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken) && currentToken.Parent.IsKind(SyntaxKind.ListPattern))
BraceCompletion\CharLiteralBraceCompletionService.cs (2)
34
protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.CharacterLiteralToken);
36
protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.CharacterLiteralToken);
BraceCompletion\CurlyBraceCompletionService.cs (3)
56
=> token.
IsKind
(SyntaxKind.OpenBraceToken) && !token.Parent.IsKind(SyntaxKind.Interpolation);
59
=> token.
IsKind
(SyntaxKind.CloseBraceToken);
132
if (!currentToken.
IsKind
(SyntaxKind.OpenBraceToken))
BraceCompletion\InterpolatedStringBraceCompletionService.cs (3)
45
=> leftToken.
IsKind
(SyntaxKind.InterpolatedStringStartToken) || leftToken.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken);
48
=> rightToken.
IsKind
(SyntaxKind.InterpolatedStringEndToken);
BraceCompletion\InterpolationBraceCompletionService.cs (2)
47
=> token.
IsKind
(SyntaxKind.OpenBraceToken) && token.Parent.IsKind(SyntaxKind.Interpolation);
50
=> token.
IsKind
(SyntaxKind.CloseBraceToken);
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (2)
37
=> token.
IsKind
(SyntaxKind.LessThanToken);
40
=> token.
IsKind
(SyntaxKind.GreaterThanToken);
BraceCompletion\ParenthesisBraceCompletionService.cs (2)
33
protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.OpenParenToken);
35
protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.CloseParenToken);
BraceCompletion\StringLiteralBraceCompletionService.cs (4)
45
protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.StringLiteralToken);
47
protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.
IsKind
(SyntaxKind.StringLiteralToken);
67
if (token.
IsKind
(SyntaxKind.StringLiteralToken) &&
88
while (!token.
IsKind
(SyntaxKind.None) && !token.TrailingTrivia.Contains(t => t.IsEndOfLine()))
BraceMatching\StringLiteralBraceMatcher.cs (3)
35
if (token.
IsKind
(SyntaxKind.StringLiteralToken))
39
else if (token.
IsKind
(SyntaxKind.Utf8StringLiteralToken))
50
else if (token.
IsKind
(SyntaxKind.InterpolatedStringEndToken))
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (13)
47
if (token.
IsKind
(SyntaxKind.EndOfDirectiveToken))
92
if (firstToken.
IsKind
(SyntaxKind.None))
113
if (firstNonDirectiveToken.
IsKind
(SyntaxKind.None) && firstDirective is null)
130
if (originalNode.SettingToken.
IsKind
(SyntaxKind.DisableKeyword))
136
if (originalNode.SettingToken.
IsKind
(SyntaxKind.RestoreKeyword))
141
if (originalNode.SettingToken.
IsKind
(SyntaxKind.EnableKeyword))
168
else if (leadingDirective.SettingToken.
IsKind
(SyntaxKind.RestoreKeyword) && leadingDirective.TargetToken.
IsKind
(SyntaxKind.None))
212
if (firstToken.
IsKind
(SyntaxKind.None))
217
if (firstToken.
IsKind
(SyntaxKind.HashToken) && firstToken.Parent.IsKind(SyntaxKind.RegionDirectiveTrivia))
222
if (nextToken.
IsKind
(SyntaxKind.HashToken) && nextToken.Parent.IsKind(SyntaxKind.EndRegionDirectiveTrivia))
237
&& nullableDirective.TargetToken.
IsKind
(SyntaxKind.None))
240
if (firstSemanticToken.
IsKind
(SyntaxKind.None) || firstSemanticToken.SpanStart > nullableDirective.Span.End)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
161
var displayTextSuffix = rightToken.
IsKind
(SyntaxKind.EqualsToken) ? null : SpaceEqualsString;
183
var displayTextSuffix = rightToken.
IsKind
(SyntaxKind.ColonToken) ? null : ColonString;
Completion\CompletionProviders\CrefCompletionProvider.cs (4)
144
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
150
if (token.
IsKind
(SyntaxKind.OpenBracketToken) &&
164
return token.
IsKind
(SyntaxKind.DotToken)
293
if (symbol is INamespaceOrTypeSymbol && token.
IsKind
(SyntaxKind.DotToken))
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (2)
116
if (token.
IsKind
(SyntaxKind.NewKeyword) && token.Parent.IsKind(SyntaxKind.ObjectCreationExpression))
168
if (previousToken.
IsKind
(SyntaxKind.DotToken) &&
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (6)
148
if (token.
IsKind
(SyntaxKind.IdentifierToken) &&
238
if (!IsPossibleTypeToken(token) && !token.
IsKind
(SyntaxKind.CommaToken))
249
if (token.
IsKind
(SyntaxKind.CommaToken) && token.Parent != target)
260
if (!token.
IsKind
(SyntaxKind.CommaToken) && token != typeSyntax.GetLastToken())
358
var possibleDeclarationComputer = token.
IsKind
(SyntaxKind.CommaToken)
378
if (token.
IsKind
(SyntaxKind.QuestionToken) &&
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
87
if (token.
IsKind
(SyntaxKind.DotToken))
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (2)
59
if (!targetToken.
IsKind
(SyntaxKind.AliasKeyword)
60
&& !(targetToken.
IsKind
(SyntaxKind.IdentifierToken) && targetToken.HasMatchingText(SyntaxKind.AliasKeyword)))
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
46
if (token.
IsKind
(SyntaxKind.None) || token.IsMissing)
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
48
if (token.
IsKind
(SyntaxKind.None) || token.IsMissing)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
136
return !syntaxToken.
IsKind
(SyntaxKind.None)
137
&& !touchingToken.
IsKind
(SyntaxKind.None)
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
76
=> syntax is BaseTypeDeclarationSyntax declarationSyntax && declarationSyntax.Modifiers.Any(modifier => modifier.
IsKind
(SyntaxKind.PartialKeyword));
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
188
if (token.
IsKind
(SyntaxKind.DotToken))
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
133
if (tokenLeftOfGenericName.
IsKind
(SyntaxKind.DotToken) && tokenLeftOfGenericName.Parent.IsKind(SyntaxKind.QualifiedName))
Completion\CompletionProviders\TupleNameCompletionProvider.cs (2)
75
if (token.
IsKind
(SyntaxKind.OpenParenToken))
83
if (token.
IsKind
(SyntaxKind.CommaToken) && token.Parent is TupleExpressionSyntax tupleExpr)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (5)
114
(token.Parent.IsKind(SyntaxKind.XmlElementEndTag) && token.
IsKind
(SyntaxKind.GreaterThanToken)) ||
125
var xmlNameOnly = token.
IsKind
(SyntaxKind.LessThanToken)
186
if (token.
IsKind
(SyntaxKind.XmlTextLiteralToken) && string.IsNullOrWhiteSpace(token.Text))
202
if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Parent.IsKind(SyntaxKind.XmlName))
270
else if (token.
IsKind
(SyntaxKind.XmlTextLiteralToken) &&
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (1)
45
=> context.TargetToken.
IsKind
(SyntaxKind.RefKeyword) &&
Completion\KeywordRecommenders\RefKeywordRecommender.cs (2)
171
return previous.
IsKind
(SyntaxKind.ForKeyword)
172
|| previous.
IsKind
(SyntaxKind.ForEachKeyword);
Completion\KeywordRecommenders\ThrowKeywordRecommender.cs (2)
25
if (context.TargetToken.
IsKind
(SyntaxKind.EqualsGreaterThanToken))
31
if (context.TargetToken.
IsKind
(SyntaxKind.QuestionQuestionToken))
Completion\KeywordRecommenders\WhereKeywordRecommender.cs (1)
101
if (token.
IsKind
(SyntaxKind.DotToken))
ConsecutiveBracePlacementCodeFixProvider.cs (2)
73
if (!token.
IsKind
(SyntaxKind.CloseBraceToken))
80
if (!firstBrace.
IsKind
(SyntaxKind.CloseBraceToken))
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
94
if (!token.
IsKind
(SyntaxKind.CloseBraceToken))
98
if (!nextToken.
IsKind
(SyntaxKind.CloseBraceToken))
ConvertToRecordEngine.cs (3)
34
if (typeDeclaration.Modifiers.Any(modifier => modifier.
IsKind
(SyntaxKind.PartialKeyword)))
716
if (prevToken.
IsKind
(SyntaxKind.XmlTextLiteralNewLineToken))
773
token.
IsKind
(SyntaxKind.XmlTextLiteralToken)
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
343
&& predefinedType.Keyword.
IsKind
(SyntaxKind.ObjectKeyword)
CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
91
if (!methodDeclaration.Modifiers.Any(m => m.
IsKind
(SyntaxKind.AsyncKeyword)))
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (9)
57
if (directive.DirectiveNameToken.
IsKind
(SyntaxKind.NullableKeyword))
81
if (!directive.TargetToken.
IsKind
(SyntaxKind.None))
89
if (directive.TargetToken.
IsKind
(SyntaxKind.AnnotationsKeyword))
93
else if (directive.TargetToken.
IsKind
(SyntaxKind.WarningsKeyword))
102
if (directive.SettingToken.
IsKind
(SyntaxKind.EnableKeyword))
106
else if (directive.SettingToken.
IsKind
(SyntaxKind.DisableKeyword))
116
if (directive.SettingToken.
IsKind
(SyntaxKind.EnableKeyword))
120
else if (directive.SettingToken.
IsKind
(SyntaxKind.DisableKeyword))
124
else if (directive.SettingToken.
IsKind
(SyntaxKind.RestoreKeyword))
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
49
token.
IsKind
(SyntaxKind.DefaultKeyword) &&
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
234
if (element.Identifier.
IsKind
(SyntaxKind.None))
CSharpUseLocalFunctionCodeFixProvider.cs (1)
218
if (anonymousFunction.AsyncKeyword.
IsKind
(SyntaxKind.AsyncKeyword))
Debugging\BreakpointResolver.cs (1)
78
if (token.
IsKind
(SyntaxKind.SemicolonToken))
Debugging\DataTipInfoGetter.cs (1)
36
return token.
IsKind
(SyntaxKind.IdentifierToken)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (7)
2208
if (((LocalDeclarationStatementSyntax)node).UsingKeyword.
IsKind
(SyntaxKind.UsingKeyword))
2225
Debug.Assert(((CommonForEachStatementSyntax)node).AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword));
2229
RoslynDebug.Assert(((LocalDeclarationStatementSyntax)node.Parent!.Parent!).AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword));
2726
deletedForeachStatement.AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword))
2740
!((LocalDeclarationStatementSyntax)newLocalDeclaration).AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword))
2760
!oldForEachStatement.AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword))
2774
!((LocalDeclarationStatementSyntax)oldLocalDeclaration).AwaitKeyword.
IsKind
(SyntaxKind.AwaitKeyword))
EditAndContinue\SyntaxComparer.cs (4)
831
if (leftUsing.GlobalKeyword.
IsKind
(SyntaxKind.None) != rightUsing.GlobalKeyword.
IsKind
(SyntaxKind.None))
835
if (leftUsing.UnsafeKeyword.
IsKind
(SyntaxKind.None) != rightUsing.UnsafeKeyword.
IsKind
(SyntaxKind.None))
EditAndContinue\SyntaxUtilities.cs (1)
267
return anonymousFunction.AsyncKeyword.
IsKind
(SyntaxKind.AsyncKeyword);
ExtractMethod\CSharpMethodExtractor.cs (1)
215
if (!leadingTrivia.Any(t => t.IsKind(SyntaxKind.EndOfLineTrivia)) && !methodDefinition.FindTokenOnLeftOfPosition(methodDefinition.SpanStart).
IsKind
(SyntaxKind.OpenBraceToken))
GenerateType\CSharpGenerateTypeService.cs (5)
231
!token.
IsKind
(SyntaxKind.DotToken))
247
if (token.
IsKind
(SyntaxKind.DotToken) &&
267
nextToken.
IsKind
(SyntaxKind.DotToken))
285
if (nextToken.
IsKind
(SyntaxKind.DotToken))
317
if (nextToken.
IsKind
(SyntaxKind.DotToken))
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
40
if (token.GetPreviousToken().
IsKind
(SyntaxKind.YieldKeyword))
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
69
var end = !gotoStatement.CaseOrDefaultKeyword.
IsKind
(SyntaxKind.None)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
298
if (localFunction != null && !localFunction.Modifiers.Any(modifier => modifier.
IsKind
(SyntaxKind.StaticKeyword)))
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
62
=> token.
IsKind
(SyntaxKind.EndOfDirectiveToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
31
if (token.
IsKind
(SyntaxKind.EqualsGreaterThanToken)
38
else if (token.
IsKind
(SyntaxKind.DelegateKeyword) && token.Parent.IsKind(SyntaxKind.AnonymousMethodExpression))
64
if (token.
IsKind
(SyntaxKind.DotToken) &&
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
59
return !token.
IsKind
(SyntaxKind.None) &&
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (3)
288
return !token.
IsKind
(SyntaxKind.None) &&
337
return !token.
IsKind
(SyntaxKind.None) &&
372
return !token.
IsKind
(SyntaxKind.None) &&
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
63
return !token.
IsKind
(SyntaxKind.None) &&
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
48
=> !token.
IsKind
(SyntaxKind.None) &&
SignatureHelp\SignatureHelpUtilities.cs (3)
103
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
130
if (token.
IsKind
(SyntaxKind.CommaToken) && token.Parent is TupleExpressionSyntax && token.GetAncestor<TSyntaxNode>() != null)
135
return !token.
IsKind
(SyntaxKind.None) &&
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
227
=> token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent is ParenthesizedExpressionSyntax;
SplitStringLiteral\SimpleStringSplitter.cs (1)
40
return _token.
IsKind
(SyntaxKind.Utf8StringLiteralToken) && CursorPosition >= _token.Span.End - "u8".Length;
SplitStringLiteral\StringSplitter.cs (4)
52
if (token.
IsKind
(SyntaxKind.StringLiteralToken) ||
53
token.
IsKind
(SyntaxKind.Utf8StringLiteralToken))
72
if (token.
IsKind
(SyntaxKind.InterpolatedStringTextToken) ||
73
token.
IsKind
(SyntaxKind.InterpolatedStringEndToken) ||
StringIndentation\CSharpStringIndentationService.cs (1)
63
interpolatedString.StringStartToken.
IsKind
(SyntaxKind.InterpolatedMultiLineRawStringStartToken))
Structure\CSharpStructureHelpers.cs (2)
259
if (startToken.
IsKind
(SyntaxKind.None) || endToken.
IsKind
(SyntaxKind.None))
Structure\Providers\BlockSyntaxStructureProvider.cs (1)
98
if (previousToken.
IsKind
(SyntaxKind.None))
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (4)
68
updatedProperty.Modifiers.Where(token => !token.
IsKind
(SyntaxKind.ReadOnlyKeyword)));
96
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AccessorList))
101
if (previousToken.
IsKind
(SyntaxKind.OpenBraceToken) && previousToken.Parent.IsKind(SyntaxKind.AccessorList))
106
if (currentToken.
IsKind
(SyntaxKind.CloseBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AccessorList))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\UnsafeTests.cs (2)
5507
foreach (var nullSyntax in tree.GetCompilationUnitRoot().DescendantTokens().Where(token => token.
IsKind
(SyntaxKind.NullKeyword)))
5543
foreach (var declarationSyntax in tree.GetCompilationUnitRoot().DescendantTokens().OfType<VariableDeclarationSyntax>().Where(syntax => syntax.GetFirstToken().
IsKind
(SyntaxKind.VoidKeyword)))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxAnnotationTests.cs (3)
693
if (!token.
IsKind
(SyntaxKind.None))
734
if (token.
IsKind
(SyntaxKind.None))
834
if (token.
IsKind
(SyntaxKind.None))
Syntax\SyntaxNodeTests.cs (1)
2230
var tokens = expr.DescendantTokens().Where(t => t.
IsKind
(SyntaxKind.IdentifierToken)).ToList();
Microsoft.CodeAnalysis.CSharp.Workspaces (319)
Classification\ClassificationHelpers.cs (17)
34
else if (SyntaxFacts.IsKeywordKind(token.Kind()) || token.
IsKind
(SyntaxKind.DiscardDesignation))
143
return token.
IsKind
(SyntaxKind.StringLiteralToken)
144
|| token.
IsKind
(SyntaxKind.Utf8StringLiteralToken)
145
|| token.
IsKind
(SyntaxKind.CharacterLiteralToken)
146
|| token.
IsKind
(SyntaxKind.InterpolatedStringStartToken)
147
|| token.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken)
148
|| token.
IsKind
(SyntaxKind.InterpolatedStringTextToken)
149
|| token.
IsKind
(SyntaxKind.InterpolatedStringEndToken)
150
|| token.
IsKind
(SyntaxKind.InterpolatedRawStringEndToken)
151
|| token.
IsKind
(SyntaxKind.InterpolatedSingleLineRawStringStartToken)
152
|| token.
IsKind
(SyntaxKind.InterpolatedMultiLineRawStringStartToken)
153
|| token.
IsKind
(SyntaxKind.SingleLineRawStringLiteralToken)
154
|| token.
IsKind
(SyntaxKind.Utf8SingleLineRawStringLiteralToken)
155
|| token.
IsKind
(SyntaxKind.MultiLineRawStringLiteralToken)
156
|| token.
IsKind
(SyntaxKind.Utf8MultiLineRawStringLiteralToken);
176
&& interpolatedString.StringStartToken.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken);
187
&& interpolatedString.StringStartToken.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken);
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
150
identifierNameSyntax.Identifier.
IsKind
(SyntaxKind.GlobalKeyword);
CodeGeneration\CSharpSyntaxGenerator.cs (2)
1016
=> list.Target?.Identifier.
IsKind
(SyntaxKind.ReturnKeyword) ?? false;
1984
=> type is PredefinedTypeSyntax pd && pd.Keyword.
IsKind
(SyntaxKind.VoidKeyword) ? null : type;
CSharpCodeGenerationService.cs (1)
463
ComputePositionAndTriviaForRemoveAttributeFromAttributeList(attributeToRemove, (SyntaxToken t) => t.
IsKind
(SyntaxKind.CommaToken), out positionOfRemovedNode, out trivia);
CSharpIndentationService.cs (4)
80
if (token.
IsKind
(SyntaxKind.None) ||
110
return token.
IsKind
(SyntaxKind.None) ||
111
token.
IsKind
(SyntaxKind.EndOfDirectiveToken) ||
112
token.
IsKind
(SyntaxKind.EndOfFileToken);
CSharpIndentationService.Indenter.cs (6)
84
if (token.
IsKind
(SyntaxKind.MultiLineRawStringLiteralToken))
128
if (interpolatedExpression.StringStartToken.
IsKind
(SyntaxKind.InterpolatedMultiLineRawStringStartToken))
142
if (!indenter.Root.FindToken(currentLine.Start, findInsideTrivia: true).
IsKind
(SyntaxKind.InterpolatedStringTextToken))
178
token.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken) ||
179
token.
IsKind
(SyntaxKind.InterpolatedStringTextToken) ||
180
(token.
IsKind
(SyntaxKind.CloseBraceToken) && token.Parent.IsKind(SyntaxKind.Interpolation)))
CSharpSemanticFacts.cs (2)
333
return token.
IsKind
(SyntaxKind.InKeyword) ? queryInfo.CastInfo.GetBestOrAllSymbols() : queryInfo.OperationInfo.GetBestOrAllSymbols();
345
if (token.
IsKind
(SyntaxKind.CommaToken))
CSharpSmartTokenFormatter.cs (4)
73
return endToken.
IsKind
(SyntaxKind.CloseBraceToken) &&
95
if (token.
IsKind
(SyntaxKind.OpenBraceToken) &&
100
if (nextToken.
IsKind
(SyntaxKind.CloseBraceToken))
109
if (token.
IsKind
(SyntaxKind.OpenBraceToken) &&
CSharpSyntaxContext.cs (6)
227
var isDestructorTypeContext = targetToken.
IsKind
(SyntaxKind.TildeToken) &&
259
isCrefContext: syntaxTree.IsCrefContext(position, cancellationToken) && !leftToken.
IsKind
(SyntaxKind.DotToken),
348
if (!previousToken.
IsKind
(SyntaxKind.RecordKeyword))
432
if (targetToken.
IsKind
(SyntaxKind.AwaitKeyword))
443
&& targetToken.
IsKind
(SyntaxKind.IdentifierToken)
482
if (targetToken.
IsKind
(SyntaxKind.InKeyword))
CSharpSyntaxFacts.cs (1)
1521
interpolatedString.StringStartToken.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken);
CSharpTriviaFormatter.cs (2)
98
var lines = (trivia1.IsKind(SyntaxKind.None) && this.Token1.
IsKind
(SyntaxKind.None)) ? 0 : 1;
200
var isAtEndOfFileToken = (Token2.
IsKind
(SyntaxKind.EndOfFileToken) && trivia2.Kind() == 0);
CSharpTypeInferenceService.TypeInferrer.cs (2)
346
if (previousToken.
IsKind
(SyntaxKind.CommaToken))
2025
if (previousToken.HasValue && (previousToken.Value != yieldStatement.ReturnOrBreakKeyword || yieldStatement.ReturnOrBreakKeyword.
IsKind
(SyntaxKind.BreakKeyword)))
ElasticTriviaFormattingRule.cs (5)
103
currentToken.
IsKind
(SyntaxKind.WhereKeyword) &&
118
firstTokenAfterTypeConstraint.
IsKind
(SyntaxKind.WhereKeyword) &&
130
currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
281
if (previousToken.
IsKind
(SyntaxKind.CloseBracketToken) && previousToken.Parent is AttributeListSyntax
327
if (!currentToken.
IsKind
(SyntaxKind.EndOfFileToken) && !(currentToken.Parent is AttributeListSyntax))
Formatting\CSharpSyntaxFormattingService.cs (9)
67
if (token.
IsKind
(SyntaxKind.CloseParenToken) && !token.Parent.IsKind(SyntaxKind.UsingStatement))
75
if (token.
IsKind
(SyntaxKind.ColonToken) && !(token.Parent.IsKind(SyntaxKind.LabeledStatement) || token.Parent is SwitchLabelSyntax))
82
if (token.
IsKind
(SyntaxKind.OpenBraceToken))
132
(token.
IsKind
(SyntaxKind.CloseBraceToken) && OnlySmartIndentCloseBrace(indentationOptions.AutoFormattingOptions)) ||
133
(token.
IsKind
(SyntaxKind.OpenBraceToken) && OnlySmartIndentOpenBrace(indentationOptions.AutoFormattingOptions));
290
if (endToken.
IsKind
(SyntaxKind.OpenBraceToken))
312
return token.
IsKind
(SyntaxKind.None) ||
313
token.
IsKind
(SyntaxKind.EndOfDirectiveToken) ||
314
token.
IsKind
(SyntaxKind.EndOfFileToken);
FormattingHelpers.cs (8)
56
if (bracketOrBracePair.openBracketOrBrace.
IsKind
(SyntaxKind.None) ||
58
bracketOrBracePair.closeBracketOrBrace.
IsKind
(SyntaxKind.None))
63
if (bracketOrBracePair.openBracketOrBrace.
IsKind
(SyntaxKind.OpenBraceToken))
65
return bracketOrBracePair.closeBracketOrBrace.
IsKind
(SyntaxKind.CloseBraceToken);
68
if (bracketOrBracePair.openBracketOrBrace.
IsKind
(SyntaxKind.OpenBracketToken))
70
return bracketOrBracePair.closeBracketOrBrace.
IsKind
(SyntaxKind.CloseBracketToken);
277
return token.
IsKind
(SyntaxKind.EqualsToken) &&
536
return currentToken.
IsKind
(SyntaxKind.CommaToken) &&
FormattingRangeHelper.cs (1)
348
return previousToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (3)
46
return (token.
IsKind
(SyntaxKind.OpenBraceToken) || token.
IsKind
(SyntaxKind.CommaToken)) &&
51
=> token.
IsKind
(SyntaxKind.OpenBraceToken) && token.Parent.IsKind(SyntaxKind.AccessorList);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
137
(targetToken.
IsKind
(SyntaxKind.DotDotToken) && position == targetToken.SpanStart + 1) ||
570
if (token.
IsKind
(SyntaxKind.HashToken))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (2)
15
predefinedType.Keyword.
IsKind
(SyntaxKind.VoidKeyword);
20
((IdentifierNameSyntax)typeSyntax).Identifier.
IsKind
(SyntaxKind.PartialKeyword);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
25
if (token.
IsKind
(SyntaxKind.UsingKeyword))
40
if (token.
IsKind
(SyntaxKind.StaticKeyword))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (170)
35
if (token.
IsKind
(SyntaxKind.OpenBracketToken) &&
43
if (token.
IsKind
(SyntaxKind.CommaToken) &&
51
if (token.
IsKind
(SyntaxKind.ColonToken) &&
94
if (token.
IsKind
(SyntaxKind.CloseBracketToken)
165
if (token.
IsKind
(SyntaxKind.OpenBraceToken))
176
if (token.
IsKind
(SyntaxKind.SemicolonToken))
193
if (token.
IsKind
(SyntaxKind.CloseBraceToken))
219
if (token.
IsKind
(SyntaxKind.CloseBracketToken) &&
425
if (token.
IsKind
(SyntaxKind.None))
439
if (token.
IsKind
(SyntaxKind.OpenBraceToken) && token.Parent is NamespaceDeclarationSyntax or TypeDeclarationSyntax)
454
if (token.
IsKind
(SyntaxKind.SemicolonToken))
476
if (token.
IsKind
(SyntaxKind.CloseBraceToken))
506
if (token.
IsKind
(SyntaxKind.CloseBracketToken) &&
630
if (token.
IsKind
(SyntaxKind.ColonColonToken) &&
631
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.GlobalKeyword))
643
if (token.
IsKind
(SyntaxKind.UsingKeyword))
691
if ((token.
IsKind
(SyntaxKind.ClassKeyword) ||
692
token.
IsKind
(SyntaxKind.StructKeyword) ||
693
token.
IsKind
(SyntaxKind.InterfaceKeyword)) &&
694
token.GetPreviousToken().
IsKind
(SyntaxKind.PartialKeyword))
775
if (token.
IsKind
(SyntaxKind.ColonToken) ||
776
token.
IsKind
(SyntaxKind.CommaToken))
794
if (token.
IsKind
(SyntaxKind.EqualsToken) &&
823
if (token.
IsKind
(SyntaxKind.WhereKeyword) &&
829
if (token.
IsKind
(SyntaxKind.IdentifierToken) &&
850
if (token.
IsKind
(SyntaxKind.ColonToken) &&
851
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.IdentifierToken) &&
852
token.GetPreviousToken(includeSkipped: true).GetPreviousToken().
IsKind
(SyntaxKind.WhereKeyword))
876
if (token.
IsKind
(SyntaxKind.CommaToken) &&
895
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.TypeOfExpression))
907
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.DefaultExpression))
920
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.SizeOfExpression))
1048
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
1055
if (token.
IsKind
(SyntaxKind.LessThanToken) && token.Parent.IsKind(SyntaxKind.FunctionPointerParameterList))
1061
if (token.
IsKind
(SyntaxKind.CommaToken) &&
1071
if (token.
IsKind
(SyntaxKind.CommaToken) &&
1080
if (token.
IsKind
(SyntaxKind.CloseBracketToken) &&
1096
else if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName)
1132
if (token.
IsKind
(SyntaxKind.OpenBracketToken) || token.
IsKind
(SyntaxKind.CommaToken))
1146
if (token.
IsKind
(SyntaxKind.DelegateKeyword) &&
1161
if (token.
IsKind
(SyntaxKind.OperatorKeyword))
1163
if (token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.ImplicitKeyword) ||
1164
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.ExplicitKeyword))
1184
if (token.
IsKind
(SyntaxKind.OpenParenToken) ||
1185
token.
IsKind
(SyntaxKind.OpenBracketToken) ||
1186
token.
IsKind
(SyntaxKind.CommaToken))
1251
else if (token.
IsKind
(SyntaxKind.ScopedKeyword) && token.Parent.IsKind(SyntaxKind.Parameter))
1255
else if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName && scopedIdentifierName.Parent.IsKind(SyntaxKind.Parameter))
1306
if (leftToken.
IsKind
(SyntaxKind.CloseParenToken))
1323
if (leftToken.
IsKind
(SyntaxKind.IdentifierToken))
1334
if (leftToken.
IsKind
(SyntaxKind.IdentifierToken) &&
1352
if (leftToken.
IsKind
(SyntaxKind.OpenParenToken))
1398
if (leftToken.
IsKind
(SyntaxKind.DotDotToken) && leftToken.Parent.IsKind(SyntaxKind.SlicePattern))
1406
if (leftToken.
IsKind
(SyntaxKind.ColonToken) && leftToken.Parent is (kind: SyntaxKind.NameColon or SyntaxKind.ExpressionColon) &&
1424
if (leftToken.
IsKind
(SyntaxKind.NotKeyword) && leftToken.Parent.IsKind(SyntaxKind.NotPattern))
1449
if (leftToken.
IsKind
(SyntaxKind.DotToken))
1510
binaryExpressionSyntax.OperatorToken.
IsKind
(SyntaxKind.IsKeyword) &&
1613
if (leftToken.
IsKind
(SyntaxKind.OpenParenToken) && leftToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
1769
if (token.
IsKind
(SyntaxKind.ConstKeyword) &&
1801
if (token.
IsKind
(SyntaxKind.OutKeyword) &&
1813
if (token.
IsKind
(SyntaxKind.OpenParenToken))
1816
if (previous.
IsKind
(SyntaxKind.ForKeyword) ||
1817
previous.
IsKind
(SyntaxKind.ForEachKeyword) ||
1818
previous.
IsKind
(SyntaxKind.UsingKeyword))
1826
if (token.
IsKind
(SyntaxKind.UsingKeyword) &&
1841
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.JoinKeyword) &&
1853
if (token.
IsKind
(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent.IsKind(SyntaxKind.IdentifierName) && token.Parent.Parent is VariableDeclarationSyntax or ExpressionStatementSyntax or IncompleteMemberSyntax)
1859
if (token.
IsKind
(SyntaxKind.ScopedKeyword) && token.Parent is IncompleteMemberSyntax)
1876
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
1877
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.FixedKeyword))
1893
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
1894
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.CatchKeyword))
1907
if (token.
IsKind
(SyntaxKind.IsKeyword) ||
1908
token.
IsKind
(SyntaxKind.AsKeyword))
1921
if (token.
IsKind
(SyntaxKind.NewKeyword))
1975
if (token.
IsKind
(SyntaxKind.None))
2025
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.OpenParenToken) &&
2039
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2059
if (token.
IsKind
(SyntaxKind.CaseKeyword) &&
2065
if (token.
IsKind
(SyntaxKind.EqualsToken) &&
2102
(token.
IsKind
(SyntaxKind.CommaToken) ||
2103
token.
IsKind
(SyntaxKind.OpenParenToken)))
2109
if (token.
IsKind
(SyntaxKind.ColonToken) &&
2117
if (token.
IsKind
(SyntaxKind.EqualsToken) &&
2188
if (token.
IsKind
(SyntaxKind.DotToken) ||
2189
token.
IsKind
(SyntaxKind.ColonColonToken) ||
2190
token.
IsKind
(SyntaxKind.MinusGreaterThanToken))
2197
if (token.
IsKind
(SyntaxKind.EqualsToken))
2219
if (token.
IsKind
(SyntaxKind.EqualsToken) ||
2220
token.
IsKind
(SyntaxKind.MinusEqualsToken) ||
2221
token.
IsKind
(SyntaxKind.AsteriskEqualsToken) ||
2222
token.
IsKind
(SyntaxKind.PlusEqualsToken) ||
2223
token.
IsKind
(SyntaxKind.SlashEqualsToken) ||
2224
token.
IsKind
(SyntaxKind.ExclamationEqualsToken) ||
2225
token.
IsKind
(SyntaxKind.CaretEqualsToken) ||
2226
token.
IsKind
(SyntaxKind.AmpersandEqualsToken) ||
2227
token.
IsKind
(SyntaxKind.BarEqualsToken) ||
2228
token.
IsKind
(SyntaxKind.PercentEqualsToken) ||
2229
token.
IsKind
(SyntaxKind.LessThanLessThanEqualsToken) ||
2230
token.
IsKind
(SyntaxKind.GreaterThanGreaterThanEqualsToken) ||
2231
token.
IsKind
(SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken) ||
2232
token.
IsKind
(SyntaxKind.QuestionQuestionEqualsToken))
2238
if (token.
IsKind
(SyntaxKind.OpenParenToken))
2313
if (token.
IsKind
(SyntaxKind.AsteriskToken) && semanticModel != null)
2330
tokenOnLeftOfPosition.
IsKind
(SyntaxKind.IdentifierToken))
2333
if (previousToken.
IsKind
(SyntaxKind.AsteriskToken) ||
2334
previousToken.
IsKind
(SyntaxKind.QuestionToken))
2360
if (token.
IsKind
(SyntaxKind.OpenBracketToken) ||
2361
token.
IsKind
(SyntaxKind.CommaToken))
2371
if (token.
IsKind
(SyntaxKind.DotDotToken) &&
2379
if (token.
IsKind
(SyntaxKind.QuestionToken) &&
2388
if (token.
IsKind
(SyntaxKind.ColonToken) &&
2397
if (token.
IsKind
(SyntaxKind.OpenParenToken))
2419
if (token.
IsKind
(SyntaxKind.OpenParenToken) ||
2420
token.
IsKind
(SyntaxKind.OpenBracketToken) ||
2421
token.
IsKind
(SyntaxKind.CommaToken))
2433
if (token.
IsKind
(SyntaxKind.OpenParenToken) ||
2434
token.
IsKind
(SyntaxKind.CommaToken))
2447
if (token.
IsKind
(SyntaxKind.RefKeyword) ||
2448
token.
IsKind
(SyntaxKind.InKeyword) ||
2449
token.
IsKind
(SyntaxKind.OutKeyword))
2469
if (token.
IsKind
(SyntaxKind.ColonToken) &&
2477
if (token.
IsKind
(SyntaxKind.EqualsGreaterThanToken))
2484
if (token.
IsKind
(SyntaxKind.OpenBraceToken) ||
2485
token.
IsKind
(SyntaxKind.CommaToken))
2491
if (token.Parent.IsKind(SyntaxKind.ObjectInitializerExpression) && token.
IsKind
(SyntaxKind.OpenBraceToken))
2494
if (!token.IntersectsWith(position) && token.GetNextToken().GetNextToken().
IsKind
(SyntaxKind.EqualsToken))
2521
if (token.
IsKind
(SyntaxKind.SemicolonToken) &&
2532
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2541
if (token.
IsKind
(SyntaxKind.CommaToken) &&
2551
if (token.
IsKind
(SyntaxKind.InKeyword))
2565
if (token.
IsKind
(SyntaxKind.OnKeyword) ||
2566
token.
IsKind
(SyntaxKind.EqualsKeyword))
2575
if (token.
IsKind
(SyntaxKind.WhereKeyword) &&
2583
if (token.
IsKind
(SyntaxKind.OrderByKeyword) ||
2584
token.
IsKind
(SyntaxKind.CommaToken))
2593
if (token.
IsKind
(SyntaxKind.SelectKeyword) &&
2601
if (token.
IsKind
(SyntaxKind.GroupKeyword) ||
2602
token.
IsKind
(SyntaxKind.ByKeyword))
2613
if (token.
IsKind
(SyntaxKind.ReturnKeyword))
2622
if (token.
IsKind
(SyntaxKind.ThrowKeyword))
2628
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2629
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.WhileKeyword))
2638
if (token.
IsKind
(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.UsingStatement))
2644
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2645
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.LockKeyword))
2651
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2652
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.IfKeyword))
2658
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2659
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.SwitchKeyword))
2665
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2666
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.CheckedKeyword))
2672
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2673
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.UncheckedKeyword))
2679
if (token.
IsKind
(SyntaxKind.OpenParenToken) &&
2680
token.GetPreviousToken(includeSkipped: true).
IsKind
(SyntaxKind.WhenKeyword))
2686
if (token.
IsKind
(SyntaxKind.WhenKeyword) && token.Parent.IsKind(SyntaxKind.WhenClause))
2703
if (token.
IsKind
(SyntaxKind.OpenBraceToken) || token.
IsKind
(SyntaxKind.CommaToken))
2726
if (token.
IsKind
(SyntaxKind.OpenBraceToken))
2747
if (token.
IsKind
(SyntaxKind.DotToken))
2819
if (token.
IsKind
(SyntaxKind.NumericLiteralToken))
2862
if (token.
IsKind
(SyntaxKind.IdentifierToken) &&
2946
if (token.
IsKind
(SyntaxKind.CloseBraceToken))
2974
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.CatchKeyword))
2979
if (CodeAnalysis.CSharpExtensions.
IsKind
(token, SyntaxKind.CloseParenToken) &&
2998
token.
IsKind
(SyntaxKind.ColonToken) &&
3009
if (!token.
IsKind
(SyntaxKind.DotToken))
3060
return targetToken.
IsKind
(SyntaxKind.AsteriskToken) &&
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
100
if (reference.GetSyntax().ChildTokens().Any(t => t.
IsKind
(SyntaxKind.UnsafeKeyword)))
NewLineUserSettingFormattingRule.cs (32)
83
if (previousToken.
IsKind
(SyntaxKind.CloseBraceToken)
84
&& currentToken.
IsKind
(SyntaxKind.ElseKeyword)
94
if (currentToken.
IsKind
(SyntaxKind.CatchKeyword))
103
if (currentToken.
IsKind
(SyntaxKind.FinallyKeyword))
112
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax)
121
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
130
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
148
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax)
160
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax)
169
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression))
178
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement))
187
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
197
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression))
206
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent))
226
if (previousToken.
IsKind
(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.ObjectInitializerExpression))
240
if (previousToken.
IsKind
(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
254
if (previousToken.
IsKind
(SyntaxKind.CloseBraceToken) && currentToken.
IsKind
(SyntaxKind.ElseKeyword))
268
if (currentToken.
IsKind
(SyntaxKind.CatchKeyword))
281
if (currentToken.
IsKind
(SyntaxKind.FinallyKeyword))
294
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax)
307
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
323
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
340
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
349
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax)
366
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax)
379
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression))
392
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement))
405
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) &&
419
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression))
432
if (currentToken.
IsKind
(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent))
447
if (previousToken.
IsKind
(SyntaxKind.SemicolonToken)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
350
return new RecommendedSymbols(usingDirective.StaticKeyword.
IsKind
(SyntaxKind.StaticKeyword)
Rename\CSharpRenameRewriterLanguageService.cs (11)
264
=> token.
IsKind
(SyntaxKind.GetKeyword)
268
=> token.
IsKind
(SyntaxKind.SetKeyword)
272
=> token.
IsKind
(SyntaxKind.InitKeyword)
283
token.
IsKind
(SyntaxKind.IdentifierToken) &&
383
if (!isRenameLocation && symbol is INamespaceSymbol && token.GetPreviousToken().
IsKind
(SyntaxKind.NamespaceKeyword))
402
if (isRenameLocation && token.GetPreviousToken().
IsKind
(SyntaxKind.NamespaceKeyword))
546
!token.
IsKind
(SyntaxKind.GlobalKeyword) &&
698
if (newToken.
IsKind
(SyntaxKind.StringLiteralToken))
702
else if (newToken.
IsKind
(SyntaxKind.InterpolatedStringTextToken))
711
if (newToken.
IsKind
(SyntaxKind.XmlTextLiteralToken))
715
else if (newToken.
IsKind
(SyntaxKind.IdentifierToken) && newToken.Parent.IsKind(SyntaxKind.XmlName) && newToken.ValueText == _originalText)
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
107
if (_simplifyAllDescendants && !_insideSpeculatedNode && !token.
IsKind
(SyntaxKind.None))
Simplification\Simplifiers\NameSimplifier.cs (1)
692
aliasName.Alias.Identifier.
IsKind
(SyntaxKind.GlobalKeyword);
SpacingFormattingRule.cs (2)
254
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken) &&
261
if (currentToken.
IsKind
(SyntaxKind.EndOfFileToken))
SuppressFormattingRule.cs (3)
334
Debug.Assert(!startToken.
IsKind
(SyntaxKind.None) && !endToken.
IsKind
(SyntaxKind.None));
347
if (!pragmaWarningDirectiveTrivia.DisableOrRestoreKeyword.
IsKind
(disableOrRestoreKeyword))
SyntaxTriviaExtensions.cs (1)
206
isDisable = pragmaWarning.DisableOrRestoreKeyword.
IsKind
(SyntaxKind.DisableKeyword);
TokenBasedFormattingRule.cs (7)
89
if (!currentToken.
IsKind
(SyntaxKind.SemicolonToken) &&
285
if (previousToken.
IsKind
(SyntaxKind.CloseBracketToken) &&
289
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken))
372
if (currentToken.
IsKind
(SyntaxKind.OpenBracketToken) &&
391
if (currentToken.
IsKind
(SyntaxKind.ColonToken))
451
if (currentToken.
IsKind
(SyntaxKind.QuestionToken) && currentToken.Parent.IsKind(SyntaxKind.ConditionalAccessExpression))
464
if (currentToken.
IsKind
(SyntaxKind.QuestionToken) &&
TriviaDataFactory.Analyzer.cs (1)
66
for (var currentToken = token1; !currentToken.
IsKind
(SyntaxKind.None);)
TypeDeclarationSyntaxExtensions.cs (2)
100
if (token.IsMissing || token.
IsKind
(SyntaxKind.None))
115
if (typeDeclaration.SemicolonToken.
IsKind
(SyntaxKind.SemicolonToken))
UsingsAndExternAliasesOrganizer.cs (2)
61
var directive1IsUsingStatic = using1.StaticKeyword.
IsKind
(SyntaxKind.StaticKeyword);
62
var directive2IsUsingStatic = using2.StaticKeyword.
IsKind
(SyntaxKind.StaticKeyword);
WrappingFormattingRule.cs (4)
94
if (!firstToken.
IsKind
(SyntaxKind.None) || !lastToken.
IsKind
(SyntaxKind.None))
124
if (!tokens.firstToken.
IsKind
(SyntaxKind.None) || !tokens.lastToken.
IsKind
(SyntaxKind.None))
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Formatting\FormattingTriviaTests.cs (1)
1787
.Where(tr => tr.
IsKind
(SyntaxKind.EndOfDirectiveToken)), (o, r) => o.WithTrailingTrivia(o.LeadingTrivia.Add(SyntaxFactory.ElasticEndOfLine(newLine)))
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (1)
Snippets\CSharpSnippets\SnippetCommandHandler.cs (1)
114
return !(trivia.IsKind(SyntaxKind.MultiLineCommentTrivia) || trivia.IsKind(SyntaxKind.SingleLineCommentTrivia) || token.
IsKind
(SyntaxKind.StringLiteralToken));
Microsoft.VisualStudio.LanguageServices.CSharp (29)
LanguageService\CSharpHelpContextService.cs (29)
113
if (token.
IsKind
(SyntaxKind.InterpolatedStringStartToken) ||
114
token.
IsKind
(SyntaxKind.InterpolatedStringEndToken) ||
115
token.
IsKind
(SyntaxKind.InterpolatedRawStringEndToken) ||
116
token.
IsKind
(SyntaxKind.InterpolatedStringTextToken) ||
117
token.
IsKind
(SyntaxKind.InterpolatedSingleLineRawStringStartToken) ||
118
token.
IsKind
(SyntaxKind.InterpolatedMultiLineRawStringStartToken))
130
if (token.
IsKind
(SyntaxKind.InterpolatedVerbatimStringStartToken))
136
if (token.
IsKind
(SyntaxKind.Utf8StringLiteralToken) ||
137
token.
IsKind
(SyntaxKind.Utf8SingleLineRawStringLiteralToken) ||
138
token.
IsKind
(SyntaxKind.Utf8MultiLineRawStringLiteralToken))
144
if (token.
IsKind
(SyntaxKind.SingleLineRawStringLiteralToken) ||
145
token.
IsKind
(SyntaxKind.MultiLineRawStringLiteralToken))
166
else if (token.Parent is NullableTypeSyntax && token.
IsKind
(SyntaxKind.QuestionToken))
216
if (token.
IsKind
(SyntaxKind.ExclamationToken) &&
230
if (token.
IsKind
(SyntaxKind.ColonColonToken))
236
if (token.
IsKind
(SyntaxKind.ColonToken) && token.Parent is NameColonSyntax)
242
if (token.
IsKind
(SyntaxKind.EqualsToken))
315
if (token.
IsKind
(SyntaxKind.QuestionToken) && token.Parent is ConditionalExpressionSyntax)
321
if (token.
IsKind
(SyntaxKind.EqualsGreaterThanToken))
348
if (token.
IsKind
(SyntaxKind.EndOfDirectiveToken) && token.GetAncestor<RegionDirectiveTriviaSyntax>() != null)
423
text = token.GetNextToken().
IsKind
(SyntaxKind.StaticKeyword)
441
return CSharpSyntaxFacts.Instance.GetModifiers(token.Parent).Any(t => t.
IsKind
(kind));
447
if (token.
IsKind
(SyntaxKind.InKeyword))
462
if (token.
IsKind
(SyntaxKind.DefaultKeyword))
483
if (token.
IsKind
(SyntaxKind.ClassKeyword) && token.Parent is ClassOrStructConstraintSyntax)
489
if (token.
IsKind
(SyntaxKind.StructKeyword) && token.Parent is ClassOrStructConstraintSyntax)
495
if (token.
IsKind
(SyntaxKind.UsingKeyword) && token.Parent is UsingStatementSyntax or LocalDeclarationStatementSyntax)
501
if (token.
IsKind
(SyntaxKind.SwitchKeyword) && token.Parent is SwitchExpressionSyntax)
513
if (token.ValueText == "var" && token.
IsKind
(SyntaxKind.IdentifierToken) &&