Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
acf019de
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,发现更多精彩内容 >>
未验证
提交
acf019de
编写于
2月 25, 2020
作者:
M
msftbot[bot]
提交者:
GitHub
2月 25, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #41913 from dotnet/merges/release/dev16.5-to-master
Merge release/dev16.5 to master
上级
d16a6fd5
cb5d3a4d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
61 addition
and
80 deletion
+61
-80
src/Features/Core/Portable/ExternalAccess/UnitTesting/API/IUnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
...IUnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
+4
-1
src/Features/Core/Portable/ExternalAccess/UnitTesting/API/IUnitTestingSolutionCrawlerServiceAccessor.cs
...Testing/API/IUnitTestingSolutionCrawlerServiceAccessor.cs
+0
-14
src/Features/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerServiceAccessor.cs
.../UnitTesting/UnitTestingSolutionCrawlerServiceAccessor.cs
+39
-5
src/Features/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerServiceAccessorFactory.cs
...sting/UnitTestingSolutionCrawlerServiceAccessorFactory.cs
+3
-2
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/IUnitTestingIncrementalAnalyzerProviderImplementation.cs
.../IUnitTestingIncrementalAnalyzerProviderImplementation.cs
+1
-1
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingIncrementalAnalyzerProvider.cs
...ess/UnitTesting/UnitTestingIncrementalAnalyzerProvider.cs
+14
-1
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
.../UnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
+0
-27
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerRegistrationServiceAccessorFactory .cs
...tingSolutionCrawlerRegistrationServiceAccessorFactory .cs
+0
-29
未找到文件。
src/
Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api
/IUnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
→
src/
Features/Core/Portable/ExternalAccess/UnitTesting/API
/IUnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
浏览文件 @
acf019de
...
...
@@ -2,12 +2,15 @@
// 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.Collections.Generic
;
using
Microsoft.CodeAnalysis.Host
;
namespace
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
{
internal
interface
IUnitTestingSolutionCrawler
Registration
ServiceAccessor
:
IWorkspaceService
internal
interface
IUnitTestingSolutionCrawlerServiceAccessor
:
IWorkspaceService
{
void
Reanalyze
(
Workspace
workspace
,
IEnumerable
<
ProjectId
>
projectIds
=
null
,
IEnumerable
<
DocumentId
>
documentIds
=
null
,
bool
highPriority
=
false
);
void
AddAnalyzerProvider
(
IUnitTestingIncrementalAnalyzerProviderImplementation
provider
,
UnitTestingIncrementalAnalyzerProviderMetadataWrapper
metadata
);
}
}
src/Features/Core/Portable/ExternalAccess/UnitTesting/API/IUnitTestingSolutionCrawlerServiceAccessor.cs
已删除
100644 → 0
浏览文件 @
d16a6fd5
// 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.Collections.Generic
;
using
Microsoft.CodeAnalysis.Host
;
namespace
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
{
internal
interface
IUnitTestingSolutionCrawlerServiceAccessor
:
IWorkspaceService
{
void
Reanalyze
(
Workspace
workspace
,
IUnitTestingIncrementalAnalyzerImplementation
analyzer
,
IEnumerable
<
ProjectId
>
projectIds
=
null
,
IEnumerable
<
DocumentId
>
documentIds
=
null
,
bool
highPriority
=
false
);
}
}
src/Features/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerServiceAccessor.cs
浏览文件 @
acf019de
...
...
@@ -12,13 +12,47 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting
{
internal
sealed
class
UnitTestingSolutionCrawlerServiceAccessor
:
IUnitTestingSolutionCrawlerServiceAccessor
{
private
readonly
ISolutionCrawlerService
_implementation
;
private
readonly
ISolutionCrawlerRegistrationService
_registrationService
;
private
readonly
ISolutionCrawlerService
_solutionCrawlerService
;
private
UnitTestingIncrementalAnalyzerProvider
_analyzerProvider
;
[
Obsolete
(
MefConstruction
.
FactoryMethodMessage
,
error
:
true
)]
public
UnitTestingSolutionCrawlerServiceAccessor
(
ISolutionCrawlerService
implementation
)
=>
_implementation
=
implementation
;
public
UnitTestingSolutionCrawlerServiceAccessor
(
ISolutionCrawlerRegistrationService
registrationService
,
ISolutionCrawlerService
solutionCrawlerService
)
{
_registrationService
=
registrationService
;
_solutionCrawlerService
=
solutionCrawlerService
;
}
public
void
AddAnalyzerProvider
(
IUnitTestingIncrementalAnalyzerProviderImplementation
provider
,
UnitTestingIncrementalAnalyzerProviderMetadataWrapper
metadata
)
{
if
(
_analyzerProvider
!=
null
)
{
// NOTE: We expect the analyzer to be a singleton, therefore this method should be called just once.
throw
new
InvalidOperationException
();
}
_analyzerProvider
=
new
UnitTestingIncrementalAnalyzerProvider
(
provider
);
_registrationService
.
AddAnalyzerProvider
(
_analyzerProvider
,
metadata
.
UnderlyingObject
);
}
// NOTE: For the Reanalyze method to work correctly, the analyzer passed into the Reanalyze method,
// must be the same as created when we call the AddAnalyzerProvider method.
// As such the analyzer provider instance caches a single instance of the analyzer.
public
void
Reanalyze
(
Workspace
workspace
,
IEnumerable
<
ProjectId
>
projectIds
=
null
,
IEnumerable
<
DocumentId
>
documentIds
=
null
,
bool
highPriority
=
false
)
{
// NOTE: this method must be called after AddAnalyzerProvider was called previously.
if
(
_analyzerProvider
==
null
)
{
throw
new
InvalidOperationException
();
}
_solutionCrawlerService
.
Reanalyze
(
workspace
,
_analyzerProvider
.
CreateIncrementalAnalyzer
(
workspace
),
projectIds
,
documentIds
,
highPriority
);
}
public
void
Re
analyze
(
Workspace
workspace
,
IUnitTestingIncrementalAnalyzerImplementation
analyzer
,
IEnumerable
<
ProjectId
>
projectIds
=
null
,
IEnumerable
<
DocumentId
>
documentIds
=
null
,
bool
highPriority
=
fals
e
)
=>
_
implementation
.
Reanalyze
(
workspace
,
new
UnitTestingIncrementalAnalyzer
(
analyzer
),
projectIds
,
documentIds
,
highPriority
);
public
void
Re
gister
(
Workspace
workspac
e
)
=>
_
registrationService
.
Register
(
workspace
);
}
}
src/Features/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerServiceAccessorFactory.cs
浏览文件 @
acf019de
...
...
@@ -22,8 +22,9 @@ internal sealed class UnitTestingSolutionCrawlerServiceAccessorFactory : IWorksp
[
Obsolete
(
MefConstruction
.
FactoryMethodMessage
,
error
:
true
)]
public
IWorkspaceService
CreateService
(
HostWorkspaceServices
workspaceServices
)
{
var
implementation
=
workspaceServices
.
GetRequiredService
<
ISolutionCrawlerService
>();
return
new
UnitTestingSolutionCrawlerServiceAccessor
(
implementation
);
var
solutionCrawlerRegistrationService
=
workspaceServices
.
GetRequiredService
<
ISolutionCrawlerRegistrationService
>();
var
solutionCrawlerService
=
workspaceServices
.
GetRequiredService
<
ISolutionCrawlerService
>();
return
new
UnitTestingSolutionCrawlerServiceAccessor
(
solutionCrawlerRegistrationService
,
solutionCrawlerService
);
}
}
}
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/IUnitTestingIncrementalAnalyzerProviderImplementation.cs
浏览文件 @
acf019de
...
...
@@ -6,6 +6,6 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
{
internal
interface
IUnitTestingIncrementalAnalyzerProviderImplementation
{
IUnitTestingIncrementalAnalyzerImplementation
CreateIncrementalAnalyzer
(
Workspace
workspace
);
IUnitTestingIncrementalAnalyzerImplementation
CreateIncrementalAnalyzer
();
}
}
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingIncrementalAnalyzerProvider.cs
浏览文件 @
acf019de
...
...
@@ -2,6 +2,7 @@
// 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
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
;
using
Microsoft.CodeAnalysis.SolutionCrawler
;
...
...
@@ -10,11 +11,23 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting
internal
class
UnitTestingIncrementalAnalyzerProvider
:
IIncrementalAnalyzerProvider
{
private
readonly
IUnitTestingIncrementalAnalyzerProviderImplementation
_incrementalAnalyzerProvider
;
private
IIncrementalAnalyzer
_analyzer
;
public
UnitTestingIncrementalAnalyzerProvider
(
IUnitTestingIncrementalAnalyzerProviderImplementation
incrementalAnalyzerProvider
)
=>
_incrementalAnalyzerProvider
=
incrementalAnalyzerProvider
;
public
IIncrementalAnalyzer
CreateIncrementalAnalyzer
(
Workspace
workspace
)
=>
new
UnitTestingIncrementalAnalyzer
(
_incrementalAnalyzerProvider
.
CreateIncrementalAnalyzer
(
workspace
));
{
// NOTE: We're currently expecting the analyzer to be singleton, so that
// analyzers returned when calling this method twice would pass a reference equality check.
// One instance should be created by SolutionCrawler, another one by us, when calling the
// UnitTestingSolutionCrawlerServiceAccessor.Reanalyze method.
if
(
_analyzer
==
null
)
{
_analyzer
=
new
UnitTestingIncrementalAnalyzer
(
_incrementalAnalyzerProvider
.
CreateIncrementalAnalyzer
());
}
return
_analyzer
;
}
}
}
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerRegistrationServiceAccessor.cs
已删除
100644 → 0
浏览文件 @
d16a6fd5
// 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
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
;
using
Microsoft.CodeAnalysis.Host.Mef
;
using
Microsoft.CodeAnalysis.SolutionCrawler
;
namespace
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting
{
internal
sealed
class
UnitTestingSolutionCrawlerRegistrationServiceAccessor
:
IUnitTestingSolutionCrawlerRegistrationServiceAccessor
{
private
readonly
ISolutionCrawlerRegistrationService
_implementation
;
[
Obsolete
(
MefConstruction
.
ImportingConstructorMessage
,
error
:
true
)]
public
UnitTestingSolutionCrawlerRegistrationServiceAccessor
(
ISolutionCrawlerRegistrationService
implementation
)
=>
_implementation
=
implementation
;
public
void
AddAnalyzerProvider
(
IUnitTestingIncrementalAnalyzerProviderImplementation
provider
,
UnitTestingIncrementalAnalyzerProviderMetadataWrapper
metadata
)
=>
_implementation
.
AddAnalyzerProvider
(
new
UnitTestingIncrementalAnalyzerProvider
(
provider
),
metadata
.
UnderlyingObject
);
public
void
Register
(
Workspace
workspace
)
=>
_implementation
.
Register
(
workspace
);
}
}
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingSolutionCrawlerRegistrationServiceAccessorFactory .cs
已删除
100644 → 0
浏览文件 @
d16a6fd5
// 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.Composition
;
using
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
;
using
Microsoft.CodeAnalysis.Host
;
using
Microsoft.CodeAnalysis.Host.Mef
;
using
Microsoft.CodeAnalysis.SolutionCrawler
;
namespace
Microsoft.CodeAnalysis.ExternalAccess.UnitTesting
{
[
ExportWorkspaceServiceFactory
(
typeof
(
IUnitTestingSolutionCrawlerRegistrationServiceAccessor
))]
[
Shared
]
internal
sealed
class
UnitTestingSolutionCrawlerRegistrationServiceAccessorFactory
:
IWorkspaceServiceFactory
{
[
ImportingConstructor
]
[
Obsolete
(
MefConstruction
.
ImportingConstructorMessage
,
error
:
true
)]
public
UnitTestingSolutionCrawlerRegistrationServiceAccessorFactory
()
{
}
[
Obsolete
(
MefConstruction
.
FactoryMethodMessage
,
error
:
true
)]
public
IWorkspaceService
CreateService
(
HostWorkspaceServices
workspaceServices
)
{
var
implementation
=
workspaceServices
.
GetRequiredService
<
ISolutionCrawlerRegistrationService
>();
return
new
UnitTestingSolutionCrawlerRegistrationServiceAccessor
(
implementation
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录