Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0c2c8dd8
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 搜索 >>
提交
0c2c8dd8
编写于
11月 17, 2020
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Inline allOf clauses for additionalProperties: false (fixes microsoft/vscode-remote-release#2967)
上级
60c625e9
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
948 addition
and
3 deletion
+948
-3
build/hygiene.js
build/hygiene.js
+1
-0
extensions/configuration-editing/.vscodeignore
extensions/configuration-editing/.vscodeignore
+2
-0
extensions/configuration-editing/build/inline-allOf.ts
extensions/configuration-editing/build/inline-allOf.ts
+103
-0
extensions/configuration-editing/build/tsconfig.json
extensions/configuration-editing/build/tsconfig.json
+7
-0
extensions/configuration-editing/package.json
extensions/configuration-editing/package.json
+2
-2
extensions/configuration-editing/schemas/devContainer.schema.generated.json
...ration-editing/schemas/devContainer.schema.generated.json
+832
-0
extensions/configuration-editing/schemas/devContainer.schema.src.json
...onfiguration-editing/schemas/devContainer.schema.src.json
+1
-1
未找到文件。
build/hygiene.js
浏览文件 @
0c2c8dd8
...
...
@@ -119,6 +119,7 @@ const copyrightFilter = [
'
!resources/win32/bin/code.js
'
,
'
!resources/web/code-web.js
'
,
'
!resources/completions/**
'
,
'
!extensions/configuration-editing/build/inline-allOf.ts
'
,
'
!extensions/markdown-language-features/media/highlight.css
'
,
'
!extensions/html-language-features/server/src/modes/typescript/*
'
,
'
!extensions/*/server/bin/*
'
,
...
...
extensions/configuration-editing/.vscodeignore
浏览文件 @
0c2c8dd8
...
...
@@ -5,3 +5,5 @@ out/**
extension.webpack.config.js
extension-browser.webpack.config.js
yarn.lock
build/**
schemas/*.schema.src.json
extensions/configuration-editing/build/inline-allOf.ts
0 → 100755
浏览文件 @
0c2c8dd8
#!/usr/bin/env ts-node
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Inlines "allOf"s to allow for "additionalProperties": false. (https://github.com/microsoft/vscode-remote-release/issues/2967)
// Run this manually after updating devContainer.schema.src.json.
import
*
as
fs
from
'
fs
'
;
function
transform
(
schema
:
any
)
{
const
definitions
=
Object
.
keys
(
schema
.
definitions
)
.
reduce
((
d
,
k
)
=>
{
d
[
`#/definitions/
${
k
}
`
]
=
(
schema
.
definitions
as
any
)[
k
];
return
d
;
},
{}
as
any
);
function
copy
(
from
:
any
)
{
const
type
=
Array
.
isArray
(
from
)
?
'
array
'
:
typeof
from
;
switch
(
type
)
{
case
'
object
'
:
{
const
to
:
any
=
{};
for
(
const
key
in
from
)
{
switch
(
key
)
{
case
'
definitions
'
:
break
;
case
'
oneOf
'
:
const
list
=
copy
(
from
[
key
])
.
reduce
((
a
:
any
[],
o
:
any
)
=>
{
if
(
o
.
oneOf
)
{
a
.
push
(...
o
.
oneOf
);
}
else
{
a
.
push
(
o
);
}
return
a
;
},
[]
as
any
[]);
if
(
list
.
length
===
1
)
{
Object
.
assign
(
to
,
list
[
0
]);
}
else
{
to
.
oneOf
=
list
;
}
break
;
case
'
allOf
'
:
const
all
=
copy
(
from
[
key
]);
const
leaves
=
all
.
map
((
one
:
any
)
=>
(
one
.
oneOf
?
one
.
oneOf
:
[
one
]));
function
cross
(
res
:
any
,
leaves
:
any
[][]):
any
[]
{
if
(
leaves
.
length
)
{
const
rest
=
leaves
.
slice
(
1
);
return
([]
as
any
[]).
concat
(...
leaves
[
0
].
map
(
leaf
=>
{
const
intermediate
=
{
...
res
,
...
leaf
};
if
(
'
properties
'
in
res
&&
'
properties
'
in
leaf
)
{
intermediate
.
properties
=
{
...
res
.
properties
,
...
leaf
.
properties
,
};
}
return
cross
(
intermediate
,
rest
);
}));
}
return
[
res
];
}
const
list2
=
cross
({},
leaves
);
if
(
list2
.
length
===
1
)
{
Object
.
assign
(
to
,
list2
[
0
]);
}
else
{
to
.
oneOf
=
list2
;
}
break
;
case
'
$ref
'
:
const
ref
=
from
[
key
];
const
definition
=
definitions
[
ref
];
if
(
definition
)
{
Object
.
assign
(
to
,
copy
(
definition
));
}
else
{
to
[
key
]
=
ref
;
}
break
;
default
:
to
[
key
]
=
copy
(
from
[
key
]);
break
;
}
}
if
(
to
.
type
===
'
object
'
&&
!
(
'
additionalProperties
'
in
to
))
{
to
.
additionalProperties
=
false
;
}
return
to
;
}
case
'
array
'
:
{
return
from
.
map
(
copy
);
}
default
:
return
from
;
}
}
return
copy
(
schema
);
}
const
devContainer
=
JSON
.
parse
(
fs
.
readFileSync
(
'
../schemas/devContainer.schema.src.json
'
,
'
utf8
'
));
fs
.
writeFileSync
(
'
../schemas/devContainer.schema.generated.json
'
,
JSON
.
stringify
(
transform
(
devContainer
),
undefined
,
'
'
));
extensions/configuration-editing/build/tsconfig.json
0 → 100644
浏览文件 @
0c2c8dd8
{
"extends"
:
"../../shared.tsconfig.json"
,
"compilerOptions"
:
{
"resolveJsonModule"
:
true
,
"outDir"
:
"./out"
}
}
extensions/configuration-editing/package.json
浏览文件 @
0c2c8dd8
...
...
@@ -111,11 +111,11 @@
},
{
"fileMatch"
:
"/.devcontainer/devcontainer.json"
,
"url"
:
"./schemas/devContainer.schema.json"
"url"
:
"./schemas/devContainer.schema.
generated.
json"
},
{
"fileMatch"
:
"/.devcontainer.json"
,
"url"
:
"./schemas/devContainer.schema.json"
"url"
:
"./schemas/devContainer.schema.
generated.
json"
},
{
"fileMatch"
:
"%APP_SETTINGS_HOME%/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/*.json"
,
...
...
extensions/configuration-editing/schemas/devContainer.schema.generated.json
0 → 100644
浏览文件 @
0c2c8dd8
此差异已折叠。
点击以展开。
extensions/configuration-editing/schemas/devContainer.schema.json
→
extensions/configuration-editing/schemas/devContainer.schema.
src.
json
浏览文件 @
0c2c8dd8
...
...
@@ -3,7 +3,6 @@
"description"
:
"Defines a dev container"
,
"allowComments"
:
true
,
"allowTrailingCommas"
:
true
,
"type"
:
"object"
,
"definitions"
:
{
"devContainerCommon"
:
{
"type"
:
"object"
,
...
...
@@ -104,6 +103,7 @@
},
"codespaces"
:
{
"type"
:
"object"
,
"additionalProperties"
:
true
,
"description"
:
"Codespaces-specific configuration."
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录