Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
adf78480
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,体验更适合开发者的 AI 搜索 >>
提交
adf78480
编写于
2月 13, 2020
作者:
G
Gen Lu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix item sorting
上级
cb5d3a4d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
7 deletion
+6
-7
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs
...mplementation/IntelliSense/AsyncCompletion/ItemManager.cs
+6
-7
未找到文件。
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs
浏览文件 @
adf78480
...
...
@@ -67,8 +67,7 @@ internal ItemManager(RecentItemsManager recentItemsManager)
AsyncCompletionLogger
.
LogSessionWithTypeImportCompletionEnabled
();
}
return
Task
.
FromResult
(
data
.
InitialList
.
OrderBy
(
i
=>
i
.
SortText
).
ToImmutableArray
());
return
Task
.
FromResult
(
data
.
InitialList
.
OrderBy
(
i
=>
i
.
SortText
,
StringComparer
.
Ordinal
).
ToImmutableArray
());
}
public
Task
<
FilteredCompletionModel
>
UpdateCompletionListAsync
(
...
...
@@ -210,7 +209,7 @@ internal ItemManager(RecentItemsManager recentItemsManager)
// 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 a
r
chieve this.
// to `MatchResult` to achieve this.
builder
.
Sort
(
MatchResult
.
SortingComparer
);
var
initialListOfItemsToBeIncluded
=
builder
.
ToImmutableAndFree
();
...
...
@@ -378,7 +377,7 @@ private static bool IsAfterDot(ITextSnapshot snapshot, ITrackingSpan applicableT
{
// The user has typed something, but nothing in the actual list matched what
// they were typing. In this case, we want to dismiss completion entirely.
// The thought process is as follows: we aggressively brough up completion
// The thought process is as follows: we aggressively brough
t
up completion
// to help them when they typed delete (in case they wanted to pick another
// item). However, they're typing something that doesn't seem to match at all
// The completion list is just distracting at this point.
...
...
@@ -584,7 +583,7 @@ private static int GetRecentItemIndex(ImmutableArray<string> recentItems, Roslyn
// have just typed the character to get completion. Filtering out items
// here is not desirable.
//
// 2. They brough up completion with ctrl-j or through deletion. In these
// 2. They brough
t
up completion with ctrl-j or through deletion. In these
// cases we just always keep all the items in the list.
if
(
matchedFilterText
||
initialTriggerKind
==
CompletionTriggerKind
.
Deletion
||
...
...
@@ -695,7 +694,7 @@ ImmutableArray<Span> GetHighlightedSpans()
// Completion will comes up after = with 'integer' selected (Because of MRU). We do
// not want 'space' to commit this.
// If all that has been typed is puntuation, then don't hard select anything.
// If all that has been typed is pun
c
tuation, then don't hard select anything.
// It's possible the user is just typing language punctuation and selecting
// anything in the list will interfere. We only allow this if the filter text
// exactly matches something in the list already.
...
...
@@ -758,7 +757,7 @@ private static bool IsAllPunctuation(string filterText)
/// </summary>
private
static
bool
IsPotentialFilterCharacter
(
char
c
)
{
// TODO(cyrusn): Actually use the right
u
nicode categories here.
// TODO(cyrusn): Actually use the right
U
nicode categories here.
return
char
.
IsLetter
(
c
)
||
char
.
IsNumber
(
c
)
||
c
==
'_'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录