Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
02f6319c
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,体验更适合开发者的 AI 搜索 >>
提交
02f6319c
编写于
11月 11, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix autoSaveDelay missing from Commonly Used, add warnings for settings patterns
上级
fac5cc3a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
9 deletion
+13
-9
src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
.../workbench/contrib/preferences/browser/settingsEditor2.ts
+2
-2
src/vs/workbench/contrib/preferences/browser/settingsLayout.ts
...s/workbench/contrib/preferences/browser/settingsLayout.ts
+1
-1
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
+10
-6
未找到文件。
src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
浏览文件 @
02f6319c
...
...
@@ -964,7 +964,7 @@ export class SettingsEditor2 extends EditorPane {
const
groups
=
this
.
defaultSettingsEditorModel
.
settingsGroups
.
slice
(
1
);
// Without commonlyUsed
const
dividedGroups
=
collections
.
groupBy
(
groups
,
g
=>
g
.
extensionInfo
?
'
extension
'
:
'
core
'
);
const
settingsResult
=
resolveSettingsTree
(
tocData
,
dividedGroups
.
core
);
const
settingsResult
=
resolveSettingsTree
(
tocData
,
dividedGroups
.
core
,
this
.
logService
);
const
resolvedSettingsRoot
=
settingsResult
.
tree
;
// Warn for settings not included in layout
...
...
@@ -978,7 +978,7 @@ export class SettingsEditor2 extends EditorPane {
this
.
hasWarnedMissingSettings
=
true
;
}
const
commonlyUsed
=
resolveSettingsTree
(
commonlyUsedData
,
dividedGroups
.
core
);
const
commonlyUsed
=
resolveSettingsTree
(
commonlyUsedData
,
dividedGroups
.
core
,
this
.
logService
);
resolvedSettingsRoot
.
children
!
.
unshift
(
commonlyUsed
.
tree
);
resolvedSettingsRoot
.
children
!
.
push
(
resolveExtensionsSettings
(
dividedGroups
.
extension
||
[]));
...
...
src/vs/workbench/contrib/preferences/browser/settingsLayout.ts
浏览文件 @
02f6319c
...
...
@@ -17,7 +17,7 @@ export interface ITOCEntry {
export
const
commonlyUsedData
:
ITOCEntry
=
{
id
:
'
commonlyUsed
'
,
label
:
localize
(
'
commonlyUsed
'
,
"
Commonly Used
"
),
settings
:
[
'
files.autoSave
'
,
'
editor.fontSize
'
,
'
editor.fontSizeDelay
'
,
'
editor.fontFamily
'
,
'
editor.tabSize
'
,
'
editor.renderWhitespace
'
,
'
editor.cursorStyle
'
,
'
editor.multiCursorModifier
'
,
'
editor.insertSpaces
'
,
'
editor.wordWrap
'
,
'
files.exclude
'
,
'
files.associations
'
,
'
workbench.editor.enablePreview
'
]
settings
:
[
'
files.autoSave
'
,
'
files.autoSaveDelay
'
,
'
editor.fontSize
'
,
'
editor.fontFamily
'
,
'
editor.tabSize
'
,
'
editor.renderWhitespace
'
,
'
editor.cursorStyle
'
,
'
editor.multiCursorModifier
'
,
'
editor.insertSpaces
'
,
'
editor.wordWrap
'
,
'
files.exclude
'
,
'
files.associations
'
,
'
workbench.editor.enablePreview
'
]
};
export
const
tocData
:
ITOCEntry
=
{
...
...
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
浏览文件 @
02f6319c
...
...
@@ -55,6 +55,7 @@ import { IList } from 'vs/base/browser/ui/tree/indexTreeModel';
import
{
IListService
,
WorkbenchObjectTree
}
from
'
vs/platform/list/browser/listService
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IAccessibilityService
}
from
'
vs/platform/accessibility/common/accessibility
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
const
$
=
DOM
.
$
;
...
...
@@ -257,10 +258,10 @@ function getListDisplayValue(element: SettingsTreeSettingElement): IListDataItem
});
}
export
function
resolveSettingsTree
(
tocData
:
ITOCEntry
,
coreSettingsGroups
:
ISettingsGroup
[]):
{
tree
:
ITOCEntry
,
leftoverSettings
:
Set
<
ISetting
>
}
{
export
function
resolveSettingsTree
(
tocData
:
ITOCEntry
,
coreSettingsGroups
:
ISettingsGroup
[]
,
logService
:
ILogService
):
{
tree
:
ITOCEntry
,
leftoverSettings
:
Set
<
ISetting
>
}
{
const
allSettings
=
getFlatSettings
(
coreSettingsGroups
);
return
{
tree
:
_resolveSettingsTree
(
tocData
,
allSettings
),
tree
:
_resolveSettingsTree
(
tocData
,
allSettings
,
logService
),
leftoverSettings
:
allSettings
};
}
...
...
@@ -288,17 +289,17 @@ export function resolveExtensionsSettings(groups: ISettingsGroup[]): ITOCEntry {
};
}
function
_resolveSettingsTree
(
tocData
:
ITOCEntry
,
allSettings
:
Set
<
ISetting
>
):
ITOCEntry
{
function
_resolveSettingsTree
(
tocData
:
ITOCEntry
,
allSettings
:
Set
<
ISetting
>
,
logService
:
ILogService
):
ITOCEntry
{
let
children
:
ITOCEntry
[]
|
undefined
;
if
(
tocData
.
children
)
{
children
=
tocData
.
children
.
map
(
child
=>
_resolveSettingsTree
(
child
,
allSettings
))
.
map
(
child
=>
_resolveSettingsTree
(
child
,
allSettings
,
logService
))
.
filter
(
child
=>
(
child
.
children
&&
child
.
children
.
length
)
||
(
child
.
settings
&&
child
.
settings
.
length
));
}
let
settings
:
ISetting
[]
|
undefined
;
if
(
tocData
.
settings
)
{
settings
=
arrays
.
flatten
(
tocData
.
settings
.
map
(
pattern
=>
getMatchingSettings
(
allSettings
,
<
string
>
pattern
)));
settings
=
arrays
.
flatten
(
tocData
.
settings
.
map
(
pattern
=>
getMatchingSettings
(
allSettings
,
<
string
>
pattern
,
logService
)));
}
if
(
!
children
&&
!
settings
)
{
...
...
@@ -313,7 +314,7 @@ function _resolveSettingsTree(tocData: ITOCEntry, allSettings: Set<ISetting>): I
};
}
function
getMatchingSettings
(
allSettings
:
Set
<
ISetting
>
,
pattern
:
string
):
ISetting
[]
{
function
getMatchingSettings
(
allSettings
:
Set
<
ISetting
>
,
pattern
:
string
,
logService
:
ILogService
):
ISetting
[]
{
const
result
:
ISetting
[]
=
[];
allSettings
.
forEach
(
s
=>
{
...
...
@@ -323,6 +324,9 @@ function getMatchingSettings(allSettings: Set<ISetting>, pattern: string): ISett
}
});
if
(
!
result
.
length
)
{
logService
.
warn
(
`Settings pattern "
${
pattern
}
" doesn't match any settings`
);
}
return
result
.
sort
((
a
,
b
)
=>
a
.
key
.
localeCompare
(
b
.
key
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录