Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
59cf7a96
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
59cf7a96
编写于
9月 21, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
let => const
上级
9f3efd44
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
44 addition
and
44 deletion
+44
-44
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
+20
-20
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
+24
-24
未找到文件。
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
浏览文件 @
59cf7a96
...
@@ -181,8 +181,8 @@ export class QuickOpenEntry {
...
@@ -181,8 +181,8 @@ export class QuickOpenEntry {
let
nameA
=
elementA
.
getLabel
();
let
nameA
=
elementA
.
getLabel
();
let
nameB
=
elementB
.
getLabel
();
let
nameB
=
elementB
.
getLabel
();
if
(
nameA
===
nameB
)
{
if
(
nameA
===
nameB
)
{
le
t
resourceA
=
elementA
.
getResource
();
cons
t
resourceA
=
elementA
.
getResource
();
le
t
resourceB
=
elementB
.
getResource
();
cons
t
resourceB
=
elementB
.
getResource
();
if
(
resourceA
&&
resourceB
)
{
if
(
resourceA
&&
resourceB
)
{
nameA
=
resourceA
.
fsPath
;
nameA
=
resourceA
.
fsPath
;
...
@@ -202,7 +202,7 @@ export class QuickOpenEntry {
...
@@ -202,7 +202,7 @@ export class QuickOpenEntry {
*/
*/
public
static
highlight
(
entry
:
QuickOpenEntry
,
lookFor
:
string
,
fuzzyHighlight
=
false
):
{
labelHighlights
:
IHighlight
[],
descriptionHighlights
:
IHighlight
[]
}
{
public
static
highlight
(
entry
:
QuickOpenEntry
,
lookFor
:
string
,
fuzzyHighlight
=
false
):
{
labelHighlights
:
IHighlight
[],
descriptionHighlights
:
IHighlight
[]
}
{
let
labelHighlights
:
IHighlight
[]
=
[];
let
labelHighlights
:
IHighlight
[]
=
[];
le
t
descriptionHighlights
:
IHighlight
[]
=
[];
cons
t
descriptionHighlights
:
IHighlight
[]
=
[];
const
normalizedLookFor
=
strings
.
stripWildcards
(
lookFor
);
const
normalizedLookFor
=
strings
.
stripWildcards
(
lookFor
);
const
label
=
entry
.
getLabel
();
const
label
=
entry
.
getLabel
();
...
@@ -219,7 +219,7 @@ export class QuickOpenEntry {
...
@@ -219,7 +219,7 @@ export class QuickOpenEntry {
// Fuzzy/Full-Path: Highlight is special
// Fuzzy/Full-Path: Highlight is special
else
if
(
fuzzyHighlight
||
lookFor
.
indexOf
(
paths
.
nativeSep
)
>=
0
)
{
else
if
(
fuzzyHighlight
||
lookFor
.
indexOf
(
paths
.
nativeSep
)
>=
0
)
{
le
t
candidateLabelHighlights
=
filters
.
matchesFuzzy
(
lookFor
,
label
,
fuzzyHighlight
);
cons
t
candidateLabelHighlights
=
filters
.
matchesFuzzy
(
lookFor
,
label
,
fuzzyHighlight
);
if
(
!
candidateLabelHighlights
)
{
if
(
!
candidateLabelHighlights
)
{
const
pathPrefix
=
description
?
(
description
+
paths
.
nativeSep
)
:
''
;
const
pathPrefix
=
description
?
(
description
+
paths
.
nativeSep
)
:
''
;
const
pathPrefixLength
=
pathPrefix
.
length
;
const
pathPrefixLength
=
pathPrefix
.
length
;
...
@@ -488,41 +488,41 @@ class Renderer implements IRenderer<QuickOpenEntry> {
...
@@ -488,41 +488,41 @@ class Renderer implements IRenderer<QuickOpenEntry> {
// Action Bar
// Action Bar
DOM
.
addClass
(
container
,
'
actions
'
);
DOM
.
addClass
(
container
,
'
actions
'
);
le
t
entryContainer
=
document
.
createElement
(
'
div
'
);
cons
t
entryContainer
=
document
.
createElement
(
'
div
'
);
DOM
.
addClass
(
entryContainer
,
'
sub-content
'
);
DOM
.
addClass
(
entryContainer
,
'
sub-content
'
);
container
.
appendChild
(
entryContainer
);
container
.
appendChild
(
entryContainer
);
le
t
actionBarContainer
=
document
.
createElement
(
'
div
'
);
cons
t
actionBarContainer
=
document
.
createElement
(
'
div
'
);
DOM
.
addClass
(
actionBarContainer
,
'
primary-action-bar
'
);
DOM
.
addClass
(
actionBarContainer
,
'
primary-action-bar
'
);
container
.
appendChild
(
actionBarContainer
);
container
.
appendChild
(
actionBarContainer
);
le
t
actionBar
=
new
ActionBar
(
actionBarContainer
,
{
cons
t
actionBar
=
new
ActionBar
(
actionBarContainer
,
{
actionRunner
:
this
.
actionRunner
actionRunner
:
this
.
actionRunner
});
});
// Entry
// Entry
le
t
entry
=
document
.
createElement
(
'
div
'
);
cons
t
entry
=
document
.
createElement
(
'
div
'
);
DOM
.
addClass
(
entry
,
'
quick-open-entry
'
);
DOM
.
addClass
(
entry
,
'
quick-open-entry
'
);
entryContainer
.
appendChild
(
entry
);
entryContainer
.
appendChild
(
entry
);
// Icon
// Icon
le
t
icon
=
document
.
createElement
(
'
span
'
);
cons
t
icon
=
document
.
createElement
(
'
span
'
);
entry
.
appendChild
(
icon
);
entry
.
appendChild
(
icon
);
// Label
// Label
le
t
label
=
new
HighlightedLabel
(
entry
);
cons
t
label
=
new
HighlightedLabel
(
entry
);
// Description
// Description
le
t
descriptionContainer
=
document
.
createElement
(
'
span
'
);
cons
t
descriptionContainer
=
document
.
createElement
(
'
span
'
);
entry
.
appendChild
(
descriptionContainer
);
entry
.
appendChild
(
descriptionContainer
);
DOM
.
addClass
(
descriptionContainer
,
'
quick-open-entry-description
'
);
DOM
.
addClass
(
descriptionContainer
,
'
quick-open-entry-description
'
);
le
t
description
=
new
HighlightedLabel
(
descriptionContainer
);
cons
t
description
=
new
HighlightedLabel
(
descriptionContainer
);
// Detail
// Detail
le
t
detailContainer
=
document
.
createElement
(
'
div
'
);
cons
t
detailContainer
=
document
.
createElement
(
'
div
'
);
entry
.
appendChild
(
detailContainer
);
entry
.
appendChild
(
detailContainer
);
DOM
.
addClass
(
detailContainer
,
'
quick-open-entry-meta
'
);
DOM
.
addClass
(
detailContainer
,
'
quick-open-entry-meta
'
);
le
t
detail
=
new
HighlightedLabel
(
detailContainer
);
cons
t
detail
=
new
HighlightedLabel
(
detailContainer
);
return
{
return
{
container
,
container
,
...
@@ -544,7 +544,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
...
@@ -544,7 +544,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
return
;
return
;
}
}
le
t
data
:
IQuickOpenEntryTemplateData
=
templateData
;
cons
t
data
:
IQuickOpenEntryTemplateData
=
templateData
;
// Action Bar
// Action Bar
if
(
this
.
actionProvider
.
hasActions
(
null
,
entry
))
{
if
(
this
.
actionProvider
.
hasActions
(
null
,
entry
))
{
...
@@ -567,7 +567,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
...
@@ -567,7 +567,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
// Entry group
// Entry group
if
(
entry
instanceof
QuickOpenEntryGroup
)
{
if
(
entry
instanceof
QuickOpenEntryGroup
)
{
le
t
group
=
<
QuickOpenEntryGroup
>
entry
;
cons
t
group
=
<
QuickOpenEntryGroup
>
entry
;
// Border
// Border
if
(
group
.
showBorder
())
{
if
(
group
.
showBorder
())
{
...
@@ -577,16 +577,16 @@ class Renderer implements IRenderer<QuickOpenEntry> {
...
@@ -577,16 +577,16 @@ class Renderer implements IRenderer<QuickOpenEntry> {
}
}
// Group Label
// Group Label
le
t
groupLabel
=
group
.
getGroupLabel
()
||
''
;
cons
t
groupLabel
=
group
.
getGroupLabel
()
||
''
;
(
<
IQuickOpenEntryGroupTemplateData
>
templateData
).
group
.
textContent
=
groupLabel
;
(
<
IQuickOpenEntryGroupTemplateData
>
templateData
).
group
.
textContent
=
groupLabel
;
}
}
// Normal Entry
// Normal Entry
if
(
entry
instanceof
QuickOpenEntry
)
{
if
(
entry
instanceof
QuickOpenEntry
)
{
le
t
[
labelHighlights
,
descriptionHighlights
,
detailHighlights
]
=
entry
.
getHighlights
();
cons
t
[
labelHighlights
,
descriptionHighlights
,
detailHighlights
]
=
entry
.
getHighlights
();
// Extra Class
// Extra Class
le
t
extraClass
=
entry
.
getExtraClass
();
cons
t
extraClass
=
entry
.
getExtraClass
();
if
(
extraClass
)
{
if
(
extraClass
)
{
DOM
.
addClass
(
data
.
entry
,
extraClass
);
DOM
.
addClass
(
data
.
entry
,
extraClass
);
}
else
{
}
else
{
...
@@ -594,7 +594,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
...
@@ -594,7 +594,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
}
}
// Icon
// Icon
le
t
iconClass
=
entry
.
getIcon
()
?
(
'
quick-open-entry-icon
'
+
entry
.
getIcon
())
:
''
;
cons
t
iconClass
=
entry
.
getIcon
()
?
(
'
quick-open-entry-icon
'
+
entry
.
getIcon
())
:
''
;
data
.
icon
.
className
=
iconClass
;
data
.
icon
.
className
=
iconClass
;
// Label
// Label
...
...
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
浏览文件 @
59cf7a96
...
@@ -121,7 +121,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -121,7 +121,7 @@ export class QuickOpenWidget implements IModelProvider {
// Eventing
// Eventing
div
.
on
(
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
div
.
on
(
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
le
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
cons
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
if
(
keyboardEvent
.
keyCode
===
KeyCode
.
Escape
)
{
if
(
keyboardEvent
.
keyCode
===
KeyCode
.
Escape
)
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
DOM
.
EventHelper
.
stop
(
e
,
true
);
...
@@ -151,7 +151,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -151,7 +151,7 @@ export class QuickOpenWidget implements IModelProvider {
this
.
inputElement
.
setAttribute
(
'
aria-autocomplete
'
,
'
list
'
);
this
.
inputElement
.
setAttribute
(
'
aria-autocomplete
'
,
'
list
'
);
DOM
.
addDisposableListener
(
this
.
inputBox
.
inputElement
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
DOM
.
addDisposableListener
(
this
.
inputBox
.
inputElement
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
le
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
cons
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
// Do not handle Tab: It is used to navigate between elements without mouse
// Do not handle Tab: It is used to navigate between elements without mouse
if
(
keyboardEvent
.
keyCode
===
KeyCode
.
Tab
)
{
if
(
keyboardEvent
.
keyCode
===
KeyCode
.
Tab
)
{
...
@@ -169,7 +169,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -169,7 +169,7 @@ export class QuickOpenWidget implements IModelProvider {
else
if
(
keyboardEvent
.
keyCode
===
KeyCode
.
Enter
)
{
else
if
(
keyboardEvent
.
keyCode
===
KeyCode
.
Enter
)
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
DOM
.
EventHelper
.
stop
(
e
,
true
);
le
t
focus
=
this
.
tree
.
getFocus
();
cons
t
focus
=
this
.
tree
.
getFocus
();
if
(
focus
)
{
if
(
focus
)
{
this
.
elementSelected
(
focus
,
e
);
this
.
elementSelected
(
focus
,
e
);
}
}
...
@@ -218,7 +218,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -218,7 +218,7 @@ export class QuickOpenWidget implements IModelProvider {
}));
}));
}).
}).
on
(
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
on
(
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
le
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
cons
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
// Only handle when in quick navigation mode
// Only handle when in quick navigation mode
if
(
!
this
.
quickNavigateConfiguration
)
{
if
(
!
this
.
quickNavigateConfiguration
)
{
...
@@ -233,8 +233,8 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -233,8 +233,8 @@ export class QuickOpenWidget implements IModelProvider {
}
}
}).
}).
on
(
DOM
.
EventType
.
KEY_UP
,
(
e
:
KeyboardEvent
)
=>
{
on
(
DOM
.
EventType
.
KEY_UP
,
(
e
:
KeyboardEvent
)
=>
{
le
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
cons
t
keyboardEvent
:
StandardKeyboardEvent
=
new
StandardKeyboardEvent
(
e
);
le
t
keyCode
=
keyboardEvent
.
keyCode
;
cons
t
keyCode
=
keyboardEvent
.
keyCode
;
// Only handle when in quick navigation mode
// Only handle when in quick navigation mode
if
(
!
this
.
quickNavigateConfiguration
)
{
if
(
!
this
.
quickNavigateConfiguration
)
{
...
@@ -242,8 +242,8 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -242,8 +242,8 @@ export class QuickOpenWidget implements IModelProvider {
}
}
// Select element when keys are pressed that signal it
// Select element when keys are pressed that signal it
le
t
quickNavKeys
=
this
.
quickNavigateConfiguration
.
keybindings
;
cons
t
quickNavKeys
=
this
.
quickNavigateConfiguration
.
keybindings
;
le
t
wasTriggerKeyPressed
=
keyCode
===
KeyCode
.
Enter
||
quickNavKeys
.
some
((
k
)
=>
{
cons
t
wasTriggerKeyPressed
=
keyCode
===
KeyCode
.
Enter
||
quickNavKeys
.
some
((
k
)
=>
{
if
(
k
.
hasShift
()
&&
keyCode
===
KeyCode
.
Shift
)
{
if
(
k
.
hasShift
()
&&
keyCode
===
KeyCode
.
Shift
)
{
if
(
keyboardEvent
.
ctrlKey
||
keyboardEvent
.
altKey
||
keyboardEvent
.
metaKey
)
{
if
(
keyboardEvent
.
ctrlKey
||
keyboardEvent
.
altKey
||
keyboardEvent
.
metaKey
)
{
return
false
;
// this is an optimistic check for the shift key being used to navigate back in quick open
return
false
;
// this is an optimistic check for the shift key being used to navigate back in quick open
...
@@ -282,7 +282,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -282,7 +282,7 @@ export class QuickOpenWidget implements IModelProvider {
});
});
if
(
wasTriggerKeyPressed
)
{
if
(
wasTriggerKeyPressed
)
{
le
t
focus
=
this
.
tree
.
getFocus
();
cons
t
focus
=
this
.
tree
.
getFocus
();
if
(
focus
)
{
if
(
focus
)
{
this
.
elementSelected
(
focus
,
e
);
this
.
elementSelected
(
focus
,
e
);
}
}
...
@@ -303,7 +303,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -303,7 +303,7 @@ export class QuickOpenWidget implements IModelProvider {
}
}
private
onType
():
void
{
private
onType
():
void
{
le
t
value
=
this
.
inputBox
.
value
;
cons
t
value
=
this
.
inputBox
.
value
;
// Adjust help text as needed if present
// Adjust help text as needed if present
if
(
this
.
helpText
)
{
if
(
this
.
helpText
)
{
...
@@ -411,8 +411,8 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -411,8 +411,8 @@ export class QuickOpenWidget implements IModelProvider {
// add telemetry when an item is accepted, logging the index of the item in the list and the length of the list
// add telemetry when an item is accepted, logging the index of the item in the list and the length of the list
// to measure the rate of the success and the relevance of the order
// to measure the rate of the success and the relevance of the order
if
(
this
.
usageLogger
)
{
if
(
this
.
usageLogger
)
{
le
t
indexOfAcceptedElement
=
this
.
model
.
entries
.
indexOf
(
value
);
cons
t
indexOfAcceptedElement
=
this
.
model
.
entries
.
indexOf
(
value
);
le
t
entriesCount
=
this
.
model
.
entries
.
length
;
cons
t
entriesCount
=
this
.
model
.
entries
.
length
;
this
.
usageLogger
.
publicLog
(
'
quickOpenWidgetItemAccepted
'
,
{
index
:
indexOfAcceptedElement
,
count
:
entriesCount
,
isQuickNavigate
:
this
.
quickNavigateConfiguration
?
true
:
false
});
this
.
usageLogger
.
publicLog
(
'
quickOpenWidgetItemAccepted
'
,
{
index
:
indexOfAcceptedElement
,
count
:
entriesCount
,
isQuickNavigate
:
this
.
quickNavigateConfiguration
?
true
:
false
});
}
}
...
@@ -516,10 +516,10 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -516,10 +516,10 @@ export class QuickOpenWidget implements IModelProvider {
if
(
autoFocus
.
autoFocusPrefixMatch
)
{
if
(
autoFocus
.
autoFocusPrefixMatch
)
{
let
caseSensitiveMatch
:
any
;
let
caseSensitiveMatch
:
any
;
let
caseInsensitiveMatch
:
any
;
let
caseInsensitiveMatch
:
any
;
le
t
prefix
=
autoFocus
.
autoFocusPrefixMatch
;
cons
t
prefix
=
autoFocus
.
autoFocusPrefixMatch
;
le
t
lowerCasePrefix
=
prefix
.
toLowerCase
();
cons
t
lowerCasePrefix
=
prefix
.
toLowerCase
();
for
(
let
i
=
0
;
i
<
entries
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
entries
.
length
;
i
++
)
{
le
t
entry
=
entries
[
i
];
cons
t
entry
=
entries
[
i
];
const
label
=
input
.
dataSource
.
getLabel
(
entry
);
const
label
=
input
.
dataSource
.
getLabel
(
entry
);
if
(
!
caseSensitiveMatch
&&
label
.
indexOf
(
prefix
)
===
0
)
{
if
(
!
caseSensitiveMatch
&&
label
.
indexOf
(
prefix
)
===
0
)
{
...
@@ -533,7 +533,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -533,7 +533,7 @@ export class QuickOpenWidget implements IModelProvider {
}
}
}
}
le
t
entryToFocus
=
caseSensitiveMatch
||
caseInsensitiveMatch
;
cons
t
entryToFocus
=
caseSensitiveMatch
||
caseInsensitiveMatch
;
if
(
entryToFocus
)
{
if
(
entryToFocus
)
{
this
.
tree
.
setFocus
(
entryToFocus
);
this
.
tree
.
setFocus
(
entryToFocus
);
this
.
tree
.
reveal
(
entryToFocus
,
0
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
tree
.
reveal
(
entryToFocus
,
0
).
done
(
null
,
errors
.
onUnexpectedError
);
...
@@ -599,7 +599,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -599,7 +599,7 @@ export class QuickOpenWidget implements IModelProvider {
const
renderer
=
input
.
renderer
;
const
renderer
=
input
.
renderer
;
if
(
!
input
)
{
if
(
!
input
)
{
le
t
itemHeight
=
renderer
.
getHeight
(
null
);
cons
t
itemHeight
=
renderer
.
getHeight
(
null
);
return
this
.
options
.
minItemsToShow
?
this
.
options
.
minItemsToShow
*
itemHeight
:
0
;
return
this
.
options
.
minItemsToShow
?
this
.
options
.
minItemsToShow
*
itemHeight
:
0
;
}
}
...
@@ -615,10 +615,10 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -615,10 +615,10 @@ export class QuickOpenWidget implements IModelProvider {
preferredItemsHeight
=
QuickOpenWidget
.
MAX_ITEMS_HEIGHT
;
preferredItemsHeight
=
QuickOpenWidget
.
MAX_ITEMS_HEIGHT
;
}
}
le
t
entries
=
input
.
entries
.
filter
(
e
=>
this
.
isElementVisible
(
input
,
e
));
cons
t
entries
=
input
.
entries
.
filter
(
e
=>
this
.
isElementVisible
(
input
,
e
));
le
t
maxEntries
=
this
.
options
.
maxItemsToShow
||
entries
.
length
;
cons
t
maxEntries
=
this
.
options
.
maxItemsToShow
||
entries
.
length
;
for
(
let
i
=
0
;
i
<
maxEntries
&&
i
<
entries
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
maxEntries
&&
i
<
entries
.
length
;
i
++
)
{
le
t
entryHeight
=
renderer
.
getHeight
(
entries
[
i
]);
cons
t
entryHeight
=
renderer
.
getHeight
(
entries
[
i
]);
if
(
height
+
entryHeight
<=
preferredItemsHeight
)
{
if
(
height
+
entryHeight
<=
preferredItemsHeight
)
{
height
+=
entryHeight
;
height
+=
entryHeight
;
}
else
{
}
else
{
...
@@ -641,7 +641,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -641,7 +641,7 @@ export class QuickOpenWidget implements IModelProvider {
// report failure cases
// report failure cases
if
(
reason
===
HideReason
.
CANCELED
)
{
if
(
reason
===
HideReason
.
CANCELED
)
{
if
(
this
.
model
)
{
if
(
this
.
model
)
{
le
t
entriesCount
=
this
.
model
.
entries
.
filter
(
e
=>
this
.
isElementVisible
(
this
.
model
,
e
)).
length
;
cons
t
entriesCount
=
this
.
model
.
entries
.
filter
(
e
=>
this
.
isElementVisible
(
this
.
model
,
e
)).
length
;
if
(
this
.
usageLogger
)
{
if
(
this
.
usageLogger
)
{
this
.
usageLogger
.
publicLog
(
'
quickOpenWidgetCancelled
'
,
{
count
:
entriesCount
,
isQuickNavigate
:
this
.
quickNavigateConfiguration
?
true
:
false
});
this
.
usageLogger
.
publicLog
(
'
quickOpenWidgetCancelled
'
,
{
count
:
entriesCount
,
isQuickNavigate
:
this
.
quickNavigateConfiguration
?
true
:
false
});
}
}
...
@@ -762,7 +762,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -762,7 +762,7 @@ export class QuickOpenWidget implements IModelProvider {
public
accept
():
void
{
public
accept
():
void
{
if
(
this
.
isVisible
())
{
if
(
this
.
isVisible
())
{
le
t
focus
=
this
.
tree
.
getFocus
();
cons
t
focus
=
this
.
tree
.
getFocus
();
if
(
focus
)
{
if
(
focus
)
{
this
.
elementSelected
(
focus
);
this
.
elementSelected
(
focus
);
}
}
...
@@ -774,7 +774,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -774,7 +774,7 @@ export class QuickOpenWidget implements IModelProvider {
}
}
public
setExtraClass
(
clazz
:
string
):
void
{
public
setExtraClass
(
clazz
:
string
):
void
{
le
t
previousClass
=
this
.
builder
.
getProperty
(
'
extra-class
'
);
cons
t
previousClass
=
this
.
builder
.
getProperty
(
'
extra-class
'
);
if
(
previousClass
)
{
if
(
previousClass
)
{
this
.
builder
.
removeClass
(
previousClass
);
this
.
builder
.
removeClass
(
previousClass
);
}
}
...
@@ -795,7 +795,7 @@ export class QuickOpenWidget implements IModelProvider {
...
@@ -795,7 +795,7 @@ export class QuickOpenWidget implements IModelProvider {
this
.
layoutDimensions
=
dimension
;
this
.
layoutDimensions
=
dimension
;
// Apply to quick open width (height is dynamic by number of items to show)
// Apply to quick open width (height is dynamic by number of items to show)
le
t
quickOpenWidth
=
Math
.
min
(
this
.
layoutDimensions
.
width
*
0.62
/* golden cut */
,
QuickOpenWidget
.
MAX_WIDTH
);
cons
t
quickOpenWidth
=
Math
.
min
(
this
.
layoutDimensions
.
width
*
0.62
/* golden cut */
,
QuickOpenWidget
.
MAX_WIDTH
);
if
(
this
.
builder
)
{
if
(
this
.
builder
)
{
// quick open
// quick open
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录