Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d264b70f
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,发现更多精彩内容 >>
提交
d264b70f
编写于
5月 25, 2017
作者:
M
Martin Aeschlimann
提交者:
Dirk Baeumer
5月 26, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[docker] update grammar
上级
51a10b5e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
13 deletion
+26
-13
build/npm/update-grammar.js
build/npm/update-grammar.js
+20
-10
extensions/docker/package.json
extensions/docker/package.json
+1
-1
extensions/docker/syntaxes/docker.tmLanguage.json
extensions/docker/syntaxes/docker.tmLanguage.json
+5
-2
未找到文件。
build/npm/update-grammar.js
浏览文件 @
d264b70f
...
...
@@ -25,19 +25,28 @@ function getOptions(urlString) {
}
}
function
download
(
url
)
{
return
new
Promise
((
c
,
e
)
=>
{
var
content
=
''
;
var
request
=
https
.
get
(
getOptions
(
url
),
function
(
response
)
{
function
download
(
url
,
redirectCount
)
{
return
new
Promise
((
c
,
e
)
=>
{
var
content
=
''
;
https
.
get
(
getOptions
(
url
),
function
(
response
)
{
response
.
on
(
'
data
'
,
function
(
data
)
{
content
+=
data
.
toString
();
}).
on
(
'
end
'
,
function
()
{
let
count
=
redirectCount
||
0
;
if
(
count
<
5
&&
response
.
statusCode
>=
300
&&
response
.
statusCode
<=
303
||
response
.
statusCode
===
307
)
{
let
location
=
response
.
headers
[
'
location
'
];
if
(
location
)
{
console
.
log
(
"
Redirected
"
+
url
+
"
to
"
+
location
);
download
(
location
,
count
+
1
).
then
(
c
,
e
);
return
;
}
}
c
(
content
);
});
}).
on
(
'
error
'
,
function
(
err
)
{
e
(
err
.
message
);
});
});
});
}
function
getCommitSha
(
repoId
,
repoPath
)
{
...
...
@@ -46,14 +55,15 @@ function getCommitSha(repoId, repoPath) {
try
{
let
lastCommit
=
JSON
.
parse
(
content
)[
0
];
return
Promise
.
resolve
({
commitSha
:
lastCommit
.
sha
,
commitDate
:
lastCommit
.
commit
.
author
.
date
commitSha
:
lastCommit
.
sha
,
commitDate
:
lastCommit
.
commit
.
author
.
date
});
}
catch
(
e
)
{
console
.
error
(
"
Failed extracting the SHA:
"
+
content
);
return
Promise
.
resolve
(
null
);
}
},
function
()
{
console
.
err
(
'
Failed loading
'
+
commitInfo
);
console
.
err
or
(
'
Failed loading
'
+
commitInfo
);
return
Promise
.
resolve
(
null
);
});
}
...
...
@@ -97,7 +107,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
}
if
(
path
.
basename
(
process
.
argv
[
1
])
===
'
update-grammar.js
'
)
{
for
(
var
i
=
3
;
i
<
process
.
argv
.
length
;
i
+=
2
)
{
exports
.
update
(
process
.
argv
[
2
],
process
.
argv
[
i
],
process
.
argv
[
i
+
1
]);
for
(
var
i
=
3
;
i
<
process
.
argv
.
length
;
i
+=
2
)
{
exports
.
update
(
process
.
argv
[
2
],
process
.
argv
[
i
],
process
.
argv
[
i
+
1
]);
}
}
extensions/docker/package.json
浏览文件 @
d264b70f
...
...
@@ -4,7 +4,7 @@
"publisher"
:
"vscode"
,
"engines"
:
{
"vscode"
:
"*"
},
"scripts"
:
{
"update-grammar"
:
"node ../../build/npm/update-grammar.js
docker/docker
contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage ./syntaxes/docker.tmLanguage.json"
"update-grammar"
:
"node ../../build/npm/update-grammar.js
moby/moby
contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage ./syntaxes/docker.tmLanguage.json"
},
"contributes"
:
{
"languages"
:
[{
...
...
extensions/docker/syntaxes/docker.tmLanguage.json
浏览文件 @
d264b70f
...
...
@@ -8,9 +8,12 @@
"captures"
:
{
"1"
:
{
"name"
:
"keyword.other.special-method.dockerfile"
},
"2"
:
{
"name"
:
"keyword.other.special-method.dockerfile"
}
},
"match"
:
"
\\
s*(?:(FROM|AS))
\\
s
"
"match"
:
"
^
\\
s*
\\
b(FROM)
\\
b.*?
\\
b(AS)
\\
b
"
},
{
"captures"
:
{
...
...
@@ -94,5 +97,5 @@
],
"scopeName"
:
"source.dockerfile"
,
"uuid"
:
"a39d8795-59d2-49af-aa00-fe74ee29576e"
,
"version"
:
"https://github.com/moby/moby/commit/
4cb71f80823af345d063cf0ad657e73ce9caa75f
"
"version"
:
"https://github.com/moby/moby/commit/
8523e9d108a0e98865673701a7bd0a7929c5260b
"
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录