Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
94edf19b
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,发现更多精彩内容 >>
提交
94edf19b
编写于
6月 20, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Settings editor - filter result list when a TOC entry is clicked during search
上级
b31c338c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
11 deletion
+27
-11
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
...vs/workbench/parts/preferences/browser/settingsEditor2.ts
+6
-1
src/vs/workbench/parts/preferences/browser/settingsTree.ts
src/vs/workbench/parts/preferences/browser/settingsTree.ts
+20
-1
src/vs/workbench/parts/preferences/browser/tocTree.ts
src/vs/workbench/parts/preferences/browser/tocTree.ts
+1
-9
未找到文件。
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
浏览文件 @
94edf19b
...
...
@@ -243,7 +243,11 @@ export class SettingsEditor2 extends BaseEditor {
});
this
.
_register
(
this
.
tocTree
.
onDidChangeSelection
(
e
=>
{
if
(
this
.
settingsTreeModel
)
{
if
(
this
.
searchResultModel
)
{
const
element
=
e
.
selection
[
0
];
this
.
viewState
.
filterToCategory
=
element
;
this
.
refreshTreeAndMaintainFocus
();
}
else
if
(
this
.
settingsTreeModel
)
{
const
element
=
e
.
selection
[
0
];
const
currentSelection
=
this
.
settingsTree
.
getSelection
()[
0
];
const
isEqualOrParent
=
(
element
:
SettingsTreeElement
,
candidate
:
SettingsTreeElement
)
=>
{
...
...
@@ -550,6 +554,7 @@ export class SettingsEditor2 extends BaseEditor {
this
.
searchResultModel
=
null
;
this
.
tocTreeModel
.
currentSearchModel
=
null
;
this
.
viewState
.
filterToCategory
=
null
;
this
.
tocTree
.
refresh
();
this
.
toggleSearchMode
();
this
.
settingsTree
.
setInput
(
this
.
settingsTreeModel
.
root
);
...
...
src/vs/workbench/parts/preferences/browser/settingsTree.ts
浏览文件 @
94edf19b
...
...
@@ -359,6 +359,7 @@ function trimCategoryForGroup(category: string, groupId: string): string {
export
interface
ISettingsEditorViewState
{
settingsTarget
:
SettingsTarget
;
showConfiguredOnly
?:
boolean
;
filterToCategory
?:
SettingsTreeGroupElement
;
}
interface
IDisposableTemplate
{
...
...
@@ -674,7 +675,13 @@ export class SettingsTreeFilter implements IFilter {
)
{
}
isVisible
(
tree
:
ITree
,
element
:
SettingsTreeElement
):
boolean
{
if
(
this
.
viewState
.
showConfiguredOnly
&&
element
instanceof
SettingsTreeSettingElement
)
{
if
(
this
.
viewState
.
filterToCategory
&&
element
instanceof
SettingsTreeSettingElement
)
{
if
(
!
this
.
settingContainedInGroup
(
element
.
setting
,
this
.
viewState
.
filterToCategory
))
{
return
false
;
}
}
if
(
element
instanceof
SettingsTreeSettingElement
&&
this
.
viewState
.
showConfiguredOnly
)
{
return
element
.
isConfigured
;
}
...
...
@@ -685,6 +692,18 @@ export class SettingsTreeFilter implements IFilter {
return
true
;
}
private
settingContainedInGroup
(
setting
:
ISetting
,
group
:
SettingsTreeGroupElement
):
boolean
{
return
group
.
children
.
some
(
child
=>
{
if
(
child
instanceof
SettingsTreeGroupElement
)
{
return
this
.
settingContainedInGroup
(
setting
,
child
);
}
else
if
(
child
instanceof
SettingsTreeSettingElement
)
{
return
child
.
setting
.
key
===
setting
.
key
;
}
else
{
return
false
;
}
});
}
private
groupHasConfiguredSetting
(
element
:
SettingsTreeGroupElement
):
boolean
{
for
(
let
child
of
element
.
children
)
{
if
(
child
instanceof
SettingsTreeSettingElement
)
{
...
...
src/vs/workbench/parts/preferences/browser/tocTree.ts
浏览文件 @
94edf19b
...
...
@@ -114,11 +114,6 @@ interface ITOCEntryTemplate {
}
export
class
TOCRenderer
implements
IRenderer
{
constructor
(
@
IConfigurationService
private
configService
:
IConfigurationService
)
{
}
getHeight
(
tree
:
ITree
,
element
:
SettingsTreeElement
):
number
{
return
22
;
}
...
...
@@ -138,10 +133,7 @@ export class TOCRenderer implements IRenderer {
`
${
element
.
label
}
(
${(
<
any
>
element
).
count
}
)`
:
element
.
label
;
if
(
this
.
configService
.
getValue
(
'
workbench.settings.settingsSearchTocBehavior
'
)
===
'
show
'
)
{
DOM
.
toggleClass
(
template
.
element
,
'
no-results
'
,
(
<
any
>
element
).
count
===
0
);
}
DOM
.
toggleClass
(
template
.
element
,
'
no-results
'
,
(
<
any
>
element
).
count
===
0
);
template
.
element
.
textContent
=
label
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录