Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b48230db
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,发现更多精彩内容 >>
提交
b48230db
编写于
6月 17, 2016
作者:
K
kieferrm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
handle allOf at toplevel, fixes #7833
上级
ea101fea
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
7 deletion
+14
-7
src/vs/platform/configuration/common/model.ts
src/vs/platform/configuration/common/model.ts
+14
-7
未找到文件。
src/vs/platform/configuration/common/model.ts
浏览文件 @
b48230db
...
@@ -117,16 +117,17 @@ export function consolidate(configMap: { [key: string]: IConfigFile; }): { conte
...
@@ -117,16 +117,17 @@ export function consolidate(configMap: { [key: string]: IConfigFile; }): { conte
// defaults...
// defaults...
function
processDefaultValues
(
withConfig
:
(
config
:
configurationRegistry
.
IConfigurationNode
,
isTop
?:
boolean
)
=>
void
):
void
{
function
processDefaultValues
(
withConfig
:
(
config
:
configurationRegistry
.
IConfigurationNode
,
isTop
?:
boolean
)
=>
boolean
):
void
{
let
configurations
=
(
<
configurationRegistry
.
IConfigurationRegistry
>
platform
.
Registry
.
as
(
configurationRegistry
.
Extensions
.
Configuration
)).
getConfigurations
();
let
configurations
=
(
<
configurationRegistry
.
IConfigurationRegistry
>
platform
.
Registry
.
as
(
configurationRegistry
.
Extensions
.
Configuration
)).
getConfigurations
();
let
visit
=
(
config
:
configurationRegistry
.
IConfigurationNode
,
isFirst
:
boolean
)
=>
{
let
visit
=
(
config
:
configurationRegistry
.
IConfigurationNode
,
level
:
number
)
=>
{
withConfig
(
config
,
isFirst
);
let
handled
=
withConfig
(
config
,
level
===
0
);
if
(
Array
.
isArray
(
config
.
allOf
))
{
if
(
Array
.
isArray
(
config
.
allOf
))
{
config
.
allOf
.
forEach
((
c
)
=>
{
config
.
allOf
.
forEach
((
c
)
=>
{
visit
(
c
,
false
);
// if the config node only contains an `allOf` we treat the `allOf` children as if they were at the top level
visit
(
c
,
(
!
handled
&&
level
===
0
)
?
level
:
level
+
1
);
});
});
}
}
};
};
...
@@ -142,7 +143,7 @@ function processDefaultValues(withConfig: (config: configurationRegistry.IConfig
...
@@ -142,7 +143,7 @@ function processDefaultValues(withConfig: (config: configurationRegistry.IConfig
return
c1
.
order
-
c2
.
order
;
return
c1
.
order
-
c2
.
order
;
}).
forEach
((
config
)
=>
{
}).
forEach
((
config
)
=>
{
visit
(
config
,
true
);
visit
(
config
,
0
);
});
});
}
}
...
@@ -150,7 +151,7 @@ function processDefaultValues(withConfig: (config: configurationRegistry.IConfig
...
@@ -150,7 +151,7 @@ function processDefaultValues(withConfig: (config: configurationRegistry.IConfig
export
function
getDefaultValues
():
any
{
export
function
getDefaultValues
():
any
{
let
ret
:
any
=
Object
.
create
(
null
);
let
ret
:
any
=
Object
.
create
(
null
);
let
handleConfig
=
(
config
:
configurationRegistry
.
IConfigurationNode
,
isTop
:
boolean
)
=>
{
let
handleConfig
=
(
config
:
configurationRegistry
.
IConfigurationNode
,
isTop
:
boolean
)
:
boolean
=>
{
if
(
config
.
properties
)
{
if
(
config
.
properties
)
{
Object
.
keys
(
config
.
properties
).
forEach
((
key
)
=>
{
Object
.
keys
(
config
.
properties
).
forEach
((
key
)
=>
{
let
prop
=
config
.
properties
[
key
];
let
prop
=
config
.
properties
[
key
];
...
@@ -160,7 +161,9 @@ export function getDefaultValues(): any {
...
@@ -160,7 +161,9 @@ export function getDefaultValues(): any {
}
}
setNode
(
ret
,
key
,
value
);
setNode
(
ret
,
key
,
value
);
});
});
return
true
;
}
}
return
false
;
};
};
processDefaultValues
(
handleConfig
);
processDefaultValues
(
handleConfig
);
return
ret
;
return
ret
;
...
@@ -172,9 +175,11 @@ export function getDefaultValuesContent(indent: string): string {
...
@@ -172,9 +175,11 @@ export function getDefaultValuesContent(indent: string): string {
let
result
:
string
[]
=
[];
let
result
:
string
[]
=
[];
result
.
push
(
'
{
'
);
result
.
push
(
'
{
'
);
let
handleConfig
=
(
config
:
configurationRegistry
.
IConfigurationNode
,
isTop
:
boolean
)
=>
{
let
handleConfig
=
(
config
:
configurationRegistry
.
IConfigurationNode
,
isTop
:
boolean
)
:
boolean
=>
{
let
handled
=
false
;
if
(
config
.
title
)
{
if
(
config
.
title
)
{
handled
=
true
;
if
(
isTop
)
{
if
(
isTop
)
{
result
.
push
(
''
);
result
.
push
(
''
);
result
.
push
(
'
//--------
'
+
config
.
title
+
'
--------
'
);
result
.
push
(
'
//--------
'
+
config
.
title
+
'
--------
'
);
...
@@ -184,6 +189,7 @@ export function getDefaultValuesContent(indent: string): string {
...
@@ -184,6 +189,7 @@ export function getDefaultValuesContent(indent: string): string {
result
.
push
(
''
);
result
.
push
(
''
);
}
}
if
(
config
.
properties
)
{
if
(
config
.
properties
)
{
handled
=
true
;
Object
.
keys
(
config
.
properties
).
forEach
((
key
)
=>
{
Object
.
keys
(
config
.
properties
).
forEach
((
key
)
=>
{
let
prop
=
config
.
properties
[
key
];
let
prop
=
config
.
properties
[
key
];
...
@@ -209,6 +215,7 @@ export function getDefaultValuesContent(indent: string): string {
...
@@ -209,6 +215,7 @@ export function getDefaultValuesContent(indent: string): string {
result
.
push
(
''
);
result
.
push
(
''
);
});
});
}
}
return
handled
;
};
};
processDefaultValues
(
handleConfig
);
processDefaultValues
(
handleConfig
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录