Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b904d13d
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,发现更多精彩内容 >>
提交
b904d13d
编写于
7月 13, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
allow to always show a pick entry even when the user searches (for #5073)
上级
c815f7e3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
13 deletion
+38
-13
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
.../workbench/browser/parts/quickopen/quickOpenController.ts
+36
-13
src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts
...ench/parts/themes/electron-browser/themes.contribution.ts
+1
-0
src/vs/workbench/services/quickopen/common/quickOpenService.ts
...s/workbench/services/quickopen/common/quickOpenService.ts
+1
-0
未找到文件。
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
浏览文件 @
b904d13d
...
...
@@ -289,13 +289,13 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
// Model
let
model
=
new
QuickOpenModel
();
let
entries
=
picks
.
map
(
(
e
)
=>
{
let
entries
=
picks
.
map
(
e
=>
{
let
entry
=
(
<
IPickOpenEntryItem
>
e
);
if
(
entry
.
height
&&
entry
.
render
)
{
return
new
PickOpenItem
(
entry
.
label
,
entry
.
description
,
entry
.
height
,
entry
.
render
.
bind
(
entry
),
()
=>
progress
(
e
));
return
new
PickOpenItem
(
entry
.
label
,
entry
.
description
,
entry
.
height
,
entry
.
render
.
bind
(
entry
),
()
=>
progress
(
e
)
,
entry
.
alwaysShow
);
}
return
new
PickOpenEntry
(
entry
.
label
,
entry
.
description
,
entry
.
detail
,
()
=>
progress
(
e
),
entry
.
separator
&&
entry
.
separator
.
border
,
entry
.
separator
&&
entry
.
separator
.
label
);
return
new
PickOpenEntry
(
entry
.
label
,
entry
.
description
,
entry
.
detail
,
()
=>
progress
(
e
),
entry
.
separator
&&
entry
.
separator
.
border
,
entry
.
separator
&&
entry
.
separator
.
label
,
entry
.
alwaysShow
);
});
if
(
picks
.
length
===
0
)
{
...
...
@@ -346,7 +346,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
// Reset filtering
if
(
!
value
)
{
entries
.
forEach
(
(
e
)
=>
{
entries
.
forEach
(
e
=>
{
e
.
setHighlights
(
null
);
e
.
setHidden
(
false
);
});
...
...
@@ -354,12 +354,12 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
// Filter by value
else
{
entries
.
forEach
(
(
entry
)
=>
{
entries
.
forEach
(
entry
=>
{
let
labelHighlights
=
filters
.
matchesFuzzy
(
value
,
entry
.
getLabel
());
let
descriptionHighlights
=
options
.
matchOnDescription
&&
filters
.
matchesFuzzy
(
value
,
entry
.
getDescription
());
let
detailHighlights
=
options
.
matchOnDetail
&&
entry
.
getDetail
()
&&
filters
.
matchesFuzzy
(
value
,
entry
.
getDetail
());
if
(
labelHighlights
||
descriptionHighlights
||
detailHighlights
)
{
if
(
entry
.
shouldAlwaysShow
()
||
labelHighlights
||
descriptionHighlights
||
detailHighlights
)
{
entry
.
setHighlights
(
labelHighlights
,
descriptionHighlights
,
detailHighlights
);
entry
.
setHidden
(
false
);
}
else
{
...
...
@@ -441,7 +441,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
this
.
previousValue
=
prefix
;
let
promiseCompletedOnHide
=
new
TPromise
<
void
>
(
(
c
)
=>
{
let
promiseCompletedOnHide
=
new
TPromise
<
void
>
(
c
=>
{
this
.
promisesToCompleteOnHide
.
push
(
c
);
});
...
...
@@ -660,13 +660,13 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
// Resolve all default handlers
let
resolvePromises
:
TPromise
<
QuickOpenHandler
>
[]
=
[];
defaultHandlers
.
forEach
(
(
defaultHandler
)
=>
{
defaultHandlers
.
forEach
(
defaultHandler
=>
{
resolvePromises
.
push
(
this
.
resolveHandler
(
defaultHandler
));
});
return
TPromise
.
join
(
resolvePromises
).
then
((
resolvedHandlers
:
QuickOpenHandler
[])
=>
{
let
resultPromises
:
TPromise
<
void
>
[]
=
[];
resolvedHandlers
.
forEach
(
(
resolvedHandler
)
=>
{
resolvedHandlers
.
forEach
(
resolvedHandler
=>
{
// Return early if the handler can not run in the current environment
let
canRun
=
resolvedHandler
.
canRun
();
...
...
@@ -675,7 +675,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
}
// Receive Results from Handler and apply
resultPromises
.
push
(
resolvedHandler
.
getResults
(
value
).
then
(
(
result
)
=>
{
resultPromises
.
push
(
resolvedHandler
.
getResults
(
value
).
then
(
result
=>
{
if
(
this
.
currentResultToken
===
currentResultToken
)
{
let
handlerResults
=
result
&&
result
.
entries
;
...
...
@@ -788,7 +788,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
}
// Receive Results from Handler and apply
return
resolvedHandler
.
getResults
(
value
).
then
(
(
result
)
=>
{
return
resolvedHandler
.
getResults
(
value
).
then
(
result
=>
{
if
(
this
.
currentResultToken
===
currentResultToken
)
{
if
(
!
result
||
!
result
.
entries
.
length
)
{
const
model
=
new
QuickOpenModel
([
new
PlaceholderQuickOpenEntry
(
resolvedHandler
.
getEmptyLabel
(
value
))]);
...
...
@@ -891,7 +891,15 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
private
description
:
string
;
private
detail
:
string
;
constructor
(
label
:
string
,
description
?:
string
,
detail
?:
string
,
private
onPreview
?:
()
=>
void
,
private
hasSeparator
?:
boolean
,
private
separatorLabel
?:
string
)
{
constructor
(
label
:
string
,
description
?:
string
,
detail
?:
string
,
private
onPreview
?:
()
=>
void
,
private
hasSeparator
?:
boolean
,
private
separatorLabel
?:
string
,
private
alwaysShow
?:
boolean
)
{
super
(
label
);
this
.
description
=
description
;
...
...
@@ -918,6 +926,10 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
return
this
.
separatorLabel
;
}
public
shouldAlwaysShow
():
boolean
{
return
this
.
alwaysShow
;
}
public
run
(
mode
:
Mode
,
context
:
IEntryRunContext
):
boolean
{
if
(
mode
===
Mode
.
OPEN
)
{
this
.
_shouldRunWithContext
=
context
;
...
...
@@ -936,7 +948,14 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
class
PickOpenItem
extends
QuickOpenEntryItem
{
private
_shouldRunWithContext
:
IEntryRunContext
;
constructor
(
private
label
:
string
,
private
description
:
string
,
private
height
:
number
,
private
renderFn
:
(
tree
:
ITree
,
container
:
HTMLElement
,
previousCleanupFn
:
IElementCallback
)
=>
IElementCallback
,
private
onPreview
?:
()
=>
void
)
{
constructor
(
private
label
:
string
,
private
description
:
string
,
private
height
:
number
,
private
renderFn
:
(
tree
:
ITree
,
container
:
HTMLElement
,
previousCleanupFn
:
IElementCallback
)
=>
IElementCallback
,
private
onPreview
?:
()
=>
void
,
private
alwaysShow
?:
boolean
)
{
super
();
}
...
...
@@ -960,6 +979,10 @@ class PickOpenItem extends QuickOpenEntryItem {
return
this
.
description
;
}
public
shouldAlwaysShow
():
boolean
{
return
this
.
alwaysShow
;
}
public
run
(
mode
:
Mode
,
context
:
IEntryRunContext
):
boolean
{
if
(
mode
===
Mode
.
OPEN
)
{
this
.
_shouldRunWithContext
=
context
;
...
...
src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts
浏览文件 @
b904d13d
...
...
@@ -71,6 +71,7 @@ class SelectThemeAction extends Action {
id
:
'
themes.findmore
'
,
label
:
localize
(
'
findMore
'
,
"
Find more in the Marketplace...
"
),
separator
:
{
border
:
true
},
alwaysShow
:
true
,
run
});
}
...
...
src/vs/workbench/services/quickopen/common/quickOpenService.ts
浏览文件 @
b904d13d
...
...
@@ -15,6 +15,7 @@ export interface IPickOpenEntry {
description
?:
string
;
detail
?:
string
;
separator
?:
ISeparator
;
alwaysShow
?:
boolean
;
run
?:
(
context
:
IEntryRunContext
)
=>
void
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录