提交 c0e34cd0 编写于 作者: D David Barbet

Rename async toggle block comment method.

上级 28bbe350
......@@ -56,7 +56,7 @@ internal abstract class AbstractCommentSelectionBase<TCommand>
protected abstract string GetMessage(TCommand command);
// Internal as tests currently rely on this method.
internal abstract Task<CommentSelectionResult> CollectEdits(
internal abstract Task<CommentSelectionResult> CollectEditsAsync(
Document document, ICommentSelectionService service, ITextBuffer textBuffer, NormalizedSnapshotSpanCollection selectedSpans,
TCommand command, CancellationToken cancellationToken);
......@@ -104,7 +104,7 @@ internal bool ExecuteCommand(ITextView textView, ITextBuffer subjectBuffer, TCom
return true;
}
var edits = CollectEdits(document, service, subjectBuffer, selectedSpans, command, cancellationToken).WaitAndGetResult(cancellationToken);
var edits = CollectEditsAsync(document, service, subjectBuffer, selectedSpans, command, cancellationToken).WaitAndGetResult(cancellationToken);
ApplyEdits(document, textView, subjectBuffer, service, title, edits);
}
......@@ -169,7 +169,6 @@ internal static ITrackingSpan CreateTrackingSpan(Operation operation, ITextSnaps
/// <summary>
/// Retrieves the snapshot span from a post edited tracking span.
/// Additionally applies any extra modifications to the tracking span post edit.
/// Internal for tests.
/// </summary>
private static SnapshotSpan CreateSnapshotSpan(ITextSnapshot snapshot, ITrackingSpan trackingSpan, CommentTrackingSpan originalSpan)
{
......
......@@ -71,7 +71,7 @@ public bool ExecuteCommand(ToggleBlockCommentCommandArgs args, CommandExecutionC
protected override string GetMessage(ValueTuple command) => EditorFeaturesResources.Toggling_block_comment;
internal async override Task<CommentSelectionResult> CollectEdits(Document document, ICommentSelectionService service,
internal async override Task<CommentSelectionResult> CollectEditsAsync(Document document, ICommentSelectionService service,
ITextBuffer subjectBuffer, NormalizedSnapshotSpanCollection selectedSpans, ValueTuple command, CancellationToken cancellationToken)
{
var experimentationService = document.Project.Solution.Workspace.Services.GetRequiredService<IExperimentationService>();
......
......@@ -80,7 +80,7 @@ public bool ExecuteCommand(UncommentSelectionCommandArgs args, CommandExecutionC
///
/// Internal so that it can be called by unit tests.
/// </summary>
internal override Task<CommentSelectionResult> CollectEdits(
internal override Task<CommentSelectionResult> CollectEditsAsync(
Document document, ICommentSelectionService service, ITextBuffer subjectBuffer, NormalizedSnapshotSpanCollection selectedSpans,
Operation operation, CancellationToken cancellationToken)
{
......
......@@ -767,7 +767,7 @@ private static void CommentSelection(ITextView textView, IEnumerable<TextChange>
var commandHandler = new CommentUncommentSelectionCommandHandler(textUndoHistoryRegistry, editorOperationsFactory);
var service = new MockCommentSelectionService(supportBlockComments);
var edits = commandHandler.CollectEdits(
var edits = commandHandler.CollectEditsAsync(
null, service, textView.TextBuffer, textView.Selection.GetSnapshotSpansOnBuffer(textView.TextBuffer), operation, CancellationToken.None).GetAwaiter().GetResult();
Roslyn.Test.Utilities.AssertEx.SetEqual(expectedChanges, edits.TextChanges);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册