protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { return (context.IsStatementContext || context.IsGlobalStatementContext || context.IsAwaitStatementContext(position, cancellationToken)); }
protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { // cases: // using (goo) { } // using Goo; // using Goo = Bar; // await using (goo) { } return (context.IsStatementContext || context.IsGlobalStatementContext || IsUsingDirectiveContext(context, forGlobalKeyword: false, cancellationToken) || context.IsAwaitStatementContext(position, cancellationToken)); }