Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ddf9af90
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,发现更多精彩内容 >>
提交
ddf9af90
编写于
6月 14, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Settings editor - hide TOC on search
上级
b7548886
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
39 deletion
+22
-39
src/vs/workbench/parts/preferences/browser/media/settingsEditor2.css
...bench/parts/preferences/browser/media/settingsEditor2.css
+4
-0
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
...vs/workbench/parts/preferences/browser/settingsEditor2.ts
+7
-36
src/vs/workbench/parts/preferences/browser/settingsTree.ts
src/vs/workbench/parts/preferences/browser/settingsTree.ts
+7
-3
src/vs/workbench/parts/preferences/browser/tocTree.ts
src/vs/workbench/parts/preferences/browser/tocTree.ts
+4
-0
未找到文件。
src/vs/workbench/parts/preferences/browser/media/settingsEditor2.css
浏览文件 @
ddf9af90
...
...
@@ -126,6 +126,10 @@
width
:
200px
;
}
.search-mode
.settings-toc-container
.monaco-tree
{
display
:
none
;
}
.settings-editor
>
.settings-body
.settings-toc-container
.monaco-tree-row
.settings-toc-entry
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
...
...
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
浏览文件 @
ddf9af90
...
...
@@ -50,7 +50,6 @@ export class SettingsEditor2 extends BaseEditor {
private
settingsTargetsWidget
:
SettingsTargetsWidget
;
private
showConfiguredSettingsOnlyCheckbox
:
HTMLInputElement
;
private
savedExpandedGroups
:
any
[];
private
settingsTreeContainer
:
HTMLElement
;
private
settingsTree
:
WorkbenchTree
;
...
...
@@ -329,25 +328,7 @@ export class SettingsEditor2 extends BaseEditor {
private
onShowConfiguredOnlyClicked
():
void
{
this
.
viewState
.
showConfiguredOnly
=
this
.
showConfiguredSettingsOnlyCheckbox
.
checked
;
this
.
refreshTreeAndMaintainFocus
();
// TODO@roblou - This is slow
if
(
this
.
viewState
.
showConfiguredOnly
)
{
this
.
savedExpandedGroups
=
this
.
settingsTree
.
getExpandedElements
();
const
nav
=
this
.
settingsTree
.
getNavigator
();
let
element
;
while
(
element
=
nav
.
next
())
{
this
.
settingsTree
.
expand
(
element
);
}
}
else
if
(
this
.
savedExpandedGroups
)
{
const
nav
=
this
.
settingsTree
.
getNavigator
();
let
element
;
while
(
element
=
nav
.
next
())
{
this
.
settingsTree
.
collapse
(
element
);
}
this
.
settingsTree
.
expandAll
(
this
.
savedExpandedGroups
);
this
.
savedExpandedGroups
=
null
;
}
this
.
expandAll
(
this
.
settingsTree
);
}
private
onDidChangeSetting
(
key
:
string
,
value
:
any
):
void
{
...
...
@@ -446,19 +427,19 @@ export class SettingsEditor2 extends BaseEditor {
}
this
.
defaultSettingsEditorModel
=
model
;
// if (!this.settingsTree.getInput()) {
this
.
tocTree
.
setInput
(
getTOCElement
(
tocData
));
this
.
settingsTreeModel
=
this
.
instantiationService
.
createInstance
(
SettingsTreeModel
,
this
.
viewState
,
tocData
,
this
.
defaultSettingsEditorModel
.
settingsGroups
.
slice
(
1
));
this
.
settingsTree
.
setInput
(
this
.
settingsTreeModel
.
root
);
this
.
expandAll
(
this
.
settingsTree
);
this
.
expandAll
(
this
.
tocTree
);
// }
});
}
return
TPromise
.
as
(
null
);
}
private
toggleSearchMode
():
void
{
DOM
.
toggleClass
(
this
.
getContainer
(),
'
search-mode
'
,
!!
this
.
searchResultModel
);
}
private
refreshTreeAndMaintainFocus
():
TPromise
<
any
>
{
// Sort of a hack to maintain focus on the focused control across a refresh
const
focusedRowItem
=
DOM
.
findParentWithClass
(
<
HTMLElement
>
document
.
activeElement
,
'
setting-item
'
);
...
...
@@ -507,25 +488,14 @@ export class SettingsEditor2 extends BaseEditor {
}
this
.
searchResultModel
=
null
;
this
.
toggleSearchMode
();
this
.
settingsTree
.
setInput
(
this
.
settingsTreeModel
.
root
);
this
.
expandAll
(
this
.
settingsTree
);
this
.
expandAll
(
this
.
tocTree
);
return
TPromise
.
wrap
(
null
);
}
}
private
expandAll
(
tree
:
ITree
):
void
{
// const expandSubtree = (element: IResolvedTOCEntry) => {
// const nav = tree.getNavigator();
// while (nav.)
// if (element.children) {
// element.children.forEach(expandSubtree);
// }
// };
// expandSubtree(this.resolvedTocData);
const
nav
=
tree
.
getNavigator
();
let
cur
;
while
(
cur
=
nav
.
next
())
{
...
...
@@ -593,6 +563,7 @@ export class SettingsEditor2 extends BaseEditor {
const
[
result
]
=
results
;
if
(
!
this
.
searchResultModel
)
{
this
.
searchResultModel
=
new
SearchResultModel
();
this
.
toggleSearchMode
();
this
.
settingsTree
.
setInput
(
this
.
searchResultModel
);
}
...
...
src/vs/workbench/parts/preferences/browser/settingsTree.ts
浏览文件 @
ddf9af90
...
...
@@ -222,8 +222,7 @@ export class SettingsDataSource implements IDataSource {
constructor
(
private
viewState
:
ISettingsEditorViewState
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
)
{
}
)
{
}
getId
(
tree
:
ITree
,
element
:
SettingsTreeElement
):
string
{
return
element
.
id
;
...
...
@@ -260,6 +259,7 @@ export class SettingsDataSource implements IDataSource {
return
null
;
}
}
private
getGroupChildren
(
groupElement
:
SettingsTreeGroupElement
):
SettingsTreeElement
[]
{
return
groupElement
.
children
;
}
...
...
@@ -267,6 +267,10 @@ export class SettingsDataSource implements IDataSource {
getParent
(
tree
:
ITree
,
element
:
SettingsTreeElement
):
TPromise
<
any
,
any
>
{
return
TPromise
.
wrap
(
element
.
parent
);
}
shouldAutoexpand
():
boolean
{
return
true
;
}
}
export
function
settingKeyToDisplayFormat
(
key
:
string
,
groupId
:
string
):
{
category
:
string
,
label
:
string
}
{
...
...
@@ -358,7 +362,7 @@ export interface ISettingChangeEvent {
export
class
SettingsRenderer
implements
IRenderer
{
private
static
readonly
SETTING_ROW_HEIGHT
=
8
5
;
private
static
readonly
SETTING_ROW_HEIGHT
=
8
2
;
private
readonly
_onDidChangeSetting
:
Emitter
<
ISettingChangeEvent
>
=
new
Emitter
<
ISettingChangeEvent
>
();
public
readonly
onDidChangeSetting
:
Event
<
ISettingChangeEvent
>
=
this
.
_onDidChangeSetting
.
event
;
...
...
src/vs/workbench/parts/preferences/browser/tocTree.ts
浏览文件 @
ddf9af90
...
...
@@ -54,6 +54,10 @@ export class TOCDataSource implements IDataSource {
getParent
(
tree
:
ITree
,
element
:
TOCElement
):
TPromise
<
any
,
any
>
{
return
TPromise
.
wrap
(
element
.
parent
);
}
shouldAutoexpand
()
{
return
true
;
}
}
const
TOC_ENTRY_TEMPLATE_ID
=
'
settings.toc.entry
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录