Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
bd97036b
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,发现更多精彩内容 >>
提交
bd97036b
编写于
5月 06, 2020
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove duplicate calls to ThrowIfCancellationRequested
上级
6137d0eb
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
0 addition
and
22 deletion
+0
-22
src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
...itorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
+0
-2
src/EditorFeatures/Core/GoToDefinition/AbstractGoToSymbolService.cs
...Features/Core/GoToDefinition/AbstractGoToSymbolService.cs
+0
-1
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
...rFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
+0
-1
src/EditorFeatures/Core/Implementation/IntelliSense/ModelComputation.cs
...ures/Core/Implementation/IntelliSense/ModelComputation.cs
+0
-1
src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController_ModelComputation.cs
...NavigationBar/NavigationBarController_ModelComputation.cs
+0
-1
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.TrackingSession.cs
...eTracking/RenameTrackingTaggerProvider.TrackingSession.cs
+0
-2
src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs
...ore/Shared/Utilities/ForegroundThreadAffinitizedObject.cs
+0
-1
src/VisualStudio/CSharp/Impl/EventHookup/EventHookupSessionManager_EventHookupSession.cs
...entHookup/EventHookupSessionManager_EventHookupSession.cs
+0
-1
src/VisualStudio/CSharp/Impl/LanguageService/CSharpCodeCleanupFixer.cs
...dio/CSharp/Impl/LanguageService/CSharpCodeCleanupFixer.cs
+0
-2
src/VisualStudio/Core/Def/Implementation/DesignerAttribute/VisualStudioDesignerAttributeService.cs
...DesignerAttribute/VisualStudioDesignerAttributeService.cs
+0
-2
src/VisualStudio/Core/Def/Implementation/Experimentation/KeybindingResetDetector.cs
...Implementation/Experimentation/KeybindingResetDetector.cs
+0
-2
src/VisualStudio/Core/Def/Packaging/PackageInstallerServiceFactory.cs
...udio/Core/Def/Packaging/PackageInstallerServiceFactory.cs
+0
-2
src/VisualStudio/IntegrationTest/TestSetup/IntegrationTestServicePackage.cs
...ntegrationTest/TestSetup/IntegrationTestServicePackage.cs
+0
-1
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/InProcComponent.cs
...ntegrationTest/TestUtilities/InProcess/InProcComponent.cs
+0
-2
src/VisualStudio/LiveShare/Impl/Client/RemoteLanguageServiceWorkspaceHost.cs
...veShare/Impl/Client/RemoteLanguageServiceWorkspaceHost.cs
+0
-1
未找到文件。
src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
浏览文件 @
bd97036b
...
...
@@ -309,7 +309,6 @@ private void UpdateReferenceLocationsTask(JoinableTask<IInlineRenameLocationSet>
// follow the originally-intended design.
// https://github.com/dotnet/roslyn/issues/40890
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
_cancellationTokenSource
.
Token
);
_cancellationTokenSource
.
Token
.
ThrowIfCancellationRequested
();
RaiseSessionSpansUpdated
(
inlineRenameLocations
.
Locations
.
ToImmutableArray
());
...
...
@@ -583,7 +582,6 @@ private void QueueApplyReplacements()
async
t
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
_conflictResolutionTaskCancellationSource
.
Token
);
_conflictResolutionTaskCancellationSource
.
Token
.
ThrowIfCancellationRequested
();
ApplyReplacements
(
t
.
Result
.
replacementInfo
,
t
.
Result
.
mergeResult
,
_conflictResolutionTaskCancellationSource
.
Token
);
},
...
...
src/EditorFeatures/Core/GoToDefinition/AbstractGoToSymbolService.cs
浏览文件 @
bd97036b
...
...
@@ -38,7 +38,6 @@ public async Task GetSymbolsAsync(GoToSymbolContext context)
// This means we have to query for "third party navigation", from
// XAML, etc. That call has to be done on the UI thread.
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
var
solution
=
document
.
Project
.
Solution
;
var
definitions
=
GoToDefinitionHelpers
.
GetDefinitions
(
symbol
,
solution
,
thirdPartyNavigationAllowed
:
true
,
cancellationToken
)
...
...
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
浏览文件 @
bd97036b
...
...
@@ -637,7 +637,6 @@ private async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project p
// Have to see if this fix is still applicable. Jump to the foreground thread
// to make that check.
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
var
applicable
=
fix
.
Action
.
IsApplicable
(
document
.
Project
.
Solution
.
Workspace
);
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/ModelComputation.cs
浏览文件 @
bd97036b
...
...
@@ -151,7 +151,6 @@ public virtual void Stop()
async
tasks
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
_stopCancellationToken
);
_stopCancellationToken
.
ThrowIfCancellationRequested
();
if
(
tasks
.
All
(
t
=>
t
.
Status
==
TaskStatus
.
RanToCompletion
))
{
...
...
src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController_ModelComputation.cs
浏览文件 @
bd97036b
...
...
@@ -146,7 +146,6 @@ private void StartSelectedItemUpdateTask(int delay, bool updateUIWhenDone)
async
t
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
PushSelectedItemsToPresenter
(
t
.
Result
);
},
...
...
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.TrackingSession.cs
浏览文件 @
bd97036b
...
...
@@ -79,7 +79,6 @@ public TrackingSession(StateMachine stateMachine, SnapshotSpan snapshotSpan, IAs
async
t
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
_cancellationToken
);
_cancellationToken
.
ThrowIfCancellationRequested
();
stateMachine
.
UpdateTrackingSessionIfRenamable
();
},
...
...
@@ -107,7 +106,6 @@ private void QueueUpdateToStateMachine(StateMachine stateMachine, Task task)
task
.
SafeContinueWithFromAsync
(
async
t
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
_cancellationToken
);
_cancellationToken
.
ThrowIfCancellationRequested
();
if
(
_isRenamableIdentifierTask
.
Result
!=
TriggerIdentifierKind
.
NotRenamable
)
{
...
...
src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs
浏览文件 @
bd97036b
...
...
@@ -85,7 +85,6 @@ public Task InvokeBelowInputPriorityAsync(Action action, CancellationToken cance
async
()
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
action
();
},
...
...
src/VisualStudio/CSharp/Impl/EventHookup/EventHookupSessionManager_EventHookupSession.cs
浏览文件 @
bd97036b
...
...
@@ -124,7 +124,6 @@ public void Cancel()
async
t
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
if
(
t
.
Result
!=
null
)
{
...
...
src/VisualStudio/CSharp/Impl/LanguageService/CSharpCodeCleanupFixer.cs
浏览文件 @
bd97036b
...
...
@@ -78,7 +78,6 @@ private async Task<bool> FixHierarchyContentAsync(IVsHierarchyCodeCleanupScope h
var
hierarchyToProjectMap
=
_workspace
.
Services
.
GetRequiredService
<
IHierarchyItemToProjectIdMap
>();
await
_threadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
context
.
OperationContext
.
UserCancellationToken
);
context
.
OperationContext
.
UserCancellationToken
.
ThrowIfCancellationRequested
();
ProjectId
projectId
=
null
;
if
(
ErrorHandler
.
Succeeded
(
hierarchy
.
GetProperty
((
uint
)
VSConstants
.
VSITEMID
.
Root
,
(
int
)
__VSHPROPID8
.
VSHPROPID_ActiveIntellisenseProjectContext
,
out
var
contextProjectNameObject
))
...
...
@@ -224,7 +223,6 @@ async Task<Solution> ApplyFixAsync(ProgressTracker progressTracker, Cancellation
var
solution
=
await
applyFixAsync
(
progressTracker
,
cancellationToken
).
ConfigureAwait
(
true
);
await
_threadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
return
workspace
.
TryApplyChanges
(
solution
,
progressTracker
);
}
...
...
src/VisualStudio/Core/Def/Implementation/DesignerAttribute/VisualStudioDesignerAttributeService.cs
浏览文件 @
bd97036b
...
...
@@ -188,7 +188,6 @@ private void AddFilteredInfos(ImmutableArray<DesignerAttributeData> data, ArrayB
{
// legacy project system can only be talked to on the UI thread.
await
_threadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
AssertIsForeground
();
...
...
@@ -287,7 +286,6 @@ private void AddFilteredInfos(ImmutableArray<DesignerAttributeData> data, ArrayB
if
(!
_cpsProjects
.
TryGetValue
(
projectId
,
out
var
updateService
))
{
await
_threadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
this
.
AssertIsForeground
();
updateService
=
ComputeUpdateService
();
...
...
src/VisualStudio/Core/Def/Implementation/Experimentation/KeybindingResetDetector.cs
浏览文件 @
bd97036b
...
...
@@ -313,7 +313,6 @@ async Task<OLECMDF> QueryStatusAsync(uint cmdId)
cmds
[
0
].
cmdf
=
0
;
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
var
hr
=
_oleCommandTarget
.
QueryStatus
(
ReSharperCommandGroup
,
(
uint
)
cmds
.
Length
,
cmds
,
IntPtr
.
Zero
);
if
(
ErrorHandler
.
Failed
(
hr
))
...
...
@@ -335,7 +334,6 @@ async Task EnsureOleCommandTargetAsync()
}
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
_oleCommandTarget
=
_serviceProvider
.
GetService
<
IOleCommandTarget
,
SUIHostCommandDispatcher
>();
}
...
...
src/VisualStudio/Core/Def/Packaging/PackageInstallerServiceFactory.cs
浏览文件 @
bd97036b
...
...
@@ -398,7 +398,6 @@ private void OnWorkspaceChanged(bool localSolutionChanged, ProjectId localChange
async
_
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
alwaysYield
:
true
,
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
ProcessBatchedChangesOnForeground
(
cancellationToken
);
},
...
...
@@ -443,7 +442,6 @@ private void ProcessBatchedChangesOnForeground(CancellationToken cancellationTok
async
()
=>
{
await
ThreadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
ProcessBatchedChangesOnForeground
(
cancellationToken
);
},
...
...
src/VisualStudio/IntegrationTest/TestSetup/IntegrationTestServicePackage.cs
浏览文件 @
bd97036b
...
...
@@ -20,7 +20,6 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
{
await
base
.
InitializeAsync
(
cancellationToken
,
progress
).
ConfigureAwait
(
true
);
await
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
var
shell
=
(
IVsShell
)
await
GetServiceAsync
(
typeof
(
SVsShell
));
ErrorHandler
.
ThrowOnFailure
(
shell
.
IsPackageInstalled
(
s_compilerPackage
,
out
var
installed
));
...
...
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/InProcComponent.cs
浏览文件 @
bd97036b
...
...
@@ -53,7 +53,6 @@ protected static void InvokeOnUIThread(Action<CancellationToken> action)
var
operation
=
JoinableTaskFactory
.
RunAsync
(
async
()
=>
{
await
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationTokenSource
.
Token
);
cancellationTokenSource
.
Token
.
ThrowIfCancellationRequested
();
action
(
cancellationTokenSource
.
Token
);
});
...
...
@@ -67,7 +66,6 @@ protected static T InvokeOnUIThread<T>(Func<CancellationToken, T> action)
var
operation
=
JoinableTaskFactory
.
RunAsync
(
async
()
=>
{
await
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationTokenSource
.
Token
);
cancellationTokenSource
.
Token
.
ThrowIfCancellationRequested
();
return
action
(
cancellationTokenSource
.
Token
);
});
...
...
src/VisualStudio/LiveShare/Impl/Client/RemoteLanguageServiceWorkspaceHost.cs
浏览文件 @
bd97036b
...
...
@@ -102,7 +102,6 @@ public async Task EnsureProjectsLoadedAsync(CancellationToken cancellationToken)
private
async
Task
LoadRoslynPackageAsync
(
CancellationToken
cancellationToken
)
{
await
_threadingContext
.
JoinableTaskFactory
.
SwitchToMainThreadAsync
(
cancellationToken
);
cancellationToken
.
ThrowIfCancellationRequested
();
// Explicitly trigger the load of the Roslyn package. This ensures that UI-bound services are appropriately prefetched,
// that FatalError is correctly wired up, etc. Ideally once the things happening in the package initialize are cleaned up with
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录