Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
0fd866e2
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,发现更多精彩内容 >>
未验证
提交
0fd866e2
编写于
10月 31, 2019
作者:
G
Gen Lu
提交者:
GitHub
10月 31, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #39574 from genlu/EnableSortByMatching
Remove experiment for "sorting completion list by matching"
上级
dfb58d79
e286bf05
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
71 deletion
+6
-71
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs
...mplementation/IntelliSense/AsyncCompletion/ItemManager.cs
+5
-11
src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
...Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
+1
-59
src/Workspaces/Core/Portable/Experiments/IExperimentationService.cs
...aces/Core/Portable/Experiments/IExperimentationService.cs
+0
-1
未找到文件。
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs
浏览文件 @
0fd866e2
...
...
@@ -8,7 +8,6 @@
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Completion
;
using
Microsoft.CodeAnalysis.Experiments
;
using
Microsoft.CodeAnalysis.PatternMatching
;
using
Microsoft.CodeAnalysis.PooledObjects
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
...
...
@@ -206,16 +205,11 @@ internal ItemManager(RecentItemsManager recentItemsManager)
return
HandleAllItemsFilteredOut
(
reason
,
data
.
SelectedFilters
,
completionRules
);
}
var
experimentationService
=
document
?.
Project
.
Solution
.
Workspace
.
Services
.
GetService
<
IExperimentationService
>();
if
(
experimentationService
?.
IsExperimentEnabled
(
WellKnownExperimentNames
.
SortCompletionListByMatch
)
==
true
)
{
// Sort the items by pattern matching results.
// Note that we want to preserve the original alphabetical order for items with same pattern match score,
// but `ArrayBuilder.Sort` isn't stable. Therefore we have to add a monotonically increasing integer
// to `MatchResult` to archieve this.
builder
.
Sort
(
MatchResult
.
SortingComparer
);
}
// Sort the items by pattern matching results.
// Note that we want to preserve the original alphabetical order for items with same pattern match score,
// but `ArrayBuilder.Sort` isn't stable. Therefore we have to add a monotonically increasing integer
// to `MatchResult` to archieve this.
builder
.
Sort
(
MatchResult
.
SortingComparer
);
var
initialListOfItemsToBeIncluded
=
builder
.
ToImmutableAndFree
();
...
...
src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
浏览文件 @
0fd866e2
...
...
@@ -6028,7 +6028,7 @@ namespace NS2
<
WorkItem
(
38253
,
"https://github.com/dotnet/roslyn/issues/38253"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Async
Function
SortItemsByPatternMatch
IfExperimentEnabled
()
As
Task
Public
Async
Function
SortItemsByPatternMatch
()
As
Task
Using
state
=
TestStateFactory
.
CreateCSharpTestState
(
<
Document
>
namespace
NS
...
...
@@ -6058,9 +6058,6 @@ namespace NS
state
.
Workspace
.
Options
=
state
.
Workspace
.
Options
_
.
WithChangedOption
(
CompletionOptions
.
ShowItemsFromUnimportedNamespaces
,
LanguageNames
.
CSharp
,
False
)
Dim
experimentService
=
state
.
GetService
(
Of
TestExperimentationService
)()
experimentService
.
SetExperimentOption
(
WellKnownExperimentNames
.
SortCompletionListByMatch
,
True
)
state
.
SendTypeChars
(
"task"
)
Await
state
.
WaitForAsynchronousOperationsAsync
()
Await
state
.
AssertSelectedCompletionItem
(
displayText
:
=
"Task"
)
...
...
@@ -6081,61 +6078,6 @@ namespace NS
End
Using
End
Function
<
WorkItem
(
38253
,
"https://github.com/dotnet/roslyn/issues/38253"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Async
Function
SortItemsAlphabeticallyIfExperimentDisabled
()
As
Task
Using
state
=
TestStateFactory
.
CreateCSharpTestState
(
<
Document
>
namespace
NS
{
class
C
{
void
M
()
{
$$
}
}
class
Task
{
}
class
BTask1
{
}
class
BTask2
{
}
class
BTask3
{
}
class
Task1
{
}
class
Task2
{
}
class
Task3
{
}
class
ATaAaSaKa
{
}
}
</
Document
>
,
extraExportedTypes
:
=
{
GetType
(
TestExperimentationService
)}.
ToList
())
state
.
Workspace
.
Options
=
state
.
Workspace
.
Options
_
.
WithChangedOption
(
CompletionOptions
.
ShowItemsFromUnimportedNamespaces
,
LanguageNames
.
CSharp
,
False
)
Dim
experimentService
=
state
.
GetService
(
Of
TestExperimentationService
)()
experimentService
.
SetExperimentOption
(
WellKnownExperimentNames
.
SortCompletionListByMatch
,
False
)
state
.
SendTypeChars
(
"task"
)
Await
state
.
WaitForAsynchronousOperationsAsync
()
Await
state
.
AssertSelectedCompletionItem
(
displayText
:
=
"Task"
)
Dim
expectedOrder
=
{
"ATaAaSaKa"
,
"BTask1"
,
"BTask2"
,
"BTask3"
,
"Task"
,
"Task1"
,
"Task2"
,
"Task3"
}
state
.
AssertItemsInOrder
(
expectedOrder
)
End
Using
End
Function
Private
Class
MultipleChangeCompletionProvider
Inherits
CompletionProvider
...
...
src/Workspaces/Core/Portable/Experiments/IExperimentationService.cs
浏览文件 @
0fd866e2
...
...
@@ -31,7 +31,6 @@ internal static class WellKnownExperimentNames
public
const
string
TypeImportCompletion
=
"Roslyn.TypeImportCompletion"
;
public
const
string
TargetTypedCompletionFilter
=
"Roslyn.TargetTypedCompletionFilter"
;
public
const
string
NativeEditorConfigSupport
=
"Roslyn.NativeEditorConfigSupport"
;
public
const
string
SortCompletionListByMatch
=
"Roslyn.SortCompletionListByMatch"
;
// Syntactic LSP experiment treatments.
public
const
string
SyntacticExp_LiveShareTagger_Remote
=
"Roslyn.LspTagger"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录