Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
41ddd41b
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
41ddd41b
编写于
10月 29, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #59286
上级
4beb0d54
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
26 addition
and
22 deletion
+26
-22
src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
+7
-4
src/vs/base/browser/ui/iconLabel/iconLabel.ts
src/vs/base/browser/ui/iconLabel/iconLabel.ts
+3
-2
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
+1
-1
src/vs/base/test/browser/highlightedLabel.test.ts
src/vs/base/test/browser/highlightedLabel.test.ts
+1
-1
src/vs/editor/contrib/documentSymbols/outlineTree.ts
src/vs/editor/contrib/documentSymbols/outlineTree.ts
+2
-2
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
+1
-1
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+1
-1
src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts
...bench/parts/markers/electron-browser/markersTreeViewer.ts
+5
-5
src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts
.../workbench/parts/preferences/browser/keybindingsEditor.ts
+5
-5
未找到文件。
src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
浏览文件 @
41ddd41b
...
...
@@ -21,7 +21,7 @@ export class HighlightedLabel implements IDisposable {
private
highlights
:
IHighlight
[];
private
didEverRender
:
boolean
;
constructor
(
container
:
HTMLElement
)
{
constructor
(
container
:
HTMLElement
,
private
supportOcticons
:
boolean
)
{
this
.
domNode
=
document
.
createElement
(
'
span
'
);
this
.
domNode
.
className
=
'
monaco-highlighted-label
'
;
this
.
didEverRender
=
false
;
...
...
@@ -68,19 +68,22 @@ export class HighlightedLabel implements IDisposable {
}
if
(
pos
<
highlight
.
start
)
{
htmlContent
.
push
(
'
<span>
'
);
htmlContent
.
push
(
renderOcticons
(
this
.
text
.
substring
(
pos
,
highlight
.
start
)));
const
substring
=
this
.
text
.
substring
(
pos
,
highlight
.
start
);
htmlContent
.
push
(
this
.
supportOcticons
?
renderOcticons
(
substring
)
:
substring
);
htmlContent
.
push
(
'
</span>
'
);
pos
=
highlight
.
end
;
}
htmlContent
.
push
(
'
<span class="highlight">
'
);
htmlContent
.
push
(
renderOcticons
(
this
.
text
.
substring
(
highlight
.
start
,
highlight
.
end
)));
const
substring
=
this
.
text
.
substring
(
highlight
.
start
,
highlight
.
end
);
htmlContent
.
push
(
this
.
supportOcticons
?
renderOcticons
(
substring
)
:
substring
);
htmlContent
.
push
(
'
</span>
'
);
pos
=
highlight
.
end
;
}
if
(
pos
<
this
.
text
.
length
)
{
htmlContent
.
push
(
'
<span>
'
);
htmlContent
.
push
(
renderOcticons
(
this
.
text
.
substring
(
pos
)));
const
substring
=
this
.
text
.
substring
(
pos
);
htmlContent
.
push
(
this
.
supportOcticons
?
renderOcticons
(
substring
)
:
substring
);
htmlContent
.
push
(
'
</span>
'
);
}
...
...
src/vs/base/browser/ui/iconLabel/iconLabel.ts
浏览文件 @
41ddd41b
...
...
@@ -12,6 +12,7 @@ import { IDisposable, combinedDisposable, Disposable } from 'vs/base/common/life
export
interface
IIconLabelCreationOptions
{
supportHighlights
?:
boolean
;
supportDescriptionHighlights
?:
boolean
;
donotSupportOcticons
?:
boolean
;
}
export
interface
IIconLabelValueOptions
{
...
...
@@ -99,13 +100,13 @@ export class IconLabel extends Disposable {
this
.
labelDescriptionContainer
=
this
.
_register
(
new
FastLabelNode
(
dom
.
append
(
this
.
domNode
.
element
,
dom
.
$
(
'
.monaco-icon-label-description-container
'
))));
if
(
options
&&
options
.
supportHighlights
)
{
this
.
labelNode
=
this
.
_register
(
new
HighlightedLabel
(
dom
.
append
(
this
.
labelDescriptionContainer
.
element
,
dom
.
$
(
'
a.label-name
'
))));
this
.
labelNode
=
this
.
_register
(
new
HighlightedLabel
(
dom
.
append
(
this
.
labelDescriptionContainer
.
element
,
dom
.
$
(
'
a.label-name
'
))
,
!
options
.
donotSupportOcticons
));
}
else
{
this
.
labelNode
=
this
.
_register
(
new
FastLabelNode
(
dom
.
append
(
this
.
labelDescriptionContainer
.
element
,
dom
.
$
(
'
a.label-name
'
))));
}
if
(
options
&&
options
.
supportDescriptionHighlights
)
{
this
.
descriptionNodeFactory
=
()
=>
this
.
_register
(
new
HighlightedLabel
(
dom
.
append
(
this
.
labelDescriptionContainer
.
element
,
dom
.
$
(
'
span.label-description
'
))));
this
.
descriptionNodeFactory
=
()
=>
this
.
_register
(
new
HighlightedLabel
(
dom
.
append
(
this
.
labelDescriptionContainer
.
element
,
dom
.
$
(
'
span.label-description
'
))
,
!
options
.
donotSupportOcticons
));
}
else
{
this
.
descriptionNodeFactory
=
()
=>
this
.
_register
(
new
FastLabelNode
(
dom
.
append
(
this
.
labelDescriptionContainer
.
element
,
dom
.
$
(
'
span.label-description
'
))));
}
...
...
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
浏览文件 @
41ddd41b
...
...
@@ -377,7 +377,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
const
detailContainer
=
document
.
createElement
(
'
div
'
);
row2
.
appendChild
(
detailContainer
);
DOM
.
addClass
(
detailContainer
,
'
quick-open-entry-meta
'
);
const
detail
=
new
HighlightedLabel
(
detailContainer
);
const
detail
=
new
HighlightedLabel
(
detailContainer
,
true
);
// Entry Group
let
group
:
HTMLDivElement
;
...
...
src/vs/base/test/browser/highlightedLabel.test.ts
浏览文件 @
41ddd41b
...
...
@@ -9,7 +9,7 @@ suite('HighlightedLabel', () => {
let
label
:
HighlightedLabel
;
setup
(()
=>
{
label
=
new
HighlightedLabel
(
document
.
createElement
(
'
div
'
));
label
=
new
HighlightedLabel
(
document
.
createElement
(
'
div
'
)
,
true
);
});
teardown
(()
=>
{
...
...
src/vs/editor/contrib/documentSymbols/outlineTree.ts
浏览文件 @
41ddd41b
...
...
@@ -146,13 +146,13 @@ export class OutlineRenderer implements IRenderer {
const
decoration
=
dom
.
$
(
'
.outline-element-decoration
'
);
dom
.
addClass
(
container
,
'
outline-element
'
);
dom
.
append
(
container
,
icon
,
labelContainer
,
detail
,
decoration
);
return
{
icon
,
labelContainer
,
label
:
new
HighlightedLabel
(
labelContainer
),
detail
,
decoration
};
return
{
icon
,
labelContainer
,
label
:
new
HighlightedLabel
(
labelContainer
,
true
),
detail
,
decoration
};
}
if
(
templateId
===
'
outline-group
'
)
{
const
labelContainer
=
dom
.
$
(
'
.outline-element-label
'
);
dom
.
addClass
(
container
,
'
outline-element
'
);
dom
.
append
(
container
,
labelContainer
);
return
{
labelContainer
,
label
:
new
HighlightedLabel
(
labelContainer
)
};
return
{
labelContainer
,
label
:
new
HighlightedLabel
(
labelContainer
,
true
)
};
}
throw
new
Error
(
templateId
);
...
...
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
浏览文件 @
41ddd41b
...
...
@@ -116,7 +116,7 @@ class ListElementRenderer implements IListRenderer<ListElement, IListElementTemp
// Detail
const
detailContainer
=
dom
.
append
(
row2
,
$
(
'
.quick-input-list-label-meta
'
));
data
.
detail
=
new
HighlightedLabel
(
detailContainer
);
data
.
detail
=
new
HighlightedLabel
(
detailContainer
,
true
);
// Separator
data
.
separator
=
dom
.
append
(
data
.
entry
,
$
(
'
.quick-input-list-separator
'
));
...
...
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
41ddd41b
...
...
@@ -547,7 +547,7 @@ class TreeRenderer implements IRenderer {
DOM
.
addClass
(
container
,
'
custom-view-tree-node-item
'
);
const
icon
=
DOM
.
append
(
container
,
DOM
.
$
(
'
.custom-view-tree-node-item-icon
'
));
const
resourceLabel
=
this
.
instantiationService
.
createInstance
(
ResourceLabel
,
container
,
{
supportHighlights
:
true
});
const
resourceLabel
=
this
.
instantiationService
.
createInstance
(
ResourceLabel
,
container
,
{
supportHighlights
:
true
,
donotSupportOcticons
:
true
});
DOM
.
addClass
(
resourceLabel
.
element
,
'
custom-view-tree-node-item-resourceLabel
'
);
const
actionsContainer
=
DOM
.
append
(
resourceLabel
.
element
,
DOM
.
$
(
'
.actions
'
));
const
actionBar
=
new
ActionBar
(
actionsContainer
,
{
...
...
src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts
浏览文件 @
41ddd41b
...
...
@@ -221,9 +221,9 @@ export class MarkerRenderer implements ITreeRenderer<Marker, MarkerFilterData, I
const
actionsContainer
=
dom
.
append
(
container
,
dom
.
$
(
'
.actions
'
));
data
.
actionBar
=
new
ActionBar
(
actionsContainer
,
{
actionItemProvider
:
this
.
actionItemProvider
});
data
.
icon
=
dom
.
append
(
container
,
dom
.
$
(
'
.icon
'
));
data
.
source
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
''
)));
data
.
description
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
'
.marker-description
'
)));
data
.
code
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
''
)));
data
.
source
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
''
))
,
false
);
data
.
description
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
'
.marker-description
'
))
,
false
);
data
.
code
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
''
))
,
false
);
data
.
lnCol
=
dom
.
append
(
container
,
dom
.
$
(
'
span.marker-line
'
));
return
data
;
}
...
...
@@ -291,14 +291,14 @@ export class RelatedInformationRenderer implements ITreeRenderer<RelatedInformat
dom
.
append
(
container
,
dom
.
$
(
'
.actions
'
));
dom
.
append
(
container
,
dom
.
$
(
'
.icon
'
));
data
.
resourceLabel
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
'
.related-info-resource
'
)));
data
.
resourceLabel
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
'
.related-info-resource
'
))
,
false
);
data
.
lnCol
=
dom
.
append
(
container
,
dom
.
$
(
'
span.marker-line
'
));
const
separator
=
dom
.
append
(
container
,
dom
.
$
(
'
span.related-info-resource-separator
'
));
separator
.
textContent
=
'
:
'
;
separator
.
style
.
paddingRight
=
'
4px
'
;
data
.
description
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
'
.marker-description
'
)));
data
.
description
=
new
HighlightedLabel
(
dom
.
append
(
container
,
dom
.
$
(
'
.marker-description
'
))
,
false
);
return
data
;
}
...
...
src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts
浏览文件 @
41ddd41b
...
...
@@ -863,15 +863,15 @@ class CommandColumn extends Column {
this
.
commandColumn
.
setAttribute
(
'
aria-label
'
,
this
.
getAriaLabel
(
keybindingItemEntry
));
let
commandLabel
:
HighlightedLabel
;
if
(
keybindingItem
.
commandLabel
)
{
commandLabel
=
new
HighlightedLabel
(
this
.
commandColumn
);
commandLabel
=
new
HighlightedLabel
(
this
.
commandColumn
,
false
);
commandLabel
.
set
(
keybindingItem
.
commandLabel
,
keybindingItemEntry
.
commandLabelMatches
);
}
if
(
keybindingItemEntry
.
commandDefaultLabelMatches
)
{
commandLabel
=
new
HighlightedLabel
(
DOM
.
append
(
this
.
commandColumn
,
$
(
'
.command-default-label
'
)));
commandLabel
=
new
HighlightedLabel
(
DOM
.
append
(
this
.
commandColumn
,
$
(
'
.command-default-label
'
))
,
false
);
commandLabel
.
set
(
keybindingItem
.
commandDefaultLabel
,
keybindingItemEntry
.
commandDefaultLabelMatches
);
}
if
(
keybindingItemEntry
.
commandIdMatches
||
!
keybindingItem
.
commandLabel
)
{
commandLabel
=
new
HighlightedLabel
(
DOM
.
append
(
this
.
commandColumn
,
$
(
'
.code
'
)));
commandLabel
=
new
HighlightedLabel
(
DOM
.
append
(
this
.
commandColumn
,
$
(
'
.code
'
))
,
false
);
commandLabel
.
set
(
keybindingItem
.
command
,
keybindingItemEntry
.
commandIdMatches
);
}
if
(
commandLabel
)
{
...
...
@@ -918,7 +918,7 @@ class SourceColumn extends Column {
render
(
keybindingItemEntry
:
IKeybindingItemEntry
):
void
{
DOM
.
clearNode
(
this
.
sourceColumn
);
this
.
sourceColumn
.
setAttribute
(
'
aria-label
'
,
this
.
getAriaLabel
(
keybindingItemEntry
));
new
HighlightedLabel
(
this
.
sourceColumn
).
set
(
keybindingItemEntry
.
keybindingItem
.
source
,
keybindingItemEntry
.
sourceMatches
);
new
HighlightedLabel
(
this
.
sourceColumn
,
false
).
set
(
keybindingItemEntry
.
keybindingItem
.
source
,
keybindingItemEntry
.
sourceMatches
);
}
private
getAriaLabel
(
keybindingItemEntry
:
IKeybindingItemEntry
):
string
{
...
...
@@ -942,7 +942,7 @@ class WhenColumn extends Column {
DOM
.
toggleClass
(
this
.
whenColumn
,
'
code
'
,
!!
keybindingItemEntry
.
keybindingItem
.
when
);
DOM
.
toggleClass
(
this
.
whenColumn
,
'
empty
'
,
!
keybindingItemEntry
.
keybindingItem
.
when
);
if
(
keybindingItemEntry
.
keybindingItem
.
when
)
{
const
whenLabel
=
new
HighlightedLabel
(
this
.
whenColumn
);
const
whenLabel
=
new
HighlightedLabel
(
this
.
whenColumn
,
false
);
whenLabel
.
set
(
keybindingItemEntry
.
keybindingItem
.
when
,
keybindingItemEntry
.
whenMatches
);
this
.
whenColumn
.
title
=
keybindingItemEntry
.
keybindingItem
.
when
;
whenLabel
.
element
.
title
=
keybindingItemEntry
.
keybindingItem
.
when
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录