Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
08d22664
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,发现更多精彩内容 >>
未验证
提交
08d22664
编写于
3月 27, 2020
作者:
C
CyrusNajmabadi
提交者:
GitHub
3月 27, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #42806 from CyrusNajmabadi/makePrivate
Remove TestNotificationService.
上级
f69fc383
7ce65ed3
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
175 addition
and
227 deletion
+175
-227
src/EditorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb
...itorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb
+10
-13
src/EditorFeatures/TestUtilities/Workspaces/TestForegroundNotificationService.cs
...Utilities/Workspaces/TestForegroundNotificationService.cs
+0
-69
src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioAnalyzerTests.vb
.../Core/Test/ProjectSystemShim/VisualStudioAnalyzerTests.vb
+0
-1
src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioRuleSetTests.vb
...o/Core/Test/ProjectSystemShim/VisualStudioRuleSetTests.vb
+159
-135
src/Workspaces/Core/Portable/Utilities/TaskQueue.cs
src/Workspaces/Core/Portable/Utilities/TaskQueue.cs
+6
-9
未找到文件。
src/EditorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb
浏览文件 @
08d22664
...
...
@@ -5,7 +5,6 @@
Imports
System.Collections.Immutable
Imports
Microsoft.CodeAnalysis.CSharp
Imports
Microsoft.CodeAnalysis.Diagnostics
Imports
Microsoft.CodeAnalysis.Editor.UnitTests
Imports
Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports
Microsoft.CodeAnalysis.Shared.Options
Imports
Microsoft.CodeAnalysis.SolutionCrawler
...
...
@@ -38,7 +37,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
FilePath
=
"Test.cs"
>
class
Goo
{
}
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
...
...
@@ -51,7 +50,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
FilePath
=
"Test.cs"
>
class
Goo
{
dontcompile
}
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
Dim
diagnostics
=
<
Diagnostics
>
...
...
@@ -72,7 +71,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
class
Goo2
{
dontcompile
}
#
line
default
class
Goo4
{
dontcompile
}
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
Dim
diagnostics
=
<
Diagnostics
>
...
...
@@ -93,7 +92,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
FilePath
=
"Test.cs"
>
class
Goo
{
int
a
=
"test"
;
}
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
...
...
@@ -114,7 +113,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
class
Goo2
{
as
;
}
class
Goo3
{
long
q
=
1
l
;
}
#
pragma
disable
9999999
"
</Document>
</Document>
</Project>
</Workspace>
...
...
@@ -142,7 +141,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
FilePath
=
"Test.cs"
>
class
Program
{
void
Main
()
{
-
}
}
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
...
...
@@ -170,14 +169,14 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
int
a
=
5
-
"2"
;
}
}
</
Document
>
</
Document
>
</
Project
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
FilePath
=
"Test.vb"
>
Class
GooClass
Sub
Blah
()
End
Sub
End
Class
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
...
...
@@ -208,14 +207,14 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
int
a
=
5
-
"2"
;
}
}
</
Document
>
</
Document
>
</
Project
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
FilePath
=
"Test.vb"
>
Class
GooClass
Sub
Blah
()
End
Sub
End
Class
</
Document
>
</
Document
>
</
Project
>
</
Workspace
>
...
...
@@ -311,8 +310,6 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
Private
Function
GetDiagnosticProvider
(
workspace
As
TestWorkspace
)
As
DiagnosticAnalyzerService
Dim
snapshot
=
workspace
.
CurrentSolution
Dim
notificationService
=
New
TestForegroundNotificationService
()
Dim
compilerAnalyzersMap
=
DiagnosticExtensions
.
GetCompilerDiagnosticAnalyzersMap
().
Add
(
NoCompilationConstants
.
LanguageName
,
ImmutableArray
.
Create
(
Of
DiagnosticAnalyzer
)(
New
NoCompilationDocumentDiagnosticAnalyzer
()))
...
...
src/EditorFeatures/TestUtilities/Workspaces/TestForegroundNotificationService.cs
已删除
100644 → 0
浏览文件 @
f69fc383
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using
System
;
using
System.Collections.Generic
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Shared.TestHooks
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Editor.UnitTests
{
internal
class
TestForegroundNotificationService
:
IForegroundNotificationService
{
private
readonly
object
_gate
=
new
object
();
private
readonly
List
<
Task
>
_tasks
=
new
List
<
Task
>();
private
readonly
TaskQueue
_queue
=
new
TaskQueue
(
AsynchronousOperationListenerProvider
.
NullListener
,
TaskScheduler
.
Default
);
public
void
RegisterNotification
(
Func
<
bool
>
action
,
IAsyncToken
asyncToken
,
CancellationToken
cancellationToken
=
default
)
{
RegisterNotification
(
action
,
0
,
asyncToken
,
cancellationToken
);
}
#pragma warning disable CS0618 // Type or member is obsolete (ScheduleTaskInProgress: https://github.com/dotnet/roslyn/issues/42742)
public
void
RegisterNotification
(
Func
<
bool
>
action
,
int
delayInMS
,
IAsyncToken
asyncToken
,
CancellationToken
cancellationToken
=
default
)
{
Task
task
;
lock
(
_gate
)
{
task
=
_queue
.
ScheduleTaskInProgress
(()
=>
Execute_NoLock
(
action
,
asyncToken
,
cancellationToken
),
cancellationToken
);
_tasks
.
Add
(
task
);
}
task
.
Wait
(
cancellationToken
);
}
private
void
Execute_NoLock
(
Func
<
bool
>
action
,
IAsyncToken
asyncToken
,
CancellationToken
cancellationToken
)
{
if
(
action
())
{
asyncToken
.
Dispose
();
}
else
{
_tasks
.
Add
(
_queue
.
ScheduleTaskInProgress
(()
=>
Execute_NoLock
(
action
,
asyncToken
,
cancellationToken
),
cancellationToken
));
}
}
public
void
RegisterNotification
(
Action
action
,
IAsyncToken
asyncToken
,
CancellationToken
cancellationToken
=
default
)
{
RegisterNotification
(
action
,
0
,
asyncToken
,
cancellationToken
);
}
public
void
RegisterNotification
(
Action
action
,
int
delayInMS
,
IAsyncToken
asyncToken
,
CancellationToken
cancellationToken
=
default
)
{
Task
task
;
lock
(
_gate
)
{
task
=
_queue
.
ScheduleTaskInProgress
(
action
,
cancellationToken
).
CompletesAsyncOperation
(
asyncToken
);
_tasks
.
Add
(
task
);
}
task
.
Wait
(
cancellationToken
);
}
#pragma warning restore
}
}
src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioAnalyzerTests.vb
浏览文件 @
08d22664
...
...
@@ -11,7 +11,6 @@ Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports
Microsoft.CodeAnalysis.Test.Utilities
Imports
Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
Imports
Microsoft.VisualStudio.LanguageServices.Implementation.TaskList
Imports
Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework
Imports
Roslyn.Test.Utilities
Namespace
Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim
...
...
src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioRuleSetTests.vb
浏览文件 @
08d22664
此差异已折叠。
点击以展开。
src/Workspaces/Core/Portable/Utilities/TaskQueue.cs
浏览文件 @
08d22664
...
...
@@ -46,7 +46,7 @@ private IAsyncToken BeginOperation(string taskName)
}
#pragma warning disable VSTHRD200 // Use "Async" suffix for async methods (Task wrappers, not asynchronous methods)
#pragma warning disable CS0618 // Type or member is obsolete (https://github.com/dotnet/roslyn/issues/42742)
/// <summary>
/// Enqueue specified <paramref name="operation"/> and notify <see cref="Listener"/> of its start and completion.
/// </summary>
...
...
@@ -72,8 +72,7 @@ public Task<T> ScheduleTask<T>(string taskName, Func<Task<T>> operation, Cancell
/// </summary>
/// <returns>The <see cref="Task"/> that executes the operation.</returns>
[
PerformanceSensitive
(
"https://developercommunity.visualstudio.com/content/problem/854696/changing-target-framework-takes-10-minutes-with-10.html"
,
AllowCaptures
=
false
)]
[
Obsolete
(
"Should be private: https://github.com/dotnet/roslyn/issues/42742"
)]
public
Task
ScheduleTaskInProgress
(
Action
operation
,
CancellationToken
cancellationToken
)
private
Task
ScheduleTaskInProgress
(
Action
operation
,
CancellationToken
cancellationToken
)
{
lock
(
_gate
)
{
...
...
@@ -85,8 +84,7 @@ public Task ScheduleTaskInProgress(Action operation, CancellationToken cancellat
/// <inheritdoc cref="ScheduleTaskInProgress(Action, CancellationToken)"/>
[
PerformanceSensitive
(
"https://developercommunity.visualstudio.com/content/problem/854696/changing-target-framework-takes-10-minutes-with-10.html"
,
AllowCaptures
=
false
)]
[
Obsolete
(
"Should be private: https://github.com/dotnet/roslyn/issues/42742"
)]
public
Task
<
T
>
ScheduleTaskInProgress
<
T
>(
Func
<
T
>
operation
,
CancellationToken
cancellationToken
)
private
Task
<
T
>
ScheduleTaskInProgress
<
T
>(
Func
<
T
>
operation
,
CancellationToken
cancellationToken
)
{
lock
(
_gate
)
{
...
...
@@ -98,8 +96,7 @@ public Task<T> ScheduleTaskInProgress<T>(Func<T> operation, CancellationToken ca
/// <inheritdoc cref="ScheduleTaskInProgress(Action, CancellationToken)"/>
[
PerformanceSensitive
(
"https://developercommunity.visualstudio.com/content/problem/854696/changing-target-framework-takes-10-minutes-with-10.html"
,
AllowCaptures
=
false
)]
[
Obsolete
(
"Should be private: https://github.com/dotnet/roslyn/issues/42742"
)]
public
Task
ScheduleTaskInProgress
(
Func
<
Task
>
operation
,
CancellationToken
cancellationToken
)
private
Task
ScheduleTaskInProgress
(
Func
<
Task
>
operation
,
CancellationToken
cancellationToken
)
{
lock
(
_gate
)
{
...
...
@@ -111,8 +108,7 @@ public Task ScheduleTaskInProgress(Func<Task> operation, CancellationToken cance
/// <inheritdoc cref="ScheduleTaskInProgress(Action, CancellationToken)"/>
[
PerformanceSensitive
(
"https://developercommunity.visualstudio.com/content/problem/854696/changing-target-framework-takes-10-minutes-with-10.html"
,
AllowCaptures
=
false
)]
[
Obsolete
(
"Should be private: https://github.com/dotnet/roslyn/issues/42742"
)]
public
Task
<
T
>
ScheduleTaskInProgress
<
T
>(
Func
<
Task
<
T
>>
operation
,
CancellationToken
cancellationToken
)
private
Task
<
T
>
ScheduleTaskInProgress
<
T
>(
Func
<
Task
<
T
>>
operation
,
CancellationToken
cancellationToken
)
{
lock
(
_gate
)
{
...
...
@@ -121,6 +117,7 @@ public Task<T> ScheduleTaskInProgress<T>(Func<Task<T>> operation, CancellationTo
return
task
;
}
}
#pragma warning restore
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录