コード例 #1
0
 public Task <bool> HasSuggestedActionsAsync(ISuggestedActionCategorySet requestedActionCategories, SnapshotSpan range, CancellationToken cancellationToken)
 {
     if (TextView != null && !TextView.Caret.InVirtualSpace)
     {
         var rPosition = TextView.MapDownToR(TextView.Caret.Position.BufferPosition);
         if (rPosition.HasValue && SuggestedActionProviders.Any(actionProvider => actionProvider.HasSuggestedActions(TextView, TextBuffer, rPosition.Value.Position)))
         {
             return(Task.FromResult(true));
         }
     }
     return(Task.FromResult(false));
 }
コード例 #2
0
 public Task <bool> HasSuggestedActionsAsync(ISuggestedActionCategorySet requestedActionCategories, SnapshotSpan range, CancellationToken cancellationToken)
 => Task.FromResult(
     TextView != null &&
     SuggestedActionProviders.Any(a => a.HasSuggestedActions(TextView, TextBuffer, PositionFromRange(range))));