625 references to IsKind
Microsoft.AspNetCore.App.Analyzers (13)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (12)
107if (token.IsKind(SyntaxKind.QuestionToken) || token.IsKind(SyntaxKind.GreaterThanToken)) 165if (previous.IsKind(SyntaxKind.CommaToken) || 166previous.IsKind(SyntaxKind.OpenParenToken) || 167previous.IsKind(SyntaxKind.OutKeyword) || 168previous.IsKind(SyntaxKind.InKeyword) || 169previous.IsKind(SyntaxKind.RefKeyword) || 170previous.IsKind(SyntaxKind.ParamsKeyword) || 171(previous.IsKind(SyntaxKind.CloseBracketToken) && previous.GetRequiredParent().FirstAncestorOrSelf<AttributeListSyntax>() != null) || 172(previous.IsKind(SyntaxKind.LessThanToken) && previous.GetRequiredParent().FirstAncestorOrSelf<GenericNameSyntax>() != null)) 290return SyntaxFacts.IsPredefinedType(token.Kind()) || token.IsKind(SyntaxKind.IdentifierToken); 549Debug.Assert(token.IsKind(SyntaxKind.StringLiteralToken));
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
401Debug.Assert(token.IsKind(SyntaxKind.StringLiteralToken));
Microsoft.AspNetCore.App.Analyzers.Test (2)
Infrastructure\AmbiguousRoutePatternComparerTests.cs (1)
83Assert.True(token.IsKind(SyntaxKind.StringLiteralToken));
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
37Assert.True(token.IsKind(SyntaxKind.StringLiteralToken));
Microsoft.AspNetCore.App.CodeFixes (2)
Dependencies\ExtensionMethodsCompletionProvider.cs (2)
114var isIdentifierToken = token.IsKind(SyntaxKind.IdentifierName) || token.IsKind(SyntaxKind.IdentifierToken);
Microsoft.AspNetCore.Components.Analyzers (4)
ComponentParametersShouldBePublicCodeFixProvider.cs (4)
72if (modifier.IsKind(SyntaxKind.PrivateKeyword) || 73modifier.IsKind(SyntaxKind.ProtectedKeyword) || 74modifier.IsKind(SyntaxKind.InternalKeyword) || 77modifier.IsKind(SyntaxKind.PublicKeyword))
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
ComponentParametersShouldBePublicCodeFixProvider.cs (4)
72if (modifier.IsKind(SyntaxKind.PrivateKeyword) || 73modifier.IsKind(SyntaxKind.ProtectedKeyword) || 74modifier.IsKind(SyntaxKind.InternalKeyword) || 77modifier.IsKind(SyntaxKind.PublicKeyword))
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
124if (modifier.IsKind(SyntaxKind.PartialKeyword))
HubServerProxyGenerator.Parser.cs (1)
114if (modifier.IsKind(SyntaxKind.PartialKeyword))
Microsoft.CodeAnalysis.CSharp (80)
Binder\Binder_Constraints.cs (1)
151if (questionToken.IsKind(SyntaxKind.QuestionToken))
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (1)
103if (endGreaterThanToken.GetNextToken() is SyntaxToken newLineToken && newLineToken.IsKind(SyntaxKind.XmlTextLiteralNewLineToken))
CSharpExtensions.cs (1)
244return token.IsKind(SyntaxKind.IdentifierToken) && token.Text.Length > 0 && token.Text[0] == '@';
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
294if (token.IsKind(SyntaxKind.IdentifierToken))
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2825foreach (var m in modifiers) { if (m.IsKind(modifier)) return true; };
Symbols\Source\SourceMemberFieldSymbol.cs (1)
198if (modifier.IsKind(SyntaxKind.FixedKeyword))
Syntax\SyntaxFactory.cs (3)
1206if (rewrittenToken.IsKind(SyntaxKind.LessThanToken) && string.Equals("<", rewrittenToken.Text, StringComparison.Ordinal)) 1209if (rewrittenToken.IsKind(SyntaxKind.GreaterThanToken) && string.Equals(">", rewrittenToken.Text, StringComparison.Ordinal)) 2381!token.IsKind(SyntaxKind.SemicolonToken))
Syntax\SyntaxNormalizer.cs (71)
174return !token.IsKind(SyntaxKind.EndOfFileToken); 184if (currentToken.IsKind(SyntaxKind.EndOfDirectiveToken)) 200if (nextToken.IsKind(SyntaxKind.CloseBraceToken)) 235if (nextToken.IsKind(SyntaxKind.OpenBraceToken) && 279if ((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))) 318Debug.Assert(openBraceToken.IsKind(SyntaxKind.OpenBraceToken)); 335Debug.Assert(closeBraceToken.IsKind(SyntaxKind.CloseBraceToken)); 411=> currentToken.IsKind(SyntaxKind.CloseBraceToken) && 483var tokenIsOpenBrace = token.IsKind(SyntaxKind.OpenBraceToken); 484var nextIsOpenBrace = next.IsKind(SyntaxKind.OpenBraceToken); 485var tokenIsCloseBrace = token.IsKind(SyntaxKind.CloseBraceToken); 486var nextIsCloseBrace = next.IsKind(SyntaxKind.CloseBraceToken); 543var tokenIsOpenParen = token.IsKind(SyntaxKind.OpenParenToken); 544var nextIsOpenParen = next.IsKind(SyntaxKind.OpenParenToken); 545var tokenIsCloseParen = token.IsKind(SyntaxKind.CloseParenToken); 546var nextIsCloseParen = next.IsKind(SyntaxKind.CloseParenToken); 600if (next.IsKind(SyntaxKind.OpenBracketToken)) 606if (token.IsKind(SyntaxKind.OpenBracketToken)) 626return !next.IsKind(SyntaxKind.SemicolonToken); 649if (token.IsKind(SyntaxKind.GreaterThanToken) && token.Parent.IsKind(SyntaxKind.TypeArgumentList)) 657if (token.IsKind(SyntaxKind.GreaterThanToken) && 664if (token.IsKind(SyntaxKind.CommaToken) && 665!next.IsKind(SyntaxKind.CommaToken) && 677if (next.IsKind(SyntaxKind.SwitchKeyword) && next.Parent is SwitchExpressionSyntax) 682if (token.IsKind(SyntaxKind.QuestionToken)) 693if (token.IsKind(SyntaxKind.ColonToken)) 699if (next.IsKind(SyntaxKind.ColonToken)) 709if (token.IsKind(SyntaxKind.CloseBracketToken) && IsWord(next.Kind())) 715if (token.IsKind(SyntaxKind.CloseParenToken) && IsWord(next.Kind()) && token.Parent.IsKind(SyntaxKind.TupleType) == true) 720if ((next.IsKind(SyntaxKind.QuestionToken) || next.IsKind(SyntaxKind.ColonToken)) 726if (token.IsKind(SyntaxKind.EqualsToken)) 731if (next.IsKind(SyntaxKind.EqualsToken)) 741if (next.IsKind(SyntaxKind.AsteriskToken) && token.IsKind(SyntaxKind.DelegateKeyword)) 747if (token.IsKind(SyntaxKind.AsteriskToken) && next.Parent.IsKind(SyntaxKind.FunctionPointerCallingConvention)) 759if (next.Parent.IsKind(SyntaxKind.FunctionPointerParameterList) && next.IsKind(SyntaxKind.LessThanToken)) 779next.IsKind(SyntaxKind.OpenBracketToken)) 787if (next.IsKind(SyntaxKind.IdentifierToken)) 789if (token.IsKind(SyntaxKind.OpenBracketToken)) 795else if (token.IsKind(SyntaxKind.CommaToken)) 803if (next.IsKind(SyntaxKind.CommaToken)) 810if (next.IsKind(SyntaxKind.CloseBracketToken)) 818if (token.IsKind(SyntaxKind.LessThanToken) && token.Parent.IsKind(SyntaxKind.FunctionPointerParameterList)) 825if (next.IsKind(SyntaxKind.GreaterThanToken) && next.Parent.IsKind(SyntaxKind.FunctionPointerParameterList)) 830if (token.IsKind(SyntaxKind.EqualsGreaterThanToken) || next.IsKind(SyntaxKind.EqualsGreaterThanToken)) 842if (next.IsKind(SyntaxKind.AsteriskToken) && next.Parent is PointerTypeSyntax) 848if (token.IsKind(SyntaxKind.AsteriskToken) && token.Parent is PointerTypeSyntax && 849(next.IsKind(SyntaxKind.IdentifierToken) || next.Parent.IsKind(SyntaxKind.IndexerDeclaration))) 864next.IsKind(SyntaxKind.OpenBraceToken)) 870token.IsKind(SyntaxKind.OpenBraceToken)) 876next.IsKind(SyntaxKind.CloseBraceToken)) 891if (!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 (89)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
99if (!token.IsKind(SyntaxKind.CloseBraceToken)) 103if (!nextToken.IsKind(SyntaxKind.CloseBraceToken))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (8)
122if (!directive.TargetToken.IsKind(SyntaxKind.None)) 130if (directive.TargetToken.IsKind(SyntaxKind.AnnotationsKeyword)) 134else if (directive.TargetToken.IsKind(SyntaxKind.WarningsKeyword)) 143if (directive.SettingToken.IsKind(SyntaxKind.EnableKeyword)) 147else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 157if (directive.SettingToken.IsKind(SyntaxKind.EnableKeyword)) 161else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 165else if (directive.SettingToken.IsKind(SyntaxKind.RestoreKeyword))
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
236if (element.Identifier.IsKind(SyntaxKind.None))
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
353&& predefinedType.Keyword.IsKind(SyntaxKind.ObjectKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
50=> token.IsKind(SyntaxKind.OpenBraceToken) && token.Parent.IsKind(SyntaxKind.AccessorList);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (2)
94(targetToken.IsKind(SyntaxKind.DotDotToken) && position == targetToken.SpanStart + 1) || 549if (token.IsKind(SyntaxKind.HashToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
206isDisable = pragmaWarning.DisableOrRestoreKeyword.IsKind(SyntaxKind.DisableKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (2)
15predefinedType.Keyword.IsKind(SyntaxKind.VoidKeyword); 20((IdentifierNameSyntax)typeSyntax).Identifier.IsKind(SyntaxKind.PartialKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
66for (var currentToken = token1; !currentToken.IsKind(SyntaxKind.None);)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (8)
56if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.None) || 58bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.None)) 63if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.OpenBraceToken)) 65return bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.CloseBraceToken); 68if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.OpenBracketToken)) 70return bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.CloseBracketToken); 277return token.IsKind(SyntaxKind.EqualsToken) && 538return currentToken.IsKind(SyntaxKind.CommaToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (5)
115currentToken.IsKind(SyntaxKind.WhereKeyword) && 130firstTokenAfterTypeConstraint.IsKind(SyntaxKind.WhereKeyword) && 142currentToken.IsKind(SyntaxKind.OpenBraceToken) && 293if (previousToken.IsKind(SyntaxKind.CloseBracketToken) && 340if (!currentToken.IsKind(SyntaxKind.EndOfFileToken) && !(currentToken.Parent is AttributeListSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (32)
83if (previousToken.IsKind(SyntaxKind.CloseBraceToken) 84&& currentToken.IsKind(SyntaxKind.ElseKeyword) 94if (currentToken.IsKind(SyntaxKind.CatchKeyword)) 103if (currentToken.IsKind(SyntaxKind.FinallyKeyword)) 112if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax) 121if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression)) 130if (currentToken.IsKind(SyntaxKind.OpenBraceToken)) 168if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax) 180if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax) 189if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression)) 198if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement)) 207if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 217if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression)) 226if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent)) 246if (previousToken.IsKind(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.ObjectInitializerExpression)) 260if (previousToken.IsKind(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression)) 274if (previousToken.IsKind(SyntaxKind.CloseBraceToken) && currentToken.IsKind(SyntaxKind.ElseKeyword)) 288if (currentToken.IsKind(SyntaxKind.CatchKeyword)) 301if (currentToken.IsKind(SyntaxKind.FinallyKeyword)) 314if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax) 327if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression)) 343if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 360if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 369if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax) 386if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax) 399if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression)) 412if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement)) 425if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 439if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression)) 452if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent)) 467if (previousToken.IsKind(SyntaxKind.SemicolonToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
252if (currentToken.IsKind(SyntaxKind.OpenBracketToken) && 259if (currentToken.IsKind(SyntaxKind.EndOfFileToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (3)
334Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None)); 347if (!pragmaWarningDirectiveTrivia.DisableOrRestoreKeyword.IsKind(disableOrRestoreKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (7)
89if (!currentToken.IsKind(SyntaxKind.SemicolonToken) && 287if (previousToken.IsKind(SyntaxKind.CloseBracketToken) && 291if (currentToken.IsKind(SyntaxKind.OpenBracketToken)) 374if (currentToken.IsKind(SyntaxKind.OpenBracketToken) && 393if (currentToken.IsKind(SyntaxKind.ColonToken)) 453if (currentToken.IsKind(SyntaxKind.QuestionToken) && currentToken.Parent.IsKind(SyntaxKind.ConditionalAccessExpression)) 466if (currentToken.IsKind(SyntaxKind.QuestionToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (4)
95if (!firstToken.IsKind(SyntaxKind.None) || !lastToken.IsKind(SyntaxKind.None)) 125if (!tokens.firstToken.IsKind(SyntaxKind.None) || !tokens.lastToken.IsKind(SyntaxKind.None))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (4)
73return endToken.IsKind(SyntaxKind.CloseBraceToken) && 95if (token.IsKind(SyntaxKind.OpenBraceToken) && 100if (nextToken.IsKind(SyntaxKind.CloseBraceToken)) 109if (token.IsKind(SyntaxKind.OpenBraceToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
346return token.IsKind(SyntaxKind.InKeyword) ? queryInfo.CastInfo.GetBestOrAllSymbols() : queryInfo.OperationInfo.GetBestOrAllSymbols(); 358if (token.IsKind(SyntaxKind.CommaToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
348return previousToken.IsKind(SyntaxKind.OpenBraceToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
61var directive1IsUsingStatic = using1.StaticKeyword.IsKind(SyntaxKind.StaticKeyword); 62var directive2IsUsingStatic = using2.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (55)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
228if (token.IsKind(SyntaxKind.HashToken) && token.Parent!.Kind() is not (SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
735if (prevToken.IsKind(SyntaxKind.XmlTextLiteralNewLineToken))
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (2)
69if (!token.IsKind(SyntaxKind.CloseBraceToken)) 76if (!firstBrace.IsKind(SyntaxKind.CloseBraceToken))
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
210if (anonymousFunction.AsyncKeyword.IsKind(SyntaxKind.AsyncKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
461ComputePositionAndTriviaForRemoveAttributeFromAttributeList(attributeToRemove, (SyntaxToken t) => t.IsKind(SyntaxKind.CommaToken), out positionOfRemovedNode, out trivia);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
502if (targetToken.IsKind(SyntaxKind.InKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
25if (token.IsKind(SyntaxKind.UsingKeyword)) 47if (token.IsKind(SyntaxKind.UnsafeKeyword) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (38)
165if (token.IsKind(SyntaxKind.OpenBraceToken)) 176if (token.IsKind(SyntaxKind.SemicolonToken)) 193if (token.IsKind(SyntaxKind.CloseBraceToken)) 219if (token.IsKind(SyntaxKind.CloseBracketToken) && 425if (token.IsKind(SyntaxKind.None)) 439if (token.IsKind(SyntaxKind.OpenBraceToken) && token.Parent is NamespaceDeclarationSyntax or TypeDeclarationSyntax) 454if (token.IsKind(SyntaxKind.SemicolonToken)) 476if (token.IsKind(SyntaxKind.CloseBraceToken)) 506if (token.IsKind(SyntaxKind.CloseBracketToken) && 850if (token.IsKind(SyntaxKind.ColonToken) && 851token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IdentifierToken) && 852token.GetPreviousToken(includeSkipped: true).GetPreviousToken().IsKind(SyntaxKind.WhereKeyword)) 876if (token.IsKind(SyntaxKind.CommaToken) && 1170if (token.IsKind(SyntaxKind.DelegateKeyword) && 1185if (token.IsKind(SyntaxKind.OperatorKeyword) && 1265else if (token.IsKind(SyntaxKind.ScopedKeyword) && token.Parent.IsKind(SyntaxKind.Parameter)) 1269else if (token.IsKind(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName && scopedIdentifierName.Parent.IsKind(SyntaxKind.Parameter)) 1320if (leftToken.IsKind(SyntaxKind.CloseParenToken)) 1337if (leftToken.IsKind(SyntaxKind.IdentifierToken)) 1348if (leftToken.IsKind(SyntaxKind.IdentifierToken) && 1366if (leftToken.IsKind(SyntaxKind.OpenParenToken)) 1412if (leftToken.IsKind(SyntaxKind.DotDotToken) && leftToken.Parent.IsKind(SyntaxKind.SlicePattern)) 1420if (leftToken.IsKind(SyntaxKind.ColonToken) && leftToken.Parent is (kind: SyntaxKind.NameColon or SyntaxKind.ExpressionColon) && 1438if (leftToken.IsKind(SyntaxKind.NotKeyword) && leftToken.Parent.IsKind(SyntaxKind.NotPattern)) 1464if (leftToken.IsKind(SyntaxKind.DotToken) || 1465leftToken.IsKind(SyntaxKind.MinusGreaterThanToken)) 1526binaryExpressionSyntax.OperatorToken.IsKind(SyntaxKind.IsKeyword) && 1888if (token.IsKind(SyntaxKind.OpenParenToken) && 1889token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.FixedKeyword)) 2048if (token.IsKind(SyntaxKind.OpenParenToken) && 2340tokenOnLeftOfPosition.IsKind(SyntaxKind.IdentifierToken)) 2821if (token.IsKind(SyntaxKind.NumericLiteralToken)) 2864if (token.IsKind(SyntaxKind.IdentifierToken) && 2948if (token.IsKind(SyntaxKind.CloseBraceToken)) 2974if (CodeAnalysis.CSharpExtensions.IsKind(token, SyntaxKind.CatchKeyword)) 2979if (CodeAnalysis.CSharpExtensions.IsKind(token, SyntaxKind.CloseParenToken) && 2995targetToken.IsKind(SyntaxKind.ColonToken) && 3057return targetToken.IsKind(SyntaxKind.AsteriskToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
101if (reference.GetSyntax().ChildTokens().Any(t => t.IsKind(SyntaxKind.UnsafeKeyword)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (2)
100if (token.IsMissing || token.IsKind(SyntaxKind.None)) 118if (addedBraces && typeDeclaration.SemicolonToken.IsKind(SyntaxKind.SemicolonToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
80if (token.IsKind(SyntaxKind.None) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (2)
84if (token.IsKind(SyntaxKind.MultiLineRawStringLiteralToken)) 179(token.IsKind(SyntaxKind.CloseBraceToken) && token.Parent.IsKind(SyntaxKind.Interpolation)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
342if (previousToken.IsKind(SyntaxKind.CommaToken)) 1968if (previousToken.HasValue && (previousToken.Value != yieldStatement.ReturnOrBreakKeyword || yieldStatement.ReturnOrBreakKeyword.IsKind(SyntaxKind.BreakKeyword)))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
629if (syntaxToken.IsMissing || syntaxToken.IsKind(SyntaxKind.None))
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
383if (nextToken.IsKind(SyntaxKind.SemicolonToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3418if (position == endToken.SpanStart && !endToken.GetPreviousToken().IsKind(SyntaxKind.None))
Microsoft.CodeAnalysis.CSharp.Features (107)
BraceCompletion\BracketBraceCompletionService.cs (3)
31protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.OpenBracketToken); 33protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.CloseBracketToken); 49if (currentToken.IsKind(SyntaxKind.OpenBracketToken) && currentToken.Parent.IsKind(SyntaxKind.ListPattern))
BraceCompletion\CharLiteralBraceCompletionService.cs (2)
25protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.CharacterLiteralToken); 27protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.CharacterLiteralToken);
BraceCompletion\CurlyBraceCompletionService.cs (3)
48=> token.IsKind(SyntaxKind.OpenBraceToken) && !token.Parent.IsKind(SyntaxKind.Interpolation); 51=> token.IsKind(SyntaxKind.CloseBraceToken); 126if (!currentToken.IsKind(SyntaxKind.OpenBraceToken))
BraceCompletion\InterpolatedStringBraceCompletionService.cs (1)
40=> rightToken.IsKind(SyntaxKind.InterpolatedStringEndToken);
BraceCompletion\InterpolationBraceCompletionService.cs (2)
42=> token.IsKind(SyntaxKind.OpenBraceToken) && token.Parent.IsKind(SyntaxKind.Interpolation); 45=> token.IsKind(SyntaxKind.CloseBraceToken);
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (2)
32=> token.IsKind(SyntaxKind.LessThanToken); 35=> token.IsKind(SyntaxKind.GreaterThanToken);
BraceCompletion\ParenthesisBraceCompletionService.cs (2)
26protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.OpenParenToken); 28protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.CloseParenToken);
BraceCompletion\StringLiteralBraceCompletionService.cs (4)
50protected override bool IsValidOpeningBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.StringLiteralToken); 52protected override bool IsValidClosingBraceToken(SyntaxToken token) => token.IsKind(SyntaxKind.StringLiteralToken); 72if (token.IsKind(SyntaxKind.StringLiteralToken) && 95while (!token.IsKind(SyntaxKind.None) && !token.TrailingTrivia.Contains(t => t.IsEndOfLine()))
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (12)
100if (firstToken.IsKind(SyntaxKind.None)) 121if (firstNonDirectiveToken.IsKind(SyntaxKind.None) && firstDirective is null) 138if (originalNode.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 144if (originalNode.SettingToken.IsKind(SyntaxKind.RestoreKeyword)) 149if (originalNode.SettingToken.IsKind(SyntaxKind.EnableKeyword)) 176else if (leadingDirective.SettingToken.IsKind(SyntaxKind.RestoreKeyword) && leadingDirective.TargetToken.IsKind(SyntaxKind.None)) 220if (firstToken.IsKind(SyntaxKind.None)) 225if (firstToken.IsKind(SyntaxKind.HashToken) && firstToken.Parent.IsKind(SyntaxKind.RegionDirectiveTrivia)) 230if (nextToken.IsKind(SyntaxKind.HashToken) && nextToken.Parent.IsKind(SyntaxKind.EndRegionDirectiveTrivia)) 245&& nullableDirective.TargetToken.IsKind(SyntaxKind.None)) 248if (firstSemanticToken.IsKind(SyntaxKind.None) || firstSemanticToken.SpanStart > nullableDirective.Span.End)
Completion\CompletionProviders\CrefCompletionProvider.cs (4)
140if (token.IsKind(SyntaxKind.OpenParenToken) && 146if (token.IsKind(SyntaxKind.OpenBracketToken) && 160return token.IsKind(SyntaxKind.DotToken) 287if (symbol is INamespaceOrTypeSymbol && token.IsKind(SyntaxKind.DotToken))
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
113if (token.IsKind(SyntaxKind.NewKeyword) && token.Parent.IsKind(SyntaxKind.ObjectCreationExpression))
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (6)
138if (token.IsKind(SyntaxKind.IdentifierToken) && 226if (!IsPossibleTypeToken(token) && !token.IsKind(SyntaxKind.CommaToken)) 237if (token.IsKind(SyntaxKind.CommaToken) && token.Parent != target) 248if (!token.IsKind(SyntaxKind.CommaToken) && token != typeSyntax.GetLastToken()) 346var possibleDeclarationComputer = token.IsKind(SyntaxKind.CommaToken) 366if (token.IsKind(SyntaxKind.QuestionToken) &&
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
78if (targetToken.IsKind(SyntaxKind.GreaterThanToken) && potentialTypeNode is TypeArgumentListSyntax typeArgumentList)
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
40if (token.IsKind(SyntaxKind.None) || token.IsMissing)
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
40if (token.IsKind(SyntaxKind.None) || token.IsMissing)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
135return !syntaxToken.IsKind(SyntaxKind.None) 136&& !touchingToken.IsKind(SyntaxKind.None)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (2)
75if (token.IsKind(SyntaxKind.OpenParenToken)) 83if (token.IsKind(SyntaxKind.CommaToken) && token.Parent is TupleExpressionSyntax tupleExpr)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (3)
215if (token.IsKind(SyntaxKind.XmlTextLiteralToken) && string.IsNullOrWhiteSpace(token.Text)) 231if (token.IsKind(SyntaxKind.IdentifierToken) && token.Parent.IsKind(SyntaxKind.XmlName)) 299else if (token.IsKind(SyntaxKind.XmlTextLiteralToken) &&
Completion\KeywordRecommenders\WhereKeywordRecommender.cs (1)
107if (token.IsKind(SyntaxKind.DotToken))
Debugging\BreakpointResolver.cs (1)
73if (token.IsKind(SyntaxKind.SemicolonToken))
Debugging\DataTipInfoGetter.cs (1)
35return token.IsKind(SyntaxKind.IdentifierToken)
EditAndContinue\BreakpointSpans.cs (1)
770=> token2.IsKind(SyntaxKind.None) || token2.IsMissing ? token1 : token2;
EditAndContinue\SyntaxComparer.cs (4)
840if (leftUsing.GlobalKeyword.IsKind(SyntaxKind.None) != rightUsing.GlobalKeyword.IsKind(SyntaxKind.None)) 844if (leftUsing.UnsafeKeyword.IsKind(SyntaxKind.None) != rightUsing.UnsafeKeyword.IsKind(SyntaxKind.None))
EditAndContinue\SyntaxUtilities.cs (1)
211return anonymousFunction.AsyncKeyword.IsKind(SyntaxKind.AsyncKeyword);
GenerateType\CSharpGenerateTypeService.cs (5)
231!token.IsKind(SyntaxKind.DotToken)) 247if (token.IsKind(SyntaxKind.DotToken) && 267nextToken.IsKind(SyntaxKind.DotToken)) 285if (nextToken.IsKind(SyntaxKind.DotToken)) 317if (nextToken.IsKind(SyntaxKind.DotToken))
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
42if (token.GetPreviousToken().IsKind(SyntaxKind.YieldKeyword))
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
75var end = !gotoStatement.CaseOrDefaultKeyword.IsKind(SyntaxKind.None)
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
55=> token.IsKind(SyntaxKind.EndOfDirectiveToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
38if (token.IsKind(SyntaxKind.EqualsGreaterThanToken) 45else if (token.IsKind(SyntaxKind.DelegateKeyword) && token.Parent.IsKind(SyntaxKind.AnonymousMethodExpression)) 71if (token.IsKind(SyntaxKind.DotToken) &&
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
60return !token.IsKind(SyntaxKind.None) &&
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (3)
286return !token.IsKind(SyntaxKind.None) && 335return !token.IsKind(SyntaxKind.None) && 370return !token.IsKind(SyntaxKind.None) &&
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
63return !token.IsKind(SyntaxKind.None) &&
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
48=> !token.IsKind(SyntaxKind.None) &&
SignatureHelp\SignatureHelpUtilities.cs (3)
103if (token.IsKind(SyntaxKind.OpenParenToken) && 130if (token.IsKind(SyntaxKind.CommaToken) && token.Parent is TupleExpressionSyntax && token.GetAncestor<TSyntaxNode>() != null) 135return !token.IsKind(SyntaxKind.None) &&
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
227=> token.IsKind(SyntaxKind.OpenParenToken) && token.Parent is ParenthesizedExpressionSyntax;
SplitStringLiteral\SimpleStringSplitter.cs (1)
33return _token.IsKind(SyntaxKind.Utf8StringLiteralToken) && CursorPosition >= _token.Span.End - "u8".Length;
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
99if (!token.IsKind(SyntaxKind.CloseBraceToken)) 103if (!nextToken.IsKind(SyntaxKind.CloseBraceToken))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (8)
122if (!directive.TargetToken.IsKind(SyntaxKind.None)) 130if (directive.TargetToken.IsKind(SyntaxKind.AnnotationsKeyword)) 134else if (directive.TargetToken.IsKind(SyntaxKind.WarningsKeyword)) 143if (directive.SettingToken.IsKind(SyntaxKind.EnableKeyword)) 147else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 157if (directive.SettingToken.IsKind(SyntaxKind.EnableKeyword)) 161else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 165else if (directive.SettingToken.IsKind(SyntaxKind.RestoreKeyword))
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
236if (element.Identifier.IsKind(SyntaxKind.None))
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
353&& predefinedType.Keyword.IsKind(SyntaxKind.ObjectKeyword)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
228if (token.IsKind(SyntaxKind.HashToken) && token.Parent!.Kind() is not (SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
735if (prevToken.IsKind(SyntaxKind.XmlTextLiteralNewLineToken))
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (2)
69if (!token.IsKind(SyntaxKind.CloseBraceToken)) 76if (!firstBrace.IsKind(SyntaxKind.CloseBraceToken))
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
210if (anonymousFunction.AsyncKeyword.IsKind(SyntaxKind.AsyncKeyword))
Structure\CSharpStructureHelpers.cs (2)
237if (startToken.IsKind(SyntaxKind.None) || endToken.IsKind(SyntaxKind.None))
Structure\Providers\BlockSyntaxStructureProvider.cs (1)
166if (previousToken.IsKind(SyntaxKind.None))
UseAutoProperty\SingleLinePropertyFormattingRule.cs (4)
16if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AccessorList)) 19if (previousToken.IsKind(SyntaxKind.OpenBraceToken) && previousToken.Parent.IsKind(SyntaxKind.AccessorList)) 22if (currentToken.IsKind(SyntaxKind.CloseBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AccessorList)) 25if (previousToken.IsKind(SyntaxKind.SemicolonToken) && currentToken.Parent is AccessorDeclarationSyntax)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\UnsafeTests.cs (2)
8345foreach (var nullSyntax in tree.GetCompilationUnitRoot().DescendantTokens().Where(token => token.IsKind(SyntaxKind.NullKeyword))) 8381foreach (var declarationSyntax in tree.GetCompilationUnitRoot().DescendantNodes().OfType<VariableDeclarationSyntax>().Where(syntax => syntax.GetFirstToken().IsKind(SyntaxKind.VoidKeyword)))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxAnnotationTests.cs (3)
693if (!token.IsKind(SyntaxKind.None)) 734if (token.IsKind(SyntaxKind.None)) 834if (token.IsKind(SyntaxKind.None))
Syntax\SyntaxNodeTests.cs (1)
2241var tokens = expr.DescendantTokens().Where(t => t.IsKind(SyntaxKind.IdentifierToken)).ToList();
Microsoft.CodeAnalysis.CSharp.Workspaces (218)
Classification\ClassificationHelpers.cs (3)
34else if (SyntaxFacts.IsKeywordKind(token.Kind()) || token.IsKind(SyntaxKind.DiscardDesignation)) 177&& interpolatedString.StringStartToken.IsKind(SyntaxKind.InterpolatedVerbatimStringStartToken); 188&& interpolatedString.StringStartToken.IsKind(SyntaxKind.InterpolatedVerbatimStringStartToken);
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
138name.Identifier.IsKind(SyntaxKind.GlobalKeyword);
CodeGeneration\CSharpSyntaxGenerator.cs (2)
1027=> list.Target?.Identifier.IsKind(SyntaxKind.ReturnKeyword) ?? false; 1999=> type is PredefinedTypeSyntax pd && pd.Keyword.IsKind(SyntaxKind.VoidKeyword) ? null : type;
Formatting\CSharpSyntaxFormattingService.cs (3)
130(token.IsKind(SyntaxKind.CloseBraceToken) && OnlySmartIndentCloseBrace(indentationOptions.AutoFormattingOptions)) || 131(token.IsKind(SyntaxKind.OpenBraceToken) && OnlySmartIndentOpenBrace(indentationOptions.AutoFormattingOptions)); 288if (endToken.IsKind(SyntaxKind.OpenBraceToken))
Rename\CSharpRenameRewriterLanguageService.cs (11)
261=> token.IsKind(SyntaxKind.GetKeyword) 265=> token.IsKind(SyntaxKind.SetKeyword) 269=> token.IsKind(SyntaxKind.InitKeyword) 280token.IsKind(SyntaxKind.IdentifierToken) && 380if (!isRenameLocation && symbol is INamespaceSymbol && token.GetPreviousToken().IsKind(SyntaxKind.NamespaceKeyword)) 399if (isRenameLocation && token.GetPreviousToken().IsKind(SyntaxKind.NamespaceKeyword)) 543!token.IsKind(SyntaxKind.GlobalKeyword) && 695if (newToken.IsKind(SyntaxKind.StringLiteralToken)) 699else if (newToken.IsKind(SyntaxKind.InterpolatedStringTextToken)) 708if (newToken.IsKind(SyntaxKind.XmlTextLiteralToken)) 712else if (newToken.IsKind(SyntaxKind.IdentifierToken) && newToken.Parent.IsKind(SyntaxKind.XmlName) && newToken.ValueText == _originalText)
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
106if (_simplifyAllDescendants && !_insideSpeculatedNode && !token.IsKind(SyntaxKind.None))
Simplification\Simplifiers\NameSimplifier.cs (1)
712aliasName.Alias.Identifier.IsKind(SyntaxKind.GlobalKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
50=> token.IsKind(SyntaxKind.OpenBraceToken) && token.Parent.IsKind(SyntaxKind.AccessorList);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (2)
94(targetToken.IsKind(SyntaxKind.DotDotToken) && position == targetToken.SpanStart + 1) || 549if (token.IsKind(SyntaxKind.HashToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
206isDisable = pragmaWarning.DisableOrRestoreKeyword.IsKind(SyntaxKind.DisableKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (2)
15predefinedType.Keyword.IsKind(SyntaxKind.VoidKeyword); 20((IdentifierNameSyntax)typeSyntax).Identifier.IsKind(SyntaxKind.PartialKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
66for (var currentToken = token1; !currentToken.IsKind(SyntaxKind.None);)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (8)
56if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.None) || 58bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.None)) 63if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.OpenBraceToken)) 65return bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.CloseBraceToken); 68if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.OpenBracketToken)) 70return bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.CloseBracketToken); 277return token.IsKind(SyntaxKind.EqualsToken) && 538return currentToken.IsKind(SyntaxKind.CommaToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (5)
115currentToken.IsKind(SyntaxKind.WhereKeyword) && 130firstTokenAfterTypeConstraint.IsKind(SyntaxKind.WhereKeyword) && 142currentToken.IsKind(SyntaxKind.OpenBraceToken) && 293if (previousToken.IsKind(SyntaxKind.CloseBracketToken) && 340if (!currentToken.IsKind(SyntaxKind.EndOfFileToken) && !(currentToken.Parent is AttributeListSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (32)
83if (previousToken.IsKind(SyntaxKind.CloseBraceToken) 84&& currentToken.IsKind(SyntaxKind.ElseKeyword) 94if (currentToken.IsKind(SyntaxKind.CatchKeyword)) 103if (currentToken.IsKind(SyntaxKind.FinallyKeyword)) 112if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax) 121if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression)) 130if (currentToken.IsKind(SyntaxKind.OpenBraceToken)) 168if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax) 180if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax) 189if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression)) 198if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement)) 207if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 217if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression)) 226if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent)) 246if (previousToken.IsKind(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.ObjectInitializerExpression)) 260if (previousToken.IsKind(SyntaxKind.CommaToken) && previousToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression)) 274if (previousToken.IsKind(SyntaxKind.CloseBraceToken) && currentToken.IsKind(SyntaxKind.ElseKeyword)) 288if (currentToken.IsKind(SyntaxKind.CatchKeyword)) 301if (currentToken.IsKind(SyntaxKind.FinallyKeyword)) 314if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent is BaseTypeDeclarationSyntax or NamespaceDeclarationSyntax) 327if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression)) 343if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 360if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 369if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is MemberDeclarationSyntax) 386if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent is AccessorDeclarationSyntax) 399if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.AnonymousMethodExpression)) 412if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentTokenParentParent.IsKind(SyntaxKind.LocalFunctionStatement)) 425if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && 439if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && currentToken.Parent.IsKind(SyntaxKind.SwitchExpression)) 452if (currentToken.IsKind(SyntaxKind.OpenBraceToken) && IsControlBlock(currentToken.Parent)) 467if (previousToken.IsKind(SyntaxKind.SemicolonToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
252if (currentToken.IsKind(SyntaxKind.OpenBracketToken) && 259if (currentToken.IsKind(SyntaxKind.EndOfFileToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (3)
334Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None)); 347if (!pragmaWarningDirectiveTrivia.DisableOrRestoreKeyword.IsKind(disableOrRestoreKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (7)
89if (!currentToken.IsKind(SyntaxKind.SemicolonToken) && 287if (previousToken.IsKind(SyntaxKind.CloseBracketToken) && 291if (currentToken.IsKind(SyntaxKind.OpenBracketToken)) 374if (currentToken.IsKind(SyntaxKind.OpenBracketToken) && 393if (currentToken.IsKind(SyntaxKind.ColonToken)) 453if (currentToken.IsKind(SyntaxKind.QuestionToken) && currentToken.Parent.IsKind(SyntaxKind.ConditionalAccessExpression)) 466if (currentToken.IsKind(SyntaxKind.QuestionToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (4)
95if (!firstToken.IsKind(SyntaxKind.None) || !lastToken.IsKind(SyntaxKind.None)) 125if (!tokens.firstToken.IsKind(SyntaxKind.None) || !tokens.lastToken.IsKind(SyntaxKind.None))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (4)
73return endToken.IsKind(SyntaxKind.CloseBraceToken) && 95if (token.IsKind(SyntaxKind.OpenBraceToken) && 100if (nextToken.IsKind(SyntaxKind.CloseBraceToken)) 109if (token.IsKind(SyntaxKind.OpenBraceToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
346return token.IsKind(SyntaxKind.InKeyword) ? queryInfo.CastInfo.GetBestOrAllSymbols() : queryInfo.OperationInfo.GetBestOrAllSymbols(); 358if (token.IsKind(SyntaxKind.CommaToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
348return previousToken.IsKind(SyntaxKind.OpenBraceToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
61var directive1IsUsingStatic = using1.StaticKeyword.IsKind(SyntaxKind.StaticKeyword); 62var directive2IsUsingStatic = using2.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
461ComputePositionAndTriviaForRemoveAttributeFromAttributeList(attributeToRemove, (SyntaxToken t) => t.IsKind(SyntaxKind.CommaToken), out positionOfRemovedNode, out trivia);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (5)
229var isDestructorTypeContext = targetToken.IsKind(SyntaxKind.TildeToken) && 351if (!previousToken.IsKind(SyntaxKind.RecordKeyword)) 454if (targetToken.IsKind(SyntaxKind.AwaitKeyword)) 465&& targetToken.IsKind(SyntaxKind.IdentifierToken) 502if (targetToken.IsKind(SyntaxKind.InKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
25if (token.IsKind(SyntaxKind.UsingKeyword)) 47if (token.IsKind(SyntaxKind.UnsafeKeyword) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (103)
94if (token.IsKind(SyntaxKind.CloseBracketToken) 165if (token.IsKind(SyntaxKind.OpenBraceToken)) 176if (token.IsKind(SyntaxKind.SemicolonToken)) 193if (token.IsKind(SyntaxKind.CloseBraceToken)) 219if (token.IsKind(SyntaxKind.CloseBracketToken) && 425if (token.IsKind(SyntaxKind.None)) 439if (token.IsKind(SyntaxKind.OpenBraceToken) && token.Parent is NamespaceDeclarationSyntax or TypeDeclarationSyntax) 454if (token.IsKind(SyntaxKind.SemicolonToken)) 476if (token.IsKind(SyntaxKind.CloseBraceToken)) 506if (token.IsKind(SyntaxKind.CloseBracketToken) && 630if (token.IsKind(SyntaxKind.ColonColonToken) && 631token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.GlobalKeyword)) 643if (token.IsKind(SyntaxKind.UsingKeyword)) 696token.GetPreviousToken().IsKind(SyntaxKind.PartialKeyword)) 850if (token.IsKind(SyntaxKind.ColonToken) && 851token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IdentifierToken) && 852token.GetPreviousToken(includeSkipped: true).GetPreviousToken().IsKind(SyntaxKind.WhereKeyword)) 876if (token.IsKind(SyntaxKind.CommaToken) && 895if (token.IsKind(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.TypeOfExpression)) 907if (token.IsKind(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.DefaultExpression)) 920if (token.IsKind(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.SizeOfExpression)) 1063if (token.IsKind(SyntaxKind.OpenParenToken) && 1071if (token.IsKind(SyntaxKind.LessThanToken) && token.Parent.IsKind(SyntaxKind.FunctionPointerParameterList)) 1077if (token.IsKind(SyntaxKind.CommaToken) && 1087if (token.IsKind(SyntaxKind.CommaToken) && 1096if (token.IsKind(SyntaxKind.CloseBracketToken) && 1112else if (token.IsKind(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName) 1170if (token.IsKind(SyntaxKind.DelegateKeyword) && 1185if (token.IsKind(SyntaxKind.OperatorKeyword) && 1265else if (token.IsKind(SyntaxKind.ScopedKeyword) && token.Parent.IsKind(SyntaxKind.Parameter)) 1269else if (token.IsKind(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent is IdentifierNameSyntax scopedIdentifierName && scopedIdentifierName.Parent.IsKind(SyntaxKind.Parameter)) 1320if (leftToken.IsKind(SyntaxKind.CloseParenToken)) 1337if (leftToken.IsKind(SyntaxKind.IdentifierToken)) 1348if (leftToken.IsKind(SyntaxKind.IdentifierToken) && 1366if (leftToken.IsKind(SyntaxKind.OpenParenToken)) 1412if (leftToken.IsKind(SyntaxKind.DotDotToken) && leftToken.Parent.IsKind(SyntaxKind.SlicePattern)) 1420if (leftToken.IsKind(SyntaxKind.ColonToken) && leftToken.Parent is (kind: SyntaxKind.NameColon or SyntaxKind.ExpressionColon) && 1438if (leftToken.IsKind(SyntaxKind.NotKeyword) && leftToken.Parent.IsKind(SyntaxKind.NotPattern)) 1464if (leftToken.IsKind(SyntaxKind.DotToken) || 1465leftToken.IsKind(SyntaxKind.MinusGreaterThanToken)) 1526binaryExpressionSyntax.OperatorToken.IsKind(SyntaxKind.IsKeyword) && 1785if (token.IsKind(SyntaxKind.ConstKeyword) && 1817if (token.IsKind(SyntaxKind.OutKeyword) && 1829if (token.IsKind(SyntaxKind.OpenParenToken)) 1838if (token.IsKind(SyntaxKind.UsingKeyword) && 1853if (CodeAnalysis.CSharpExtensions.IsKind(token, SyntaxKind.JoinKeyword) && 1865if (token.IsKind(SyntaxKind.IdentifierToken) && token.Text == "scoped" && token.Parent.IsKind(SyntaxKind.IdentifierName) && token.Parent.Parent is VariableDeclarationSyntax or ExpressionStatementSyntax or IncompleteMemberSyntax) 1871if (token.IsKind(SyntaxKind.ScopedKeyword) && token.Parent is IncompleteMemberSyntax) 1888if (token.IsKind(SyntaxKind.OpenParenToken) && 1889token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.FixedKeyword)) 1930if (token.IsKind(SyntaxKind.NewKeyword)) 1984if (token.IsKind(SyntaxKind.None)) 2034if (CodeAnalysis.CSharpExtensions.IsKind(token, SyntaxKind.OpenParenToken) && 2048if (token.IsKind(SyntaxKind.OpenParenToken) && 2068if (token.IsKind(SyntaxKind.CaseKeyword) && 2074if (token.IsKind(SyntaxKind.EqualsToken) && 2117if (token.IsKind(SyntaxKind.ColonToken) && 2125if (token.IsKind(SyntaxKind.EqualsToken) && 2206if (token.IsKind(SyntaxKind.EqualsToken)) 2248if (token.IsKind(SyntaxKind.OpenParenToken)) 2323if (token.IsKind(SyntaxKind.AsteriskToken) && semanticModel != null) 2340tokenOnLeftOfPosition.IsKind(SyntaxKind.IdentifierToken)) 2374if (token.IsKind(SyntaxKind.DotDotToken) && 2382if (token.IsKind(SyntaxKind.QuestionToken) && 2391if (token.IsKind(SyntaxKind.ColonToken) && 2400if (token.IsKind(SyntaxKind.OpenParenToken)) 2465if (token.IsKind(SyntaxKind.ColonToken) && 2473if (token.IsKind(SyntaxKind.EqualsGreaterThanToken)) 2486if (token.Parent.IsKind(SyntaxKind.ObjectInitializerExpression) && token.IsKind(SyntaxKind.OpenBraceToken)) 2489if (!token.IntersectsWith(position) && token.GetNextToken().GetNextToken().IsKind(SyntaxKind.EqualsToken)) 2516if (token.IsKind(SyntaxKind.SemicolonToken) && 2527if (token.IsKind(SyntaxKind.OpenParenToken) && 2536if (token.IsKind(SyntaxKind.CommaToken) && 2546if (token.IsKind(SyntaxKind.InKeyword)) 2567if (token.IsKind(SyntaxKind.WhereKeyword) && 2582if (token.IsKind(SyntaxKind.SelectKeyword) && 2599if (token.IsKind(SyntaxKind.ReturnKeyword)) 2608if (token.IsKind(SyntaxKind.ThrowKeyword)) 2614if (token.IsKind(SyntaxKind.OpenParenToken) && 2615token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.WhileKeyword)) 2624if (token.IsKind(SyntaxKind.OpenParenToken) && token.Parent.IsKind(SyntaxKind.UsingStatement)) 2630if (token.IsKind(SyntaxKind.OpenParenToken) && 2631token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.LockKeyword)) 2637if (token.IsKind(SyntaxKind.OpenParenToken) && 2638token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword)) 2644if (token.IsKind(SyntaxKind.OpenParenToken) && 2645token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.SwitchKeyword)) 2651if (token.IsKind(SyntaxKind.OpenParenToken) && 2652token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.CheckedKeyword)) 2658if (token.IsKind(SyntaxKind.OpenParenToken) && 2659token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.UncheckedKeyword)) 2665if (token.IsKind(SyntaxKind.OpenParenToken) && 2666token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.WhenKeyword)) 2672if (token.IsKind(SyntaxKind.WhenKeyword) && token.Parent.IsKind(SyntaxKind.WhenClause)) 2728if (token.IsKind(SyntaxKind.OpenBraceToken)) 2821if (token.IsKind(SyntaxKind.NumericLiteralToken)) 2864if (token.IsKind(SyntaxKind.IdentifierToken) && 2948if (token.IsKind(SyntaxKind.CloseBraceToken)) 2974if (CodeAnalysis.CSharpExtensions.IsKind(token, SyntaxKind.CatchKeyword)) 2979if (CodeAnalysis.CSharpExtensions.IsKind(token, SyntaxKind.CloseParenToken) && 2995targetToken.IsKind(SyntaxKind.ColonToken) && 3006if (!token.IsKind(SyntaxKind.DotToken)) 3057return targetToken.IsKind(SyntaxKind.AsteriskToken) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
101if (reference.GetSyntax().ChildTokens().Any(t => t.IsKind(SyntaxKind.UnsafeKeyword)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (2)
100if (token.IsMissing || token.IsKind(SyntaxKind.None)) 118if (addedBraces && typeDeclaration.SemicolonToken.IsKind(SyntaxKind.SemicolonToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
80if (token.IsKind(SyntaxKind.None) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (2)
84if (token.IsKind(SyntaxKind.MultiLineRawStringLiteralToken)) 179(token.IsKind(SyntaxKind.CloseBraceToken) && token.Parent.IsKind(SyntaxKind.Interpolation)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
342if (previousToken.IsKind(SyntaxKind.CommaToken)) 1968if (previousToken.HasValue && (previousToken.Value != yieldStatement.ReturnOrBreakKeyword || yieldStatement.ReturnOrBreakKeyword.IsKind(SyntaxKind.BreakKeyword)))
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.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Parser.cs (2)
286if (mod.IsKind(SyntaxKind.PartialKeyword)) 290else if (mod.IsKind(SyntaxKind.StaticKeyword))
src\libraries\Common\src\Roslyn\CSharpSyntaxHelper.cs (1)
120if (directive.GlobalKeyword.IsKind(SyntaxKind.GlobalKeyword) &&
Microsoft.Extensions.Options.SourceGeneration (1)
ParserUtilities.cs (1)
38syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Gen.ContextualOptions (3)
Parser.cs (3)
31.Where(modifier => modifier.IsKind(SyntaxKind.StaticKeyword)) 45.Where(modifier => modifier.IsKind(SyntaxKind.RefKeyword)) 54if (!type.Definitions.Any(def => def.Modifiers.Any(static token => token.IsKind(SyntaxKind.PartialKeyword))))
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
EmitterTests.cs (1)
39mod => mod.IsKind(SyntaxKind.ReadOnlyKeyword));
Microsoft.Gen.Logging (1)
src\Generators\Shared\ParserUtilities.cs (1)
43syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Gen.Metrics (1)
src\Generators\Shared\ParserUtilities.cs (1)
43syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\ParserUtilities.cs (1)
43syntax.Modifiers.Any(m => m.IsKind(modifierToSearch)));
Microsoft.Interop.ComInterfaceGenerator (1)
ComInterfaceGenerator.cs (1)
369var methodSyntaxTemplate = new ContainingSyntax(new SyntaxTokenList(syntax.Modifiers.Where(static m => !m.IsKind(SyntaxKind.NewKeyword))).StripAccessibilityModifiers(), SyntaxKind.MethodDeclaration, syntax.Identifier, syntax.TypeParameterList);
Microsoft.Interop.SourceGeneration (1)
Marshalling\StaticPinnableManagedValueMarshaller.cs (1)
31&& predefinedType.Keyword.IsKind(SyntaxKind.VoidKeyword))
Microsoft.ML.InternalCodeAnalyzer (5)
NameAnalyzer.cs (5)
131return modifiers.Any(token => token.IsKind(SyntaxKind.ExternKeyword)); 151if (mod.IsKind(SyntaxKind.ConstKeyword)) 153else if (mod.IsKind(SyntaxKind.PublicKeyword) || mod.IsKind(SyntaxKind.ProtectedKeyword) || mod.IsKind(SyntaxKind.InternalKeyword))
Microsoft.VisualStudio.LanguageServices.CSharp (19)
LanguageService\CSharpHelpContextService.cs (19)
131if (token.IsKind(SyntaxKind.InterpolatedVerbatimStringStartToken)) 167else if (token.Parent is NullableTypeSyntax && token.IsKind(SyntaxKind.QuestionToken)) 217if (token.IsKind(SyntaxKind.ExclamationToken) && 231if (token.IsKind(SyntaxKind.ColonColonToken)) 237if (token.IsKind(SyntaxKind.ColonToken) && token.Parent is NameColonSyntax) 243if (token.IsKind(SyntaxKind.EqualsToken)) 316if (token.IsKind(SyntaxKind.QuestionToken) && token.Parent is ConditionalExpressionSyntax) 322if (token.IsKind(SyntaxKind.EqualsGreaterThanToken)) 348if (token.IsKind(SyntaxKind.DefaultKeyword) && token.Parent is LineDirectiveTriviaSyntax) 360if (token.IsKind(SyntaxKind.EndOfDirectiveToken)) 436text = token.GetNextToken().IsKind(SyntaxKind.StaticKeyword) 454return CSharpSyntaxFacts.Instance.GetModifiers(token.Parent).Any(t => t.IsKind(kind)); 460if (token.IsKind(SyntaxKind.InKeyword)) 475if (token.IsKind(SyntaxKind.DefaultKeyword)) 490if (token.IsKind(SyntaxKind.ClassKeyword) && token.Parent is ClassOrStructConstraintSyntax) 496if (token.IsKind(SyntaxKind.StructKeyword) && token.Parent is ClassOrStructConstraintSyntax) 502if (token.IsKind(SyntaxKind.UsingKeyword) && token.Parent is UsingStatementSyntax or LocalDeclarationStatementSyntax) 508if (token.IsKind(SyntaxKind.SwitchKeyword) && token.Parent is SwitchExpressionSyntax) 520if (token.ValueText == "var" && token.IsKind(SyntaxKind.IdentifierToken) &&
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
182isPartialType |= modifier.IsKind(SyntaxKind.PartialKeyword);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
130if (!typeDeclaration.Modifiers.Any(m => m.IsKind(SyntaxKind.PartialKeyword)))