Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
77c68b37
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,发现更多精彩内容 >>
提交
77c68b37
编写于
3月 08, 2019
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improving performance on running completion tests (#33817)
Cherry picked from commit
aa2db962
上级
fd501c70
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
16 deletion
+51
-16
src/EditorFeatures/TestUtilities/AbstractCommandHandlerTestState.cs
...Features/TestUtilities/AbstractCommandHandlerTestState.cs
+4
-9
src/EditorFeatures/TestUtilities/TestExportProvider.cs
src/EditorFeatures/TestUtilities/TestExportProvider.cs
+0
-5
src/EditorFeatures/TestUtilities2/Intellisense/TestState.vb
src/EditorFeatures/TestUtilities2/Intellisense/TestState.vb
+46
-1
src/VisualStudio/CSharp/Test/EventHookup/EventHookupTestState.cs
...ualStudio/CSharp/Test/EventHookup/EventHookupTestState.cs
+1
-1
未找到文件。
src/EditorFeatures/TestUtilities/AbstractCommandHandlerTestState.cs
浏览文件 @
77c68b37
...
...
@@ -33,9 +33,8 @@ internal abstract class AbstractCommandHandlerTestState : IDisposable
XElement
workspaceElement
,
IList
<
Type
>
excludedTypes
=
null
,
ComposableCatalog
extraParts
=
null
,
bool
useMinimumCatalog
=
false
,
string
workspaceKind
=
null
)
:
this
(
workspaceElement
,
GetExportProvider
(
useMinimumCatalog
,
excludedTypes
,
extraParts
),
workspaceKind
)
:
this
(
workspaceElement
,
GetExportProvider
(
excludedTypes
,
extraParts
),
workspaceKind
)
{
}
...
...
@@ -131,20 +130,16 @@ public T GetService<T>()
return
Workspace
.
GetService
<
T
>();
}
private
static
ExportProvider
GetExportProvider
(
bool
useMinimumCatalog
,
IList
<
Type
>
excludedTypes
,
ComposableCatalog
extraParts
)
internal
static
ExportProvider
GetExportProvider
(
IList
<
Type
>
excludedTypes
,
ComposableCatalog
extraParts
)
{
excludedTypes
=
excludedTypes
??
Type
.
EmptyTypes
;
if
(
excludedTypes
.
Count
==
0
&&
(
extraParts
==
null
||
extraParts
.
Parts
.
Count
==
0
))
{
return
useMinimumCatalog
?
TestExportProvider
.
MinimumExportProviderFactoryWithCSharpAndVisualBasic
.
CreateExportProvider
()
:
TestExportProvider
.
ExportProviderFactoryWithCSharpAndVisualBasic
.
CreateExportProvider
();
return
TestExportProvider
.
ExportProviderFactoryWithCSharpAndVisualBasic
.
CreateExportProvider
();
}
var
baseCatalog
=
useMinimumCatalog
?
TestExportProvider
.
MinimumCatalogWithCSharpAndVisualBasic
:
TestExportProvider
.
EntireAssemblyCatalogWithCSharpAndVisualBasic
;
var
baseCatalog
=
TestExportProvider
.
EntireAssemblyCatalogWithCSharpAndVisualBasic
;
var
filteredCatalog
=
baseCatalog
.
WithoutPartsOfTypes
(
excludedTypes
);
...
...
src/EditorFeatures/TestUtilities/TestExportProvider.cs
浏览文件 @
77c68b37
...
...
@@ -116,11 +116,6 @@ private static Type[] GetNeutralAndCSharpAndVisualBasicTypes()
.
ToArray
();
}
private
static
IExportProviderFactory
CreateExportProviderFactoryWithCSharpAndVisualBasic
()
{
return
ExportProviderCache
.
GetOrCreateExportProviderFactory
(
EntireAssemblyCatalogWithCSharpAndVisualBasic
);
}
private
static
ComposableCatalog
CreateAssemblyCatalogWithCSharpAndVisualBasic
()
{
return
ExportProviderCache
...
...
src/EditorFeatures/TestUtilities2/Intellisense/TestState.vb
浏览文件 @
77c68b37
...
...
@@ -13,6 +13,7 @@ Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports
Microsoft.CodeAnalysis.SignatureHelp
Imports
Microsoft.CodeAnalysis.Test.Utilities
Imports
Microsoft.VisualStudio.Commanding
Imports
Microsoft.VisualStudio.Composition
Imports
Microsoft.VisualStudio.Language.Intellisense
Imports
Microsoft.VisualStudio.Text
Imports
Microsoft.VisualStudio.Text.Editor
...
...
@@ -35,6 +36,36 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Friend
ReadOnly
IntelliSenseCommandHandler
As
IntelliSenseCommandHandler
Private
ReadOnly
SessionTestState
As
IIntelliSenseTestState
Private
Shared
s_lazyEntireAssemblyCatalogWithCSharpAndVisualBasicWithoutCompletionTestParts
As
Lazy
(
Of
ComposableCatalog
)
=
New
Lazy
(
Of
ComposableCatalog
)(
Function
()
Return
TestExportProvider
.
EntireAssemblyCatalogWithCSharpAndVisualBasic
.
WithoutPartsOfTypes
({
GetType
(
IIntelliSensePresenter
(
Of
ICompletionPresenterSession
,
ICompletionSession
)),
GetType
(
IIntelliSensePresenter
(
Of
ISignatureHelpPresenterSession
,
ISignatureHelpSession
)),
GetType
(
FormatCommandHandler
)}).
WithParts
({
GetType
(
TestCompletionPresenter
),
GetType
(
TestSignatureHelpPresenter
),
GetType
(
IntelliSenseTestState
)})
End
Function
)
Private
Shared
ReadOnly
Property
EntireAssemblyCatalogWithCSharpAndVisualBasicWithoutCompletionTestParts
As
ComposableCatalog
Get
Return
s_lazyEntireAssemblyCatalogWithCSharpAndVisualBasicWithoutCompletionTestParts
.
Value
End
Get
End
Property
Private
Shared
s_lazyExportProviderFactoryWithCSharpAndVisualBasicWithoutCompletionTestParts
As
Lazy
(
Of
IExportProviderFactory
)
=
New
Lazy
(
Of
IExportProviderFactory
)(
Function
()
Return
ExportProviderCache
.
GetOrCreateExportProviderFactory
(
EntireAssemblyCatalogWithCSharpAndVisualBasicWithoutCompletionTestParts
)
End
Function
)
Private
Shared
ReadOnly
Property
ExportProviderFactoryWithCSharpAndVisualBasicWithoutCompletionTestParts
As
IExportProviderFactory
Get
Return
s_lazyExportProviderFactoryWithCSharpAndVisualBasicWithoutCompletionTestParts
.
Value
End
Get
End
Property
Friend
ReadOnly
Property
CurrentSignatureHelpPresenterSession
As
TestSignatureHelpPresenterSession
Get
Return
SessionTestState
.
CurrentSignatureHelpPresenterSession
...
...
@@ -53,7 +84,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Optional
extraExportedTypes
As
List
(
Of
Type
)
=
Nothing
,
Optional
includeFormatCommandHandler
As
Boolean
=
False
,
Optional
workspaceKind
As
String
=
Nothing
)
MyBase
.
New
(
workspaceElement
,
CombineExcludedTypes
(
excludedTypes
,
includeFormatCommandHandler
),
ExportProviderCache
.
CreateTypeCatalog
(
CombineExtraTypes
(
If
(
extraExportedTypes
,
New
List
(
Of
Type
)))
),
workspaceKind
:
=
workspaceKind
)
MyBase
.
New
(
workspaceElement
,
GetExportProvider
(
excludedTypes
,
extraExportedTypes
,
includeFormatCommandHandler
),
workspaceKind
:
=
workspaceKind
)
Dim
languageServices
=
Me
.
Workspace
.
CurrentSolution
.
Projects
.
First
().
LanguageServices
Dim
language
=
languageServices
.
Language
...
...
@@ -84,6 +115,20 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Nothing
)
End
Sub
Private
Overloads
Shared
Function
GetExportProvider
(
excludedTypes
As
List
(
Of
Type
),
extraExportedTypes
As
List
(
Of
Type
),
includeFormatCommandHandler
As
Boolean
)
As
ExportProvider
If
(
excludedTypes
Is
Nothing
OrElse
excludedTypes
.
Count
=
0
)
AndAlso
(
extraExportedTypes
Is
Nothing
OrElse
extraExportedTypes
.
Count
=
0
)
AndAlso
Not
includeFormatCommandHandler
Then
Return
ExportProviderFactoryWithCSharpAndVisualBasicWithoutCompletionTestParts
.
CreateExportProvider
()
End
If
Dim
combinedExcludedTypes
=
CombineExcludedTypes
(
excludedTypes
,
includeFormatCommandHandler
)
Dim
extraParts
=
ExportProviderCache
.
CreateTypeCatalog
(
CombineExtraTypes
(
If
(
extraExportedTypes
,
New
List
(
Of
Type
))))
Return
GetExportProvider
(
combinedExcludedTypes
,
extraParts
)
End
Function
Private
Shared
Function
CombineExcludedTypes
(
excludedTypes
As
IList
(
Of
Type
),
includeFormatCommandHandler
As
Boolean
)
As
IList
(
Of
Type
)
Dim
result
=
New
List
(
Of
Type
)
From
{
GetType
(
IIntelliSensePresenter
(
Of
ICompletionPresenterSession
,
ICompletionSession
)),
...
...
src/VisualStudio/CSharp/Test/EventHookup/EventHookupTestState.cs
浏览文件 @
77c68b37
...
...
@@ -23,7 +23,7 @@ internal sealed class EventHookupTestState : AbstractCommandHandlerTestState
private
Mutex
_testSessionHookupMutex
;
public
EventHookupTestState
(
XElement
workspaceElement
,
IDictionary
<
OptionKey
,
object
>
options
)
:
base
(
workspaceElement
,
excludedTypes
:
null
,
GetExtraParts
()
,
false
)
:
base
(
workspaceElement
,
excludedTypes
:
null
,
GetExtraParts
())
{
_commandHandler
=
new
EventHookupCommandHandler
(
Workspace
.
ExportProvider
.
GetExportedValue
<
IThreadingContext
>(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录