예제 #1
0
 protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
 {
     return
         (context.IsStatementContext ||
          context.IsGlobalStatementContext ||
          context.IsAwaitStatementContext(position, cancellationToken));
 }
예제 #2
0
 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));
 }