Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a931a4e8
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a931a4e8
编写于
1月 24, 2018
作者:
O
Oleg Tkachenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Migrate to latest editor bits in 15.6stg
上级
d6fff606
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
65 addition
and
65 deletion
+65
-65
build/Targets/Packages.props
build/Targets/Packages.props
+11
-11
src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler_RenameHandler.cs
...ame/CommandHandlers/RenameCommandHandler_RenameHandler.cs
+2
-2
src/EditorFeatures/Core/CommandHandlers/GoToAdjacentMemberCommandHandler.cs
.../Core/CommandHandlers/GoToAdjacentMemberCommandHandler.cs
+3
-3
src/EditorFeatures/Core/FindReferences/FindReferencesCommandHandler.cs
...tures/Core/FindReferences/FindReferencesCommandHandler.cs
+2
-2
src/EditorFeatures/Core/GoToDefinition/GoToDefinitionCommandHandler.cs
...tures/Core/GoToDefinition/GoToDefinitionCommandHandler.cs
+3
-3
src/EditorFeatures/Core/GoToImplementation/GoToImplementationCommandHandler.cs
...re/GoToImplementation/GoToImplementationCommandHandler.cs
+3
-3
src/EditorFeatures/Core/Implementation/AutomaticCompletion/AbstractAutomaticLineEnderCommandHandler.cs
...ticCompletion/AbstractAutomaticLineEnderCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/ChangeSignature/AbstractChangeSignatureCommandHandler.cs
.../ChangeSignature/AbstractChangeSignatureCommandHandler.cs
+4
-4
src/EditorFeatures/Core/Implementation/CommentSelection/CommentUncommentSelectionCommandHandler.cs
...mmentSelection/CommentUncommentSelectionCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
...ionComments/AbstractDocumentationCommentCommandHandler.cs
+2
-2
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractXmlTagCompletionCommandHandler.cs
...ntationComments/AbstractXmlTagCompletionCommandHandler.cs
+2
-2
src/EditorFeatures/Core/Implementation/EncapsulateField/AbstractEncapsulateFieldCommandHandler.cs
...ncapsulateField/AbstractEncapsulateFieldCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/ExtractInterface/AbstractExtractInterfaceCommandHandler.cs
...xtractInterface/AbstractExtractInterfaceCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/ExtractMethod/AbstractExtractMethodCommandHandler.cs
...tion/ExtractMethod/AbstractExtractMethodCommandHandler.cs
+2
-2
src/EditorFeatures/Core/Implementation/Formatting/FormatCommandHandler.FormatDocument.cs
...ntation/Formatting/FormatCommandHandler.FormatDocument.cs
+2
-2
src/EditorFeatures/Core/Implementation/Formatting/FormatCommandHandler.FormatSelection.cs
...tation/Formatting/FormatCommandHandler.FormatSelection.cs
+2
-2
src/EditorFeatures/Core/Implementation/Formatting/FormatCommandHandler.Paste.cs
...e/Implementation/Formatting/FormatCommandHandler.Paste.cs
+2
-2
src/EditorFeatures/Core/Implementation/Organizing/OrganizeDocumentCommandHandler.cs
...plementation/Organizing/OrganizeDocumentCommandHandler.cs
+4
-4
src/EditorFeatures/TestUtilities/Utilities/TestUIThreadOperationContext.cs
...s/TestUtilities/Utilities/TestUIThreadOperationContext.cs
+1
-1
src/EditorFeatures/VisualBasic/LineCommit/CommitCommandHandler.vb
...orFeatures/VisualBasic/LineCommit/CommitCommandHandler.vb
+8
-8
src/Interactive/EditorFeatures/Core/Extensibility/Interactive/InteractiveCommandHandler.cs
...re/Extensibility/Interactive/InteractiveCommandHandler.cs
+4
-4
src/VisualStudio/Core/Def/Implementation/CallHierarchy/CallHierarchyCommandHandler.cs
...plementation/CallHierarchy/CallHierarchyCommandHandler.cs
+2
-2
src/VisualStudio/Core/Def/Implementation/Library/ClassView/AbstractSyncClassViewCommandHandler.cs
.../Library/ClassView/AbstractSyncClassViewCommandHandler.cs
+2
-2
未找到文件。
build/Targets/Packages.props
浏览文件 @
a931a4e8
...
...
@@ -72,24 +72,24 @@
<MicrosoftVisualStudioCodeAnalysisSdkUIVersion>
15.0.26730-alpha
</MicrosoftVisualStudioCodeAnalysisSdkUIVersion>
<MicrosoftVisualStudioComponentModelHostVersion>
15.0.26730-alpha
</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioCompositionVersion>
15.5.23
</MicrosoftVisualStudioCompositionVersion>
<MicrosoftVisualStudioCoreUtilityVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioCoreUtilityVersion>
15.6.2
81
-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.2
53
-preview
</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioEditorVersion>
15.6.2
81
-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.2
53
-preview
</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioOLEInteropVersion>
7.10.6070
</MicrosoftVisualStudioOLEInteropVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>
15.6.2
81
-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.2
53
-preview
</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>
15.6.2
53
-preview
</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextDataVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>
15.6.2
81
-preview
</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextManagerInteropVersion>
7.10.6070
</MicrosoftVisualStudioTextManagerInteropVersion>
<MicrosoftVisualStudioTextManagerInterop100Version>
10.0.30319
</MicrosoftVisualStudioTextManagerInterop100Version>
<MicrosoftVisualStudioTextManagerInterop120Version>
12.0.30110
</MicrosoftVisualStudioTextManagerInterop120Version>
...
...
src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler_RenameHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -47,9 +47,9 @@ public VSCommanding.CommandState GetCommandState(RenameCommandArgs args, Func<VS
public
void
ExecuteCommand
(
RenameCommandArgs
args
,
Action
nextHandler
,
CommandExecutionContext
context
)
{
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Finding_token_to_rename
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Finding_token_to_rename
))
{
ExecuteRenameWorker
(
args
,
context
.
Wait
Context
.
UserCancellationToken
);
ExecuteRenameWorker
(
args
,
context
.
Operation
Context
.
UserCancellationToken
);
}
}
...
...
src/EditorFeatures/Core/CommandHandlers/GoToAdjacentMemberCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -92,10 +92,10 @@ private bool ExecuteCommandImpl(EditorCommandArgs args, bool gotoNextMember, Com
int
?
targetPosition
=
null
;
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
description
:
EditorFeaturesResources
.
Navigating
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
description
:
EditorFeaturesResources
.
Navigating
))
{
var
task
=
GetTargetPositionAsync
(
document
,
caretPoint
.
Value
.
Position
,
gotoNextMember
,
context
.
Wait
Context
.
UserCancellationToken
);
targetPosition
=
task
.
WaitAndGetResult
(
context
.
Wait
Context
.
UserCancellationToken
);
var
task
=
GetTargetPositionAsync
(
document
,
caretPoint
.
Value
.
Position
,
gotoNextMember
,
context
.
Operation
Context
.
UserCancellationToken
);
targetPosition
=
task
.
WaitAndGetResult
(
context
.
Operation
Context
.
UserCancellationToken
);
}
if
(
targetPosition
!=
null
)
...
...
src/EditorFeatures/Core/FindReferences/FindReferencesCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -165,11 +165,11 @@ private IStreamingFindUsagesPresenter GetStreamingPresenter()
internal
void
FindReferences
(
Document
document
,
IFindReferencesService
service
,
int
caretPosition
,
CommandExecutionContext
context
)
{
using
(
var
waitScope
=
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Finding_references
))
using
(
var
waitScope
=
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Finding_references
))
using
(
Logger
.
LogBlock
(
FunctionId
.
CommandHandler_FindAllReference
,
KeyValueLogMessage
.
Create
(
LogType
.
UserAction
,
m
=>
m
[
"type"
]
=
"legacy"
),
context
.
Wait
Context
.
UserCancellationToken
))
context
.
Operation
Context
.
UserCancellationToken
))
{
if
(!
service
.
TryFindReferences
(
document
,
caretPosition
,
new
WaitContextAdapter
(
waitScope
)))
{
...
...
src/EditorFeatures/Core/GoToDefinition/GoToDefinitionCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -63,10 +63,10 @@ internal bool TryExecuteCommand(Document document, int caretPosition, IGoToDefin
{
string
errorMessage
=
null
;
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Navigating_to_definition
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Navigating_to_definition
))
{
if
(
goToDefinitionService
!=
null
&&
goToDefinitionService
.
TryGoToDefinition
(
document
,
caretPosition
,
context
.
Wait
Context
.
UserCancellationToken
))
goToDefinitionService
.
TryGoToDefinition
(
document
,
caretPosition
,
context
.
Operation
Context
.
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
.
Wait
Context
.
TakeOwnership
();
context
.
Operation
Context
.
TakeOwnership
();
var
workspace
=
document
.
Project
.
Solution
.
Workspace
;
var
notificationService
=
workspace
.
Services
.
GetService
<
INotificationService
>();
notificationService
.
SendNotification
(
errorMessage
,
title
:
EditorFeaturesResources
.
Go_to_Definition
,
severity
:
NotificationSeverity
.
Information
);
...
...
src/EditorFeatures/Core/GoToImplementation/GoToImplementationCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -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
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Locating_implementations
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Locating_implementations
))
{
var
userCancellationToken
=
context
.
Wait
Context
.
UserCancellationToken
;
var
userCancellationToken
=
context
.
Operation
Context
.
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
.
Wait
Context
.
TakeOwnership
();
context
.
Operation
Context
.
TakeOwnership
();
var
notificationService
=
document
.
Project
.
Solution
.
Workspace
.
Services
.
GetService
<
INotificationService
>();
notificationService
.
SendNotification
(
messageToShow
,
title
:
EditorFeaturesResources
.
Go_To_Implementation
,
...
...
src/EditorFeatures/Core/Implementation/AutomaticCompletion/AbstractAutomaticLineEnderCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -80,7 +80,7 @@ public void ExecuteCommand(AutomaticLineEnderCommandArgs args, Action nextHandle
return
;
}
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
false
,
EditorFeaturesResources
.
Automatically_completing
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
false
,
EditorFeaturesResources
.
Automatically_completing
))
{
// This is a non cancellable command
var
userCancellationToken
=
CancellationToken
.
None
;
...
...
src/EditorFeatures/Core/Implementation/ChangeSignature/AbstractChangeSignatureCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -80,7 +80,7 @@ private bool ExecuteCommand(ITextView textView, ITextBuffer subjectBuffer, Comma
ChangeSignatureResult
result
=
null
;
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
FeaturesResources
.
Change_signature
))
using
(
context
.
Operation
Context
.
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
.
Wait
Context
.
TakeOwnership
();
context
.
Operation
Context
.
TakeOwnership
();
workspace
.
Services
.
GetService
<
INotificationService
>().
SendNotification
(
errorMessage
,
severity
:
severity
);
},
context
.
Wait
Context
.
UserCancellationToken
);
context
.
Operation
Context
.
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
.
Wait
Context
.
TakeOwnership
();
context
.
Operation
Context
.
TakeOwnership
();
finalSolution
=
previewService
.
PreviewChanges
(
string
.
Format
(
EditorFeaturesResources
.
Preview_Changes_0
,
EditorFeaturesResources
.
Change_Signature
),
"vs.csharp.refactoring.preview"
,
...
...
src/EditorFeatures/Core/Implementation/CommentSelection/CommentUncommentSelectionCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -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
.
Wait
Context
.
AddScope
(
allowCancellation
:
false
,
message
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
false
,
message
))
{
var
document
=
subjectBuffer
.
CurrentSnapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
...
...
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -575,9 +575,9 @@ public bool ExecuteCommand(InsertCommentCommandArgs args, CommandExecutionContex
{
var
originalCaretPosition
=
args
.
TextView
.
GetCaretPoint
(
args
.
SubjectBuffer
)
??
-
1
;
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Inserting_documentation_comment
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Inserting_documentation_comment
))
{
return
CompleteComment
(
args
.
SubjectBuffer
,
args
.
TextView
,
originalCaretPosition
,
InsertOnCommandInvoke
,
context
.
Wait
Context
.
UserCancellationToken
);
return
CompleteComment
(
args
.
SubjectBuffer
,
args
.
TextView
,
originalCaretPosition
,
InsertOnCommandInvoke
,
context
.
Operation
Context
.
UserCancellationToken
);
}
}
...
...
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractXmlTagCompletionCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -42,7 +42,7 @@ public void ExecuteCommand(TypeCharCommandArgs args, Action nextHandler, Command
return
;
}
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Completing_Tag
))
using
(
context
.
Operation
Context
.
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
.
Wait
Context
.
UserCancellationToken
);
TryCompleteTag
(
args
.
TextView
,
args
.
SubjectBuffer
,
document
,
position
.
Value
,
context
.
Operation
Context
.
UserCancellationToken
);
}
}
...
...
src/EditorFeatures/Core/Implementation/EncapsulateField/AbstractEncapsulateFieldCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -50,7 +50,7 @@ public bool ExecuteCommand(EncapsulateFieldCommandArgs args, CommandExecutionCon
return
false
;
}
using
(
var
waitScope
=
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Applying_Encapsulate_Field_refactoring
))
using
(
var
waitScope
=
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Applying_Encapsulate_Field_refactoring
))
{
return
Execute
(
args
,
waitScope
);
}
...
...
src/EditorFeatures/Core/Implementation/ExtractInterface/AbstractExtractInterfaceCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -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
.
Wait
Context
.
TakeOwnership
();
context
.
Operation
Context
.
TakeOwnership
();
var
extractInterfaceService
=
document
.
GetLanguageService
<
AbstractExtractInterfaceService
>();
var
result
=
extractInterfaceService
.
ExtractInterface
(
document
,
...
...
src/EditorFeatures/Core/Implementation/ExtractMethod/AbstractExtractMethodCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -91,9 +91,9 @@ public bool ExecuteCommand(ExtractMethodCommandArgs args, CommandExecutionContex
_renameService
.
ActiveSession
.
Commit
();
}
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Applying_Extract_Method_refactoring
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Applying_Extract_Method_refactoring
))
{
return
Execute
(
args
.
SubjectBuffer
,
args
.
TextView
,
context
.
Wait
Context
);
return
Execute
(
args
.
SubjectBuffer
,
args
.
TextView
,
context
.
Operation
Context
);
}
}
...
...
src/EditorFeatures/Core/Implementation/Formatting/FormatCommandHandler.FormatDocument.cs
浏览文件 @
a931a4e8
...
...
@@ -40,9 +40,9 @@ private bool TryExecuteCommand(FormatDocumentCommandArgs args, CommandExecutionC
return
false
;
}
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Formatting_document
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Formatting_document
))
{
Format
(
args
.
TextView
,
document
,
null
,
context
.
Wait
Context
.
UserCancellationToken
);
Format
(
args
.
TextView
,
document
,
null
,
context
.
Operation
Context
.
UserCancellationToken
);
}
return
true
;
...
...
src/EditorFeatures/Core/Implementation/Formatting/FormatCommandHandler.FormatSelection.cs
浏览文件 @
a931a4e8
...
...
@@ -43,7 +43,7 @@ private bool TryExecuteCommand(FormatSelectionCommandArgs args, CommandExecution
return
false
;
}
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Formatting_currently_selected_text
))
using
(
context
.
Operation
Context
.
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
.
Wait
Context
.
UserCancellationToken
);
Format
(
args
.
TextView
,
document
,
formattingSpan
,
context
.
Operation
Context
.
UserCancellationToken
);
// make behavior same as dev12.
// make sure we set selection back and set caret position at the end of selection
...
...
src/EditorFeatures/Core/Implementation/Formatting/FormatCommandHandler.Paste.cs
浏览文件 @
a931a4e8
...
...
@@ -25,9 +25,9 @@ public VSCommanding.CommandState GetCommandState(PasteCommandArgs args, Func<VSC
public
void
ExecuteCommand
(
PasteCommandArgs
args
,
Action
nextHandler
,
CommandExecutionContext
context
)
{
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Formatting_pasted_text
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Formatting_pasted_text
))
{
ExecuteCommandWorker
(
args
,
nextHandler
,
context
.
Wait
Context
.
UserCancellationToken
);
ExecuteCommandWorker
(
args
,
nextHandler
,
context
.
Operation
Context
.
UserCancellationToken
);
}
}
...
...
src/EditorFeatures/Core/Implementation/Organizing/OrganizeDocumentCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -38,9 +38,9 @@ public VSCommanding.CommandState GetCommandState(OrganizeDocumentCommandArgs arg
public
bool
ExecuteCommand
(
OrganizeDocumentCommandArgs
args
,
CommandExecutionContext
context
)
{
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Organizing_document
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Organizing_document
))
{
this
.
Organize
(
args
.
SubjectBuffer
,
context
.
Wait
Context
.
UserCancellationToken
);
this
.
Organize
(
args
.
SubjectBuffer
,
context
.
Operation
Context
.
UserCancellationToken
);
}
return
true
;
...
...
@@ -91,9 +91,9 @@ private bool IsCommandSupported(EditorCommandArgs args, out Workspace workspace)
public
bool
ExecuteCommand
(
SortAndRemoveUnnecessaryImportsCommandArgs
args
,
CommandExecutionContext
context
)
{
using
(
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Organizing_document
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Organizing_document
))
{
this
.
SortAndRemoveUnusedImports
(
args
.
SubjectBuffer
,
context
.
Wait
Context
.
UserCancellationToken
);
this
.
SortAndRemoveUnusedImports
(
args
.
SubjectBuffer
,
context
.
Operation
Context
.
UserCancellationToken
);
}
return
true
;
...
...
src/EditorFeatures/TestUtilities/Utilities/TestUIThreadOperationContext.cs
浏览文件 @
a931a4e8
...
...
@@ -12,7 +12,7 @@ internal class TestUIThreadOperationContext : AbstractUIThreadOperationContext
private
int
_updates
;
public
TestUIThreadOperationContext
(
int
maxUpdates
)
:
base
(
allowCancellation
:
false
,
description
:
""
)
:
base
(
allowCancellation
:
false
,
de
faultDe
scription
:
""
)
{
_maxUpdates
=
maxUpdates
;
_cancellationTokenSource
=
new
CancellationTokenSource
();
...
...
src/EditorFeatures/VisualBasic/LineCommit/CommitCommandHandler.vb
浏览文件 @
a931a4e8
...
...
@@ -64,14 +64,14 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Return
End
If
Using
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
=
True
,
VBEditorResources
.
Formatting_Document
)
Using
context
.
Operation
Context
.
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
.
Wait
Context
.
UserCancellationToken
)
commitBufferManager
.
CommitDirty
(
isExplicitFormat
:
=
True
,
cancellationToken
:
=
context
.
Operation
Context
.
UserCancellationToken
)
End
Using
End
Sub
...
...
@@ -85,7 +85,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Return
End
If
Using
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
=
True
,
VBEditorResources
.
Formatting_Document
)
Using
context
.
Operation
Context
.
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
.
Wait
Context
.
UserCancellationToken
)
commitBufferManager
.
CommitDirty
(
isExplicitFormat
:
=
True
,
cancellationToken
:
=
context
.
Operation
Context
.
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
.
Wait
Context
.
AddScope
(
allowCancellation
:
=
True
,
VBEditorResources
.
Formatting_pasted_text
)
CommitOnPaste
(
args
,
nextHandler
,
context
.
Wait
Context
.
UserCancellationToken
)
Using
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
=
True
,
VBEditorResources
.
Formatting_pasted_text
)
CommitOnPaste
(
args
,
nextHandler
,
context
.
Operation
Context
.
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
.
Wait
Context
.
AddScope
(
allowCancellation
:
=
True
,
VBEditorResources
.
Formatting_Document
)
Using
context
.
Operation
Context
.
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
.
Wait
Context
.
UserCancellationToken
)
_bufferManagerFactory
.
CreateForBuffer
(
args
.
SubjectBuffer
).
CommitDirty
(
isExplicitFormat
:
=
False
,
cancellationToken
:
=
context
.
Operation
Context
.
UserCancellationToken
)
' We should only create the transaction if anything actually happened
If
transaction
.
UndoPrimitives
.
Any
()
Then
...
...
src/Interactive/EditorFeatures/Core/Extensibility/Interactive/InteractiveCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -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
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
InteractiveEditorFeaturesResources
.
Executing_selection_in_Interactive_Window
))
using
(
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
InteractiveEditorFeaturesResources
.
Executing_selection_in_Interactive_Window
))
{
string
submission
=
GetSelectedText
(
args
,
context
.
Wait
Context
.
UserCancellationToken
);
string
submission
=
GetSelectedText
(
args
,
context
.
Operation
Context
.
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
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
using
(
var
waitScope
=
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
InteractiveEditorFeaturesResources
.
Copying_selection_to_Interactive_Window
))
{
var
text
=
GetSelectedText
(
args
,
context
.
Wait
Context
.
UserCancellationToken
);
var
text
=
GetSelectedText
(
args
,
context
.
Operation
Context
.
UserCancellationToken
);
// If the last line isn't empty in the existing submission buffer, we will prepend a
// newline
...
...
src/VisualStudio/Core/Def/Implementation/CallHierarchy/CallHierarchyCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -43,9 +43,9 @@ public bool ExecuteCommand(ViewCallHierarchyCommandArgs args, CommandExecutionCo
private
void
AddRootNode
(
ViewCallHierarchyCommandArgs
args
,
CommandExecutionContext
context
)
{
using
(
var
waitScope
=
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Computing_Call_Hierarchy_Information
))
using
(
var
waitScope
=
context
.
Operation
Context
.
AddScope
(
allowCancellation
:
true
,
EditorFeaturesResources
.
Computing_Call_Hierarchy_Information
))
{
var
cancellationToken
=
context
.
Wait
Context
.
UserCancellationToken
;
var
cancellationToken
=
context
.
Operation
Context
.
UserCancellationToken
;
var
document
=
args
.
SubjectBuffer
.
CurrentSnapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
if
(
document
==
null
)
{
...
...
src/VisualStudio/Core/Def/Implementation/Library/ClassView/AbstractSyncClassViewCommandHandler.cs
浏览文件 @
a931a4e8
...
...
@@ -44,7 +44,7 @@ public bool ExecuteCommand(SyncClassViewCommandArgs args, CommandExecutionContex
var
snapshot
=
args
.
SubjectBuffer
.
CurrentSnapshot
;
using
(
var
waitScope
=
context
.
Wait
Context
.
AddScope
(
allowCancellation
:
true
,
string
.
Format
(
ServicesVSResources
.
Synchronizing_with_0
,
ClassView
)))
using
(
var
waitScope
=
context
.
Operation
Context
.
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
.
Wait
Context
.
UserCancellationToken
;
var
userCancellationToken
=
context
.
Operation
Context
.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录