123 references to AsyncKeyword
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Lambda.cs (1)
111if (modifier.IsKind(SyntaxKind.AsyncKeyword))
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
642if (lambdaSyntax.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword) 660if (lambdaSyntax.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword)
Parser\LanguageParser.cs (19)
1336case SyntaxKind.AsyncKeyword: 1345case SyntaxKind.AsyncKeyword: 3004this.CurrentToken.ContextualKind is not (SyntaxKind.PartialKeyword or SyntaxKind.AsyncKeyword or SyntaxKind.RequiredKeyword or SyntaxKind.FileKeyword or SyntaxKind.ClosedKeyword) && 3397if (contextualKind != SyntaxKind.AsyncKeyword || 3699using var _ = new ParserSyntaxContextResetter(this, isInAsyncContext: modifiers.Any((int)SyntaxKind.AsyncKeyword)); 7797if (this.CurrentToken.ContextualKind is SyntaxKind.AsyncKeyword or SyntaxKind.AwaitKeyword or SyntaxKind.FromKeyword) 8552&& (tk is not (SyntaxKind.AsyncKeyword or SyntaxKind.ScopedKeyword) || ShouldContextualKeywordBeTreatedAsModifier(parsingStatementNotDeclaration: true)); 10814if (k == SyntaxKind.AsyncKeyword) 10895case SyntaxKind.AsyncKeyword: 10958case SyntaxKind.AsyncKeyword: 10991using var _ = new ParserSyntaxContextResetter(this, isInAsyncContext: modifiers.Any((int)SyntaxKind.AsyncKeyword)); 12288this.PeekToken(tokenIndex).ContextualKind == SyntaxKind.AsyncKeyword) 13086else if (this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword && 13129if (this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword && 13726isInAsyncContext: this.IsInAsync || modifiers.Any((int)SyntaxKind.AsyncKeyword), 13786if (this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword && 13789modifiers.Add(this.EatContextualToken(SyntaxKind.AsyncKeyword)); 13801Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword); 13843isInAsyncContext: this.IsInAsync || modifiers.Any((int)SyntaxKind.AsyncKeyword),
Symbols\Source\ModifierUtils.cs (3)
345return SyntaxFacts.GetText(SyntaxKind.AsyncKeyword); 367case SyntaxKind.AsyncKeyword: 462var isPartialAsyncMethod = isOrdinaryMethod && i == modifiers.Count - 2 && modifiers[i + 1].ContextualKind() is SyntaxKind.AsyncKeyword;
Syntax\AnonymousFunctionExpressionSyntax.cs (2)
38if (Modifiers.Any(SyntaxKind.AsyncKeyword)) 40return new SyntaxTokenList(Modifiers.Where(m => !m.IsKind(SyntaxKind.AsyncKeyword)));
Syntax\AnonymousMethodExpressionSyntax.cs (1)
25=> this.Modifiers.FirstOrDefault(SyntaxKind.AsyncKeyword);
Syntax\ParenthesizedLambdaExpressionSyntax.cs (1)
22=> this.Modifiers.FirstOrDefault(SyntaxKind.AsyncKeyword);
Syntax\SimpleLambdaExpressionSyntax.cs (1)
22=> this.Modifiers.FirstOrDefault(SyntaxKind.AsyncKeyword);
Syntax\SyntaxKindFacts.cs (3)
1285case SyntaxKind.AsyncKeyword: 1397return SyntaxKind.AsyncKeyword; 1845case SyntaxKind.AsyncKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (13)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryAsyncModifier\CSharpMakeMethodSynchronousDiagnosticAnalyzer.cs (1)
90if (modifier.Kind() == SyntaxKind.AsyncKeyword)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
83if (wasAwaited != anonymousFunction.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
56if (statement.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
54if (declaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
106LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)), 107MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
14public static readonly SyntaxToken AsyncKeyword = Token(SyntaxKind.AsyncKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
178SyntaxKind.AsyncKeyword,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (3)
99case SyntaxKind.AsyncKeyword: 109if (token.HasMatchingText(SyntaxKind.AsyncKeyword)) 111modifierKind = SyntaxKind.AsyncKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
130SyntaxKind.AsyncKeyword => Modifiers.Async,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
145public int AsyncKeyword => (int)SyntaxKind.AsyncKeyword;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (11)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
87if (!methodDeclaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
144MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.Any(SyntaxKind.AsyncKeyword)), 147LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
271if (modifiers.Any(SyntaxKind.AsyncKeyword) || onYield)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (1)
35var asyncTokenIndex = modifiers.IndexOf(SyntaxKind.AsyncKeyword);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
214if (anonymousFunction.AsyncKeyword.IsKind(SyntaxKind.AsyncKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
263isTaskLikeTypeContext: precedingModifiers.Contains(SyntaxKind.AsyncKeyword),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
25SyntaxKind.AsyncKeyword, 299if (token.HasMatchingText(SyntaxKind.AsyncKeyword)) 2889if (token.Text == SyntaxFacts.GetText(SyntaxKind.AsyncKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
33SyntaxKind.AsyncKeyword,
Microsoft.CodeAnalysis.CSharp.Features (39)
CodeRefactorings\AddAwait\CSharpAddAwaitCodeRefactoringProvider.cs (1)
39return methodDeclaration.Modifiers.Any(SyntaxKind.AsyncKeyword);
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
174if (identifier.Identifier.IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword))
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (1)
61if (context.TargetToken.IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword) ||
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
667case SyntaxKind.AsyncKeyword:
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
70if (SyntaxFacts.GetContextualKeywordKind(targetToken.ValueText) == SyntaxKind.AsyncKeyword) 123while (tokenBeforeType.Kind() is SyntaxKind.AsyncKeyword or SyntaxKind.StaticKeyword)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
112if (token.IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword))
Completion\KeywordRecommenders\AsyncKeywordRecommender.cs (2)
13internal sealed class AsyncKeywordRecommender() : AbstractSyntacticSingleKeywordRecommender(SyntaxKind.AsyncKeyword, isValidInPreprocessorContext: false) 24context.PrecedingModifiers.Contains(SyntaxKind.AsyncKeyword))
Completion\KeywordRecommenders\DelegateKeywordRecommender.cs (1)
59context.TargetToken.IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword) &&
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (4)
28SyntaxKind.AsyncKeyword, 43SyntaxKind.AsyncKeyword, 72SyntaxKind.AsyncKeyword, 84context.SyntaxTree.IsLambdaDeclarationContext(position, otherModifier: SyntaxKind.AsyncKeyword, cancellationToken) ||
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (1)
61SyntaxKind.AsyncKeyword
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
29SyntaxKind.AsyncKeyword
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
239modifiers: [.. otherMethod.Modifiers.Where(m => m.Kind() is SyntaxKind.AsyncKeyword or SyntaxKind.UnsafeKeyword)],
EditAndContinue\SyntaxComparer.cs (2)
952if ((leftAsync.Kind() == SyntaxKind.AsyncKeyword) != (rightAsync.Kind() == SyntaxKind.AsyncKeyword))
EditAndContinue\SyntaxUtilities.cs (3)
211return anonymousFunction.AsyncKeyword.IsKind(SyntaxKind.AsyncKeyword); 223MethodDeclarationSyntax method => method.Modifiers.Any(SyntaxKind.AsyncKeyword), 224LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword),
ExtractMethod\CSharpSelectionResult.StatementResult.cs (2)
31MethodDeclarationSyntax method => method.Modifiers.Any(SyntaxKind.AsyncKeyword), 32LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword),
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
55SyntaxKind.AsyncKeyword or
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (2)
31=> tokens.Any(static t => t.Kind() is SyntaxKind.AwaitKeyword or SyntaxKind.AsyncKeyword); 99if (mod.Kind() is SyntaxKind.AsyncKeyword or SyntaxKind.AwaitKeyword)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryAsyncModifier\CSharpMakeMethodSynchronousDiagnosticAnalyzer.cs (1)
90if (modifier.Kind() == SyntaxKind.AsyncKeyword)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
83if (wasAwaited != anonymousFunction.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
56if (statement.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
54if (declaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
106LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)), 107MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
87if (!methodDeclaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
144MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.Any(SyntaxKind.AsyncKeyword)), 147LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
271if (modifiers.Any(SyntaxKind.AsyncKeyword) || onYield)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (1)
35var asyncTokenIndex = modifiers.IndexOf(SyntaxKind.AsyncKeyword);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
214if (anonymousFunction.AsyncKeyword.IsKind(SyntaxKind.AsyncKeyword))
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
Simplification\Reducers\CSharpEscapingReducer.cs (1)
60if (enclosingMethodBlock != null && enclosingMethodBlock.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
14public static readonly SyntaxToken AsyncKeyword = Token(SyntaxKind.AsyncKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
178SyntaxKind.AsyncKeyword,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (3)
99case SyntaxKind.AsyncKeyword: 109if (token.HasMatchingText(SyntaxKind.AsyncKeyword)) 111modifierKind = SyntaxKind.AsyncKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
130SyntaxKind.AsyncKeyword => Modifiers.Async,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
145public int AsyncKeyword => (int)SyntaxKind.AsyncKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
263isTaskLikeTypeContext: precedingModifiers.Contains(SyntaxKind.AsyncKeyword),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
25SyntaxKind.AsyncKeyword, 299if (token.HasMatchingText(SyntaxKind.AsyncKeyword)) 2889if (token.Text == SyntaxFacts.GetText(SyntaxKind.AsyncKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
33SyntaxKind.AsyncKeyword,
Microsoft.CodeAnalysis.Razor.Compiler (2)
Language\Intermediate\CommonModifiers.cs (2)
53GetText(CSharpSyntaxKind.AsyncKeyword), 59GetText(CSharpSyntaxKind.AsyncKeyword)];
Roslyn.Diagnostics.CSharp.Analyzers (12)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
14public static readonly SyntaxToken AsyncKeyword = Token(SyntaxKind.AsyncKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
178SyntaxKind.AsyncKeyword,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (3)
99case SyntaxKind.AsyncKeyword: 109if (token.HasMatchingText(SyntaxKind.AsyncKeyword)) 111modifierKind = SyntaxKind.AsyncKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
130SyntaxKind.AsyncKeyword => Modifiers.Async,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
145public int AsyncKeyword => (int)SyntaxKind.AsyncKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
263isTaskLikeTypeContext: precedingModifiers.Contains(SyntaxKind.AsyncKeyword),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
25SyntaxKind.AsyncKeyword, 299if (token.HasMatchingText(SyntaxKind.AsyncKeyword)) 2889if (token.Text == SyntaxFacts.GetText(SyntaxKind.AsyncKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
33SyntaxKind.AsyncKeyword,