Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5dc2593c
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,发现更多精彩内容 >>
提交
5dc2593c
编写于
8月 29, 2018
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sanitize texts (fixes #56518)
上级
f70904da
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
9 deletion
+20
-9
src/vs/workbench/browser/parts/quickinput/quickInput.css
src/vs/workbench/browser/parts/quickinput/quickInput.css
+2
-0
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
+18
-9
未找到文件。
src/vs/workbench/browser/parts/quickinput/quickInput.css
浏览文件 @
5dc2593c
...
...
@@ -174,6 +174,8 @@
.quick-input-list
.quick-input-list-label-meta
{
opacity
:
0.7
;
line-height
:
normal
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.quick-input-list
.monaco-highlighted-label
.highlight
{
...
...
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
浏览文件 @
5dc2593c
...
...
@@ -35,6 +35,9 @@ const $ = dom.$;
interface
IListElement
{
index
:
number
;
item
:
IQuickPickItem
;
saneLabel
:
string
;
saneDescription
?:
string
;
saneDetail
?:
string
;
checked
:
boolean
;
separator
:
IQuickPickSeparator
;
fireButtonTriggered
:
(
event
:
IQuickPickItemButtonEvent
<
IQuickPickItem
>
)
=>
void
;
...
...
@@ -43,6 +46,9 @@ interface IListElement {
class
ListElement
implements
IListElement
{
index
:
number
;
item
:
IQuickPickItem
;
saneLabel
:
string
;
saneDescription
?:
string
;
saneDetail
?:
string
;
shouldAlwaysShow
=
false
;
hidden
=
false
;
private
_onChecked
=
new
Emitter
<
boolean
>
();
...
...
@@ -137,16 +143,16 @@ class ListElementRenderer implements IRenderer<ListElement, IListElementTemplate
// Label
const
options
:
IIconLabelValueOptions
=
Object
.
create
(
null
);
options
.
matches
=
labelHighlights
||
[];
options
.
descriptionTitle
=
element
.
item
.
d
escription
;
options
.
descriptionTitle
=
element
.
saneD
escription
;
options
.
descriptionMatches
=
descriptionHighlights
||
[];
options
.
extraClasses
=
element
.
item
.
iconClasses
;
data
.
label
.
setValue
(
element
.
item
.
label
,
element
.
item
.
d
escription
,
options
);
data
.
label
.
setValue
(
element
.
saneLabel
,
element
.
saneD
escription
,
options
);
// Meta
data
.
detail
.
set
(
element
.
item
.
d
etail
,
detailHighlights
);
data
.
detail
.
set
(
element
.
saneD
etail
,
detailHighlights
);
// ARIA label
data
.
entry
.
setAttribute
(
'
aria-label
'
,
[
element
.
item
.
label
,
element
.
item
.
description
,
element
.
item
.
d
etail
]
data
.
entry
.
setAttribute
(
'
aria-label
'
,
[
element
.
saneLabel
,
element
.
saneDescription
,
element
.
saneD
etail
]
.
filter
(
s
=>
!!
s
)
.
join
(
'
,
'
));
...
...
@@ -197,7 +203,7 @@ class ListElementRenderer implements IRenderer<ListElement, IListElementTemplate
class
ListElementDelegate
implements
IVirtualDelegate
<
ListElement
>
{
getHeight
(
element
:
ListElement
):
number
{
return
element
.
item
.
d
etail
?
44
:
22
;
return
element
.
saneD
etail
?
44
:
22
;
}
getTemplateId
(
element
:
ListElement
):
string
{
...
...
@@ -358,6 +364,9 @@ export class QuickInputList {
result
.
push
(
new
ListElement
({
index
,
item
,
saneLabel
:
item
.
label
&&
item
.
label
.
replace
(
/
\r?\n
/g
,
'
'
),
saneDescription
:
item
.
description
&&
item
.
description
.
replace
(
/
\r?\n
/g
,
'
'
),
saneDetail
:
item
.
detail
&&
item
.
detail
.
replace
(
/
\r?\n
/g
,
'
'
),
checked
:
false
,
separator
:
previous
&&
previous
.
type
===
'
separator
'
?
previous
:
undefined
,
fireButtonTriggered
...
...
@@ -473,9 +482,9 @@ export class QuickInputList {
// Filter by value (since we support octicons, use octicon aware fuzzy matching)
else
{
this
.
elements
.
forEach
(
element
=>
{
const
labelHighlights
=
matchesFuzzyOcticonAware
(
query
,
parseOcticons
(
element
.
item
.
l
abel
));
const
descriptionHighlights
=
this
.
matchOnDescription
?
matchesFuzzyOcticonAware
(
query
,
parseOcticons
(
element
.
item
.
d
escription
||
''
))
:
undefined
;
const
detailHighlights
=
this
.
matchOnDetail
?
matchesFuzzyOcticonAware
(
query
,
parseOcticons
(
element
.
item
.
d
etail
||
''
))
:
undefined
;
const
labelHighlights
=
matchesFuzzyOcticonAware
(
query
,
parseOcticons
(
element
.
saneL
abel
));
const
descriptionHighlights
=
this
.
matchOnDescription
?
matchesFuzzyOcticonAware
(
query
,
parseOcticons
(
element
.
saneD
escription
||
''
))
:
undefined
;
const
detailHighlights
=
this
.
matchOnDetail
?
matchesFuzzyOcticonAware
(
query
,
parseOcticons
(
element
.
saneD
etail
||
''
))
:
undefined
;
if
(
element
.
shouldAlwaysShow
||
labelHighlights
||
descriptionHighlights
||
detailHighlights
)
{
element
.
labelHighlights
=
labelHighlights
;
...
...
@@ -566,7 +575,7 @@ function compareEntries(elementA: ListElement, elementB: ListElement, lookFor: s
return
1
;
}
return
compareAnything
(
elementA
.
item
.
label
,
elementB
.
item
.
l
abel
,
lookFor
);
return
compareAnything
(
elementA
.
saneLabel
,
elementB
.
saneL
abel
,
lookFor
);
}
registerThemingParticipant
((
theme
,
collector
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录