提交 a931a4e8 编写于 作者: O Oleg Tkachenko

Migrate to latest editor bits in 15.6stg

上级 d6fff606
......@@ -72,24 +72,24 @@
<MicrosoftVisualStudioCodeAnalysisSdkUIVersion>15.0.26730-alpha</MicrosoftVisualStudioCodeAnalysisSdkUIVersion>
<MicrosoftVisualStudioComponentModelHostVersion>15.0.26730-alpha</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioCompositionVersion>15.5.23</MicrosoftVisualStudioCompositionVersion>
<MicrosoftVisualStudioCoreUtilityVersion>15.6.253-preview</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioCoreUtilityVersion>15.6.281-preview</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioDebuggerEngineVersion>15.0.26811-vsucorediag</MicrosoftVisualStudioDebuggerEngineVersion>
<MicrosoftVisualStudioDebuggerMetadataVersion>15.0.26811-vsucorediag</MicrosoftVisualStudioDebuggerMetadataVersion>
<MicrosoftVisualStudioDebuggerInterop100Version>10.0.30319</MicrosoftVisualStudioDebuggerInterop100Version>
<MicrosoftVisualStudioDesignerInterfacesVersion>1.1.4322</MicrosoftVisualStudioDesignerInterfacesVersion>
<MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>15.0.26730-alpha</MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>
<MicrosoftVisualStudioEditorVersion>15.6.253-preview</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioEditorVersion>15.6.281-preview</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioGraphModelVersion>15.0.26730-alpha</MicrosoftVisualStudioGraphModelVersion>
<MicrosoftVisualStudioImageCatalogVersion>15.0.26730-alpha</MicrosoftVisualStudioImageCatalogVersion>
<MicrosoftVisualStudioImagingVersion>15.0.26730-alpha</MicrosoftVisualStudioImagingVersion>
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>15.0.25726-Preview5</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioInteractiveWindowVersion>2.0.0-rc3-61304-01</MicrosoftVisualStudioInteractiveWindowVersion>
<MicrosoftVisualStudioLanguageCallHierarchyVersion>15.3.1710.203</MicrosoftVisualStudioLanguageCallHierarchyVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>15.6.253-preview</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>15.6.253-preview</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>15.6.253-preview</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>15.6.281-preview</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>15.6.281-preview</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>15.6.281-preview</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioOLEInteropVersion>7.10.6070</MicrosoftVisualStudioOLEInteropVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>15.6.253-preview</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>15.6.281-preview</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioProgressionCodeSchemaVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionCodeSchemaVersion>
<MicrosoftVisualStudioProgressionCommonVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionCommonVersion>
<MicrosoftVisualStudioProgressionInterfacesVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionInterfacesVersion>
......@@ -115,11 +115,11 @@
<MicrosoftVisualStudioShellInterop90Version>9.0.30729</MicrosoftVisualStudioShellInterop90Version>
<MicrosoftVisualStudioTelemetryVersion>15.0.26730-alpha</MicrosoftVisualStudioTelemetryVersion>
<MicrosoftVisualStudioTemplateWizardInterfaceVersion>8.0.0.0-alpha</MicrosoftVisualStudioTemplateWizardInterfaceVersion>
<MicrosoftVisualStudioTextDataVersion>15.6.253-preview</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>15.6.253-preview</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>15.6.253-preview</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>15.6.253-preview</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>15.6.253-preview</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextDataVersion>15.6.281-preview</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>15.6.281-preview</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>15.6.281-preview</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>15.6.281-preview</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>15.6.281-preview</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextManagerInteropVersion>7.10.6070</MicrosoftVisualStudioTextManagerInteropVersion>
<MicrosoftVisualStudioTextManagerInterop100Version>10.0.30319</MicrosoftVisualStudioTextManagerInterop100Version>
<MicrosoftVisualStudioTextManagerInterop120Version>12.0.30110</MicrosoftVisualStudioTextManagerInterop120Version>
......
......@@ -47,9 +47,9 @@ public VSCommanding.CommandState GetCommandState(RenameCommandArgs args, Func<VS
public void ExecuteCommand(RenameCommandArgs args, Action nextHandler, CommandExecutionContext context)
{
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Finding_token_to_rename))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Finding_token_to_rename))
{
ExecuteRenameWorker(args, context.WaitContext.UserCancellationToken);
ExecuteRenameWorker(args, context.OperationContext.UserCancellationToken);
}
}
......
......@@ -92,10 +92,10 @@ private bool ExecuteCommandImpl(EditorCommandArgs args, bool gotoNextMember, Com
int? targetPosition = null;
using (context.WaitContext.AddScope(allowCancellation: true, description: EditorFeaturesResources.Navigating))
using (context.OperationContext.AddScope(allowCancellation: true, description: EditorFeaturesResources.Navigating))
{
var task = GetTargetPositionAsync(document, caretPoint.Value.Position, gotoNextMember, context.WaitContext.UserCancellationToken);
targetPosition = task.WaitAndGetResult(context.WaitContext.UserCancellationToken);
var task = GetTargetPositionAsync(document, caretPoint.Value.Position, gotoNextMember, context.OperationContext.UserCancellationToken);
targetPosition = task.WaitAndGetResult(context.OperationContext.UserCancellationToken);
}
if (targetPosition != null)
......
......@@ -165,11 +165,11 @@ private IStreamingFindUsagesPresenter GetStreamingPresenter()
internal void FindReferences(
Document document, IFindReferencesService service, int caretPosition, CommandExecutionContext context)
{
using (var waitScope = context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Finding_references))
using (var waitScope = context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Finding_references))
using (Logger.LogBlock(
FunctionId.CommandHandler_FindAllReference,
KeyValueLogMessage.Create(LogType.UserAction, m => m["type"] = "legacy"),
context.WaitContext.UserCancellationToken))
context.OperationContext.UserCancellationToken))
{
if (!service.TryFindReferences(document, caretPosition, new WaitContextAdapter(waitScope)))
{
......
......@@ -63,10 +63,10 @@ internal bool TryExecuteCommand(Document document, int caretPosition, IGoToDefin
{
string errorMessage = null;
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Navigating_to_definition))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Navigating_to_definition))
{
if (goToDefinitionService != null &&
goToDefinitionService.TryGoToDefinition(document, caretPosition, context.WaitContext.UserCancellationToken))
goToDefinitionService.TryGoToDefinition(document, caretPosition, context.OperationContext.UserCancellationToken))
{
return true;
}
......@@ -79,7 +79,7 @@ internal bool TryExecuteCommand(Document document, int caretPosition, IGoToDefin
// We are about to show a modal UI dialog so we should take over the command execution
// wait context. That means the command system won't attempt to show its own wait dialog
// and also will take it into consideration when measuring command handling duration.
context.WaitContext.TakeOwnership();
context.OperationContext.TakeOwnership();
var workspace = document.Project.Solution.Workspace;
var notificationService = workspace.Services.GetService<INotificationService>();
notificationService.SendNotification(errorMessage, title: EditorFeaturesResources.Go_to_Definition, severity: NotificationSeverity.Information);
......
......@@ -86,9 +86,9 @@ public bool ExecuteCommand(GoToImplementationCommandArgs args, CommandExecutionC
// We have all the cheap stuff, so let's do expensive stuff now
string messageToShow = null;
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Locating_implementations))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Locating_implementations))
{
var userCancellationToken = context.WaitContext.UserCancellationToken;
var userCancellationToken = context.OperationContext.UserCancellationToken;
if (canUseStreamingWindow)
{
StreamingGoToImplementation(
......@@ -108,7 +108,7 @@ public bool ExecuteCommand(GoToImplementationCommandArgs args, CommandExecutionC
// We are about to show a modal UI dialog so we should take over the command execution
// wait context. That means the command system won't attempt to show its own wait dialog
// and also will take it into consideration when measuring command handling duration.
context.WaitContext.TakeOwnership();
context.OperationContext.TakeOwnership();
var notificationService = document.Project.Solution.Workspace.Services.GetService<INotificationService>();
notificationService.SendNotification(messageToShow,
title: EditorFeaturesResources.Go_To_Implementation,
......
......@@ -80,7 +80,7 @@ public void ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextHandle
return;
}
using (context.WaitContext.AddScope(allowCancellation: false, EditorFeaturesResources.Automatically_completing))
using (context.OperationContext.AddScope(allowCancellation: false, EditorFeaturesResources.Automatically_completing))
{
// This is a non cancellable command
var userCancellationToken = CancellationToken.None;
......
......@@ -80,7 +80,7 @@ private bool ExecuteCommand(ITextView textView, ITextBuffer subjectBuffer, Comma
ChangeSignatureResult result = null;
using (context.WaitContext.AddScope(allowCancellation: true, FeaturesResources.Change_signature))
using (context.OperationContext.AddScope(allowCancellation: true, FeaturesResources.Change_signature))
{
var reorderParametersService = document.GetLanguageService<AbstractChangeSignatureService>();
result = reorderParametersService.ChangeSignature(
......@@ -91,10 +91,10 @@ private bool ExecuteCommand(ITextView textView, ITextBuffer subjectBuffer, Comma
// We are about to show a modal UI dialog so we should take over the command execution
// wait context. That means the command system won't attempt to show its own wait dialog
// and also will take it into consideration when measuring command handling duration.
context.WaitContext.TakeOwnership();
context.OperationContext.TakeOwnership();
workspace.Services.GetService<INotificationService>().SendNotification(errorMessage, severity: severity);
},
context.WaitContext.UserCancellationToken);
context.OperationContext.UserCancellationToken);
}
if (result == null || !result.Succeeded)
......@@ -110,7 +110,7 @@ private bool ExecuteCommand(ITextView textView, ITextBuffer subjectBuffer, Comma
// We are about to show a modal UI dialog so we should take over the command execution
// wait context. That means the command system won't attempt to show its own wait dialog
// and also will take it into consideration when measuring command handling duration.
context.WaitContext.TakeOwnership();
context.OperationContext.TakeOwnership();
finalSolution = previewService.PreviewChanges(
string.Format(EditorFeaturesResources.Preview_Changes_0, EditorFeaturesResources.Change_Signature),
"vs.csharp.refactoring.preview",
......
......@@ -91,7 +91,7 @@ internal bool ExecuteCommand(ITextView textView, ITextBuffer subjectBuffer, Oper
var message = operation == Operation.Comment ? EditorFeaturesResources.Commenting_currently_selected_text
: EditorFeaturesResources.Uncommenting_currently_selected_text;
using (context.WaitContext.AddScope(allowCancellation: false, message))
using (context.OperationContext.AddScope(allowCancellation: false, message))
{
var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
......
......@@ -575,9 +575,9 @@ public bool ExecuteCommand(InsertCommentCommandArgs args, CommandExecutionContex
{
var originalCaretPosition = args.TextView.GetCaretPoint(args.SubjectBuffer) ?? -1;
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Inserting_documentation_comment))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Inserting_documentation_comment))
{
return CompleteComment(args.SubjectBuffer, args.TextView, originalCaretPosition, InsertOnCommandInvoke, context.WaitContext.UserCancellationToken);
return CompleteComment(args.SubjectBuffer, args.TextView, originalCaretPosition, InsertOnCommandInvoke, context.OperationContext.UserCancellationToken);
}
}
......
......@@ -42,7 +42,7 @@ public void ExecuteCommand(TypeCharCommandArgs args, Action nextHandler, Command
return;
}
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Completing_Tag))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Completing_Tag))
{
var buffer = args.SubjectBuffer;
......@@ -61,7 +61,7 @@ public void ExecuteCommand(TypeCharCommandArgs args, Action nextHandler, Command
return;
}
TryCompleteTag(args.TextView, args.SubjectBuffer, document, position.Value, context.WaitContext.UserCancellationToken);
TryCompleteTag(args.TextView, args.SubjectBuffer, document, position.Value, context.OperationContext.UserCancellationToken);
}
}
......
......@@ -50,7 +50,7 @@ public bool ExecuteCommand(EncapsulateFieldCommandArgs args, CommandExecutionCon
return false;
}
using (var waitScope = context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Applying_Encapsulate_Field_refactoring))
using (var waitScope = context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Applying_Encapsulate_Field_refactoring))
{
return Execute(args, waitScope);
}
......
......@@ -68,7 +68,7 @@ public bool ExecuteCommand(ExtractInterfaceCommandArgs args, CommandExecutionCon
// We are about to show a modal UI dialog so we should take over the command execution
// wait context. That means the command system won't attempt to show its own wait dialog
// and also will take it into consideration when measuring command handling duration.
context.WaitContext.TakeOwnership();
context.OperationContext.TakeOwnership();
var extractInterfaceService = document.GetLanguageService<AbstractExtractInterfaceService>();
var result = extractInterfaceService.ExtractInterface(
document,
......
......@@ -91,9 +91,9 @@ public bool ExecuteCommand(ExtractMethodCommandArgs args, CommandExecutionContex
_renameService.ActiveSession.Commit();
}
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Applying_Extract_Method_refactoring))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Applying_Extract_Method_refactoring))
{
return Execute(args.SubjectBuffer, args.TextView, context.WaitContext);
return Execute(args.SubjectBuffer, args.TextView, context.OperationContext);
}
}
......
......@@ -40,9 +40,9 @@ private bool TryExecuteCommand(FormatDocumentCommandArgs args, CommandExecutionC
return false;
}
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Formatting_document))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Formatting_document))
{
Format(args.TextView, document, null, context.WaitContext.UserCancellationToken);
Format(args.TextView, document, null, context.OperationContext.UserCancellationToken);
}
return true;
......
......@@ -43,7 +43,7 @@ private bool TryExecuteCommand(FormatSelectionCommandArgs args, CommandExecution
return false;
}
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Formatting_currently_selected_text))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Formatting_currently_selected_text))
{
var buffer = args.SubjectBuffer;
......@@ -56,7 +56,7 @@ private bool TryExecuteCommand(FormatSelectionCommandArgs args, CommandExecution
var formattingSpan = selection[0].Span.ToTextSpan();
Format(args.TextView, document, formattingSpan, context.WaitContext.UserCancellationToken);
Format(args.TextView, document, formattingSpan, context.OperationContext.UserCancellationToken);
// make behavior same as dev12.
// make sure we set selection back and set caret position at the end of selection
......
......@@ -25,9 +25,9 @@ public VSCommanding.CommandState GetCommandState(PasteCommandArgs args, Func<VSC
public void ExecuteCommand(PasteCommandArgs args, Action nextHandler, CommandExecutionContext context)
{
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Formatting_pasted_text))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Formatting_pasted_text))
{
ExecuteCommandWorker(args, nextHandler, context.WaitContext.UserCancellationToken);
ExecuteCommandWorker(args, nextHandler, context.OperationContext.UserCancellationToken);
}
}
......
......@@ -38,9 +38,9 @@ public VSCommanding.CommandState GetCommandState(OrganizeDocumentCommandArgs arg
public bool ExecuteCommand(OrganizeDocumentCommandArgs args, CommandExecutionContext context)
{
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Organizing_document))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Organizing_document))
{
this.Organize(args.SubjectBuffer, context.WaitContext.UserCancellationToken);
this.Organize(args.SubjectBuffer, context.OperationContext.UserCancellationToken);
}
return true;
......@@ -91,9 +91,9 @@ private bool IsCommandSupported(EditorCommandArgs args, out Workspace workspace)
public bool ExecuteCommand(SortAndRemoveUnnecessaryImportsCommandArgs args, CommandExecutionContext context)
{
using (context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Organizing_document))
using (context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Organizing_document))
{
this.SortAndRemoveUnusedImports(args.SubjectBuffer, context.WaitContext.UserCancellationToken);
this.SortAndRemoveUnusedImports(args.SubjectBuffer, context.OperationContext.UserCancellationToken);
}
return true;
......
......@@ -12,7 +12,7 @@ internal class TestUIThreadOperationContext : AbstractUIThreadOperationContext
private int _updates;
public TestUIThreadOperationContext(int maxUpdates)
:base(allowCancellation: false, description: "")
:base(allowCancellation: false, defaultDescription: "")
{
_maxUpdates = maxUpdates;
_cancellationTokenSource = new CancellationTokenSource();
......
......@@ -64,14 +64,14 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Return
End If
Using context.WaitContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_Document)
Using context.OperationContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_Document)
Dim buffer = args.SubjectBuffer
Dim snapshot = buffer.CurrentSnapshot
Dim wholeFile = snapshot.GetFullSpan()
Dim commitBufferManager = _bufferManagerFactory.CreateForBuffer(buffer)
commitBufferManager.ExpandDirtyRegion(wholeFile)
commitBufferManager.CommitDirty(isExplicitFormat:=True, cancellationToken:=context.WaitContext.UserCancellationToken)
commitBufferManager.CommitDirty(isExplicitFormat:=True, cancellationToken:=context.OperationContext.UserCancellationToken)
End Using
End Sub
......@@ -85,7 +85,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Return
End If
Using context.WaitContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_Document)
Using context.OperationContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_Document)
Dim buffer = args.SubjectBuffer
Dim selections = args.TextView.Selection.GetSnapshotSpansOnBuffer(buffer)
......@@ -100,7 +100,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Dim selectedSpan = New SnapshotSpan(snapshot, textspan.Start, textspan.Length)
Dim commitBufferManager = _bufferManagerFactory.CreateForBuffer(buffer)
commitBufferManager.ExpandDirtyRegion(selectedSpan)
commitBufferManager.CommitDirty(isExplicitFormat:=True, cancellationToken:=context.WaitContext.UserCancellationToken)
commitBufferManager.CommitDirty(isExplicitFormat:=True, cancellationToken:=context.OperationContext.UserCancellationToken)
Next
End Using
......@@ -212,8 +212,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
End Function
Public Sub ExecuteCommand(args As PasteCommandArgs, nextHandler As Action, context As CommandExecutionContext) Implements IChainedCommandHandler(Of PasteCommandArgs).ExecuteCommand
Using context.WaitContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_pasted_text)
CommitOnPaste(args, nextHandler, context.WaitContext.UserCancellationToken)
Using context.OperationContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_pasted_text)
CommitOnPaste(args, nextHandler, context.OperationContext.UserCancellationToken)
End Using
End Sub
......@@ -257,9 +257,9 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Public Sub ExecuteCommand(args As SaveCommandArgs, nextHandler As Action, context As CommandExecutionContext) Implements IChainedCommandHandler(Of SaveCommandArgs).ExecuteCommand
If args.SubjectBuffer.GetFeatureOnOffOption(InternalFeatureOnOffOptions.FormatOnSave) Then
Using context.WaitContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_Document)
Using context.OperationContext.AddScope(allowCancellation:=True, VBEditorResources.Formatting_Document)
Using transaction = _textUndoHistoryRegistry.GetHistory(args.TextView.TextBuffer).CreateTransaction(VBEditorResources.Format_on_Save)
_bufferManagerFactory.CreateForBuffer(args.SubjectBuffer).CommitDirty(isExplicitFormat:=False, cancellationToken:=context.WaitContext.UserCancellationToken)
_bufferManagerFactory.CreateForBuffer(args.SubjectBuffer).CommitDirty(isExplicitFormat:=False, cancellationToken:=context.OperationContext.UserCancellationToken)
' We should only create the transaction if anything actually happened
If transaction.UndoPrimitives.Any() Then
......
......@@ -59,9 +59,9 @@ VSCommanding.CommandState VSCommanding.ICommandHandler<ExecuteInInteractiveComma
bool VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteCommand(ExecuteInInteractiveCommandArgs args, CommandExecutionContext context)
{
var window = OpenInteractiveWindow(focus: false);
using (context.WaitContext.AddScope(allowCancellation: true, InteractiveEditorFeaturesResources.Executing_selection_in_Interactive_Window))
using (context.OperationContext.AddScope(allowCancellation: true, InteractiveEditorFeaturesResources.Executing_selection_in_Interactive_Window))
{
string submission = GetSelectedText(args, context.WaitContext.UserCancellationToken);
string submission = GetSelectedText(args, context.OperationContext.UserCancellationToken);
if (!String.IsNullOrWhiteSpace(submission))
{
window.SubmitAsync(new string[] { submission });
......@@ -107,10 +107,10 @@ private void CopyToWindow(IInteractiveWindow window, CopyToInteractiveCommandArg
using (var edit = buffer.CreateEdit())
{
using (var waitScope = context.WaitContext.AddScope(allowCancellation: true,
using (var waitScope = context.OperationContext.AddScope(allowCancellation: true,
InteractiveEditorFeaturesResources.Copying_selection_to_Interactive_Window))
{
var text = GetSelectedText(args, context.WaitContext.UserCancellationToken);
var text = GetSelectedText(args, context.OperationContext.UserCancellationToken);
// If the last line isn't empty in the existing submission buffer, we will prepend a
// newline
......
......@@ -43,9 +43,9 @@ public bool ExecuteCommand(ViewCallHierarchyCommandArgs args, CommandExecutionCo
private void AddRootNode(ViewCallHierarchyCommandArgs args, CommandExecutionContext context)
{
using (var waitScope = context.WaitContext.AddScope(allowCancellation: true, EditorFeaturesResources.Computing_Call_Hierarchy_Information))
using (var waitScope = context.OperationContext.AddScope(allowCancellation: true, EditorFeaturesResources.Computing_Call_Hierarchy_Information))
{
var cancellationToken = context.WaitContext.UserCancellationToken;
var cancellationToken = context.OperationContext.UserCancellationToken;
var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
if (document == null)
{
......
......@@ -44,7 +44,7 @@ public bool ExecuteCommand(SyncClassViewCommandArgs args, CommandExecutionContex
var snapshot = args.SubjectBuffer.CurrentSnapshot;
using (var waitScope = context.WaitContext.AddScope(allowCancellation: true, string.Format(ServicesVSResources.Synchronizing_with_0, ClassView)))
using (var waitScope = context.OperationContext.AddScope(allowCancellation: true, string.Format(ServicesVSResources.Synchronizing_with_0, ClassView)))
{
var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
if (document == null)
......@@ -64,7 +64,7 @@ public bool ExecuteCommand(SyncClassViewCommandArgs args, CommandExecutionContex
return true;
}
var userCancellationToken = context.WaitContext.UserCancellationToken;
var userCancellationToken = context.OperationContext.UserCancellationToken;
var semanticModel = document
.GetSemanticModelAsync(userCancellationToken)
.WaitAndGetResult(userCancellationToken);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册