Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8b834d0f
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,发现更多精彩内容 >>
提交
8b834d0f
编写于
1月 04, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Search relevance in Quick Pick control (fixes #18003)
上级
ada971a4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
11 deletion
+25
-11
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
+5
-5
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
.../workbench/browser/parts/quickopen/quickOpenController.ts
+16
-2
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
...vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
+4
-4
未找到文件。
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
浏览文件 @
8b834d0f
...
...
@@ -689,15 +689,15 @@ export class QuickOpenModel implements
return
this
.
_entries
;
}
getId
(
entry
:
QuickOpenEntry
):
string
{
public
getId
(
entry
:
QuickOpenEntry
):
string
{
return
entry
.
getId
();
}
getLabel
(
entry
:
QuickOpenEntry
):
string
{
public
getLabel
(
entry
:
QuickOpenEntry
):
string
{
return
entry
.
getLabel
();
}
getAriaLabel
(
entry
:
QuickOpenEntry
):
string
{
public
getAriaLabel
(
entry
:
QuickOpenEntry
):
string
{
const
ariaLabel
=
entry
.
getAriaLabel
();
if
(
ariaLabel
)
{
return
nls
.
localize
(
'
quickOpenAriaLabelEntry
'
,
"
{0}, picker
"
,
entry
.
getAriaLabel
());
...
...
@@ -706,11 +706,11 @@ export class QuickOpenModel implements
return
nls
.
localize
(
'
quickOpenAriaLabel
'
,
"
picker
"
);
}
isVisible
(
entry
:
QuickOpenEntry
):
boolean
{
public
isVisible
(
entry
:
QuickOpenEntry
):
boolean
{
return
!
entry
.
isHidden
();
}
run
(
entry
:
QuickOpenEntry
,
mode
:
Mode
,
context
:
IContext
):
boolean
{
public
run
(
entry
:
QuickOpenEntry
,
mode
:
Mode
,
context
:
IContext
):
boolean
{
return
entry
.
run
(
mode
,
context
);
}
}
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
浏览文件 @
8b834d0f
...
...
@@ -342,9 +342,9 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
// Model
const
model
=
new
QuickOpenModel
();
const
entries
=
picks
.
map
(
e
=>
this
.
instantiationService
.
createInstance
(
PickOpenEntry
,
e
,
()
=>
progress
(
e
)));
const
entries
=
picks
.
map
(
(
e
,
index
)
=>
this
.
instantiationService
.
createInstance
(
PickOpenEntry
,
e
,
index
,
()
=>
progress
(
e
)));
if
(
picks
.
length
===
0
)
{
entries
.
push
(
this
.
instantiationService
.
createInstance
(
PickOpenEntry
,
{
label
:
nls
.
localize
(
'
emptyPicks
'
,
"
There are no entries to pick from
"
)
},
null
));
entries
.
push
(
this
.
instantiationService
.
createInstance
(
PickOpenEntry
,
{
label
:
nls
.
localize
(
'
emptyPicks
'
,
"
There are no entries to pick from
"
)
},
0
,
null
));
}
model
.
setEntries
(
entries
);
...
...
@@ -414,6 +414,15 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
});
}
// Sort by value
model
.
entries
.
sort
((
pickA
:
PickOpenEntry
,
pickB
:
PickOpenEntry
)
=>
{
if
(
!
value
)
{
return
pickA
.
index
-
pickB
.
index
;
// restore natural order
}
return
QuickOpenEntry
.
compare
(
pickA
,
pickB
,
value
);
});
this
.
pickOpenWidget
.
refresh
(
model
,
value
?
{
autoFocusFirstEntry
:
true
}
:
autoFocus
);
},
onShow
:
()
=>
this
.
handleOnShow
(
true
),
...
...
@@ -1001,6 +1010,7 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
constructor
(
item
:
IPickOpenEntry
,
private
_index
:
number
,
private
onPreview
:
()
=>
void
,
@
IModeService
private
modeService
:
IModeService
,
@
IModelService
private
modelService
:
IModelService
...
...
@@ -1018,6 +1028,10 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
this
.
isFolder
=
fileItem
.
isFolder
;
}
public
get
index
():
number
{
return
this
.
_index
;
}
public
getLabelOptions
():
IIconLabelOptions
{
return
{
extraClasses
:
this
.
resource
?
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
this
.
resource
,
this
.
isFolder
)
:
[]
...
...
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
8b834d0f
...
...
@@ -46,7 +46,7 @@ class OutlineModel extends QuickOpenModel {
this
.
outline
=
outline
;
}
public
dof
ilter
(
searchValue
:
string
):
void
{
public
applyF
ilter
(
searchValue
:
string
):
void
{
// Normalize search
let
normalizedSearchValue
=
searchValue
;
...
...
@@ -389,10 +389,10 @@ export class GotoSymbolHandler extends QuickOpenHandler {
}
// Resolve Outline Model
return
this
.
getActiveOutline
().
then
(
(
outline
)
=>
{
return
this
.
getActiveOutline
().
then
(
outline
=>
{
// Filter by search
outline
.
dof
ilter
(
searchValue
);
outline
.
applyF
ilter
(
searchValue
);
return
outline
;
});
...
...
@@ -548,7 +548,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
public
clearDecorations
():
void
{
if
(
this
.
rangeHighlightDecorationId
)
{
this
.
editorService
.
getVisibleEditors
().
forEach
(
(
editor
)
=>
{
this
.
editorService
.
getVisibleEditors
().
forEach
(
editor
=>
{
if
(
editor
.
position
===
this
.
rangeHighlightDecorationId
.
position
)
{
const
editorControl
=
<
IEditor
>
editor
.
getControl
();
editorControl
.
changeDecorations
((
changeAccessor
:
IModelDecorationsChangeAccessor
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录