Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c0455807
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c0455807
编写于
12月 08, 2015
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more unified quick open sorting
上级
25358430
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
13 addition
and
24 deletion
+13
-24
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
+3
-2
src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
+1
-8
src/vs/workbench/parts/search/browser/openAnythingHandler.ts
src/vs/workbench/parts/search/browser/openAnythingHandler.ts
+0
-1
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
+9
-13
未找到文件。
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
浏览文件 @
c0455807
...
...
@@ -134,7 +134,8 @@ export class QuickOpenEntry {
}
/**
* A good default sort implementation for quick open entries
* A good default sort implementation for quick open entries respecting highlight information
* as well as associated resources.
*/
public
static
compare
(
elementA
:
QuickOpenEntry
,
elementB
:
QuickOpenEntry
,
lookFor
:
string
):
number
{
...
...
@@ -153,7 +154,7 @@ export class QuickOpenEntry {
return
1
;
}
//
Sort by name/path
//
Fallback to the full path if labels are identical and we have associated resources
let
nameA
=
elementA
.
getLabel
();
let
nameB
=
elementB
.
getLabel
();
if
(
nameA
===
nameB
)
{
...
...
src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
浏览文件 @
c0455807
...
...
@@ -230,7 +230,7 @@ export class CommandsHandler extends QuickOpenHandler {
entries
=
arrays
.
distinct
(
entries
,
(
entry
)
=>
entry
.
getLabel
()
+
entry
.
getGroupLabel
());
// Sort by name
entries
=
entries
.
sort
(
this
.
sort
);
entries
=
entries
.
sort
(
(
entryA
,
entryB
)
=>
QuickOpenEntry
.
compare
(
entryA
,
entryB
,
searchValue
)
);
return
TPromise
.
as
(
new
QuickOpenModel
(
entries
));
}
...
...
@@ -299,13 +299,6 @@ export class CommandsHandler extends QuickOpenHandler {
return
entries
;
}
private
sort
(
elementA
:
QuickOpenEntryGroup
,
elementB
:
QuickOpenEntryGroup
):
number
{
let
elementAName
=
elementA
.
getLabel
().
toLowerCase
();
let
elementBName
=
elementB
.
getLabel
().
toLowerCase
();
return
strings
.
localeCompare
(
elementAName
,
elementBName
);
}
public
getAutoFocus
(
searchValue
:
string
):
IAutoFocus
{
return
{
autoFocusFirstEntry
:
true
,
...
...
src/vs/workbench/parts/search/browser/openAnythingHandler.ts
浏览文件 @
c0455807
...
...
@@ -14,7 +14,6 @@ import paths = require('vs/base/common/paths');
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
labels
=
require
(
'
vs/base/common/labels
'
);
import
{
IRange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
compareAnything
}
from
'
vs/base/common/comparers
'
;
import
{
IAutoFocus
}
from
'
vs/base/parts/quickopen/browser/quickOpen
'
;
import
{
QuickOpenEntry
,
QuickOpenModel
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
QuickOpenHandler
}
from
'
vs/workbench/browser/quickopen
'
;
...
...
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
浏览文件 @
c0455807
...
...
@@ -192,23 +192,19 @@ export class OpenSymbolHandler extends QuickOpenHandler {
}
private
sort
(
searchValue
:
string
,
elementA
:
SymbolEntry
,
elementB
:
SymbolEntry
):
number
{
let
elementAName
=
elementA
.
getName
().
toLowerCase
();
let
elementBName
=
elementB
.
getName
().
toLowerCase
();
// Compare by name
let
r
=
strings
.
localeCompare
(
elementAName
,
elementBName
);
if
(
r
!==
0
)
{
return
r
;
}
// Sort by Type if name is identical
let
elementAName
=
elementA
.
getName
().
toLowerCase
();
let
elementBName
=
elementB
.
getName
().
toLowerCase
();
if
(
elementAName
===
elementBName
)
{
let
elementAType
=
elementA
.
getType
();
let
elementBType
=
elementB
.
getType
();
if
(
elementAType
!==
elementBType
)
{
return
OpenSymbolHandler
.
SUPPORTED_OPEN_TYPES
.
indexOf
(
elementAType
)
<
OpenSymbolHandler
.
SUPPORTED_OPEN_TYPES
.
indexOf
(
elementBType
)
?
-
1
:
1
;
}
}
return
0
;
// Keep default sorting order otherwise
return
QuickOpenEntry
.
compare
(
elementA
,
elementB
,
searchValue
);
}
public
getGroupLabel
():
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录