Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1d27e33c
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,发现更多精彩内容 >>
未验证
提交
1d27e33c
编写于
4月 09, 2018
作者:
J
Johannes Rieken
提交者:
GitHub
4月 09, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #47226 from Microsoft/joh/monaco-typecheck
add monaco-typecheck tasks
上级
534d10d3
29f184ca
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
82 addition
and
15 deletion
+82
-15
.travis.yml
.travis.yml
+0
-1
appveyor.yml
appveyor.yml
+0
-1
build/gulpfile.editor.js
build/gulpfile.editor.js
+59
-2
build/lib/reporter.js
build/lib/reporter.js
+7
-2
build/lib/reporter.ts
build/lib/reporter.ts
+13
-6
gulpfile.js
gulpfile.js
+3
-3
未找到文件。
.travis.yml
浏览文件 @
1d27e33c
...
@@ -51,7 +51,6 @@ install:
...
@@ -51,7 +51,6 @@ install:
script
:
script
:
-
node_modules/.bin/gulp electron --silent
-
node_modules/.bin/gulp electron --silent
-
node_modules/.bin/tsc -p ./src/tsconfig.monaco.json --noEmit
-
node_modules/.bin/gulp compile --silent --max_old_space_size=4096
-
node_modules/.bin/gulp compile --silent --max_old_space_size=4096
-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
-
./scripts/test-integration.sh
-
./scripts/test-integration.sh
...
...
appveyor.yml
浏览文件 @
1d27e33c
...
@@ -11,7 +11,6 @@ install:
...
@@ -11,7 +11,6 @@ install:
build_script
:
build_script
:
-
yarn
-
yarn
-
.\node_modules\.bin\gulp electron
-
.\node_modules\.bin\gulp electron
-
.\node_modules\.bin\tsc -p .\src\tsconfig.monaco.json --noEmit
-
npm run compile
-
npm run compile
test_script
:
test_script
:
...
...
build/gulpfile.editor.js
浏览文件 @
1d27e33c
...
@@ -93,7 +93,7 @@ gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
...
@@ -93,7 +93,7 @@ gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
gulp
.
task
(
'
minify-editor
'
,
[
'
clean-minified-editor
'
,
'
optimize-editor
'
],
common
.
minifyTask
(
'
out-editor
'
));
gulp
.
task
(
'
minify-editor
'
,
[
'
clean-minified-editor
'
,
'
optimize-editor
'
],
common
.
minifyTask
(
'
out-editor
'
));
gulp
.
task
(
'
clean-editor-esm
'
,
util
.
rimraf
(
'
out-editor-esm
'
));
gulp
.
task
(
'
clean-editor-esm
'
,
util
.
rimraf
(
'
out-editor-esm
'
));
gulp
.
task
(
'
extract-editor-esm
'
,
[
'
clean-editor-esm
'
,
'
clean-editor-distro
'
],
function
()
{
gulp
.
task
(
'
extract-editor-esm
'
,
[
'
clean-editor-esm
'
,
'
clean-editor-distro
'
],
function
()
{
standalone
.
createESMSourcesAndResources
({
standalone
.
createESMSourcesAndResources
({
entryPoints
:
[
entryPoints
:
[
'
vs/editor/editor.main
'
,
'
vs/editor/editor.main
'
,
...
@@ -107,7 +107,7 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro'], fun
...
@@ -107,7 +107,7 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro'], fun
}
}
});
});
});
});
gulp
.
task
(
'
compile-editor-esm
'
,
[
'
extract-editor-esm
'
,
'
clean-editor-distro
'
],
function
()
{
gulp
.
task
(
'
compile-editor-esm
'
,
[
'
extract-editor-esm
'
,
'
clean-editor-distro
'
],
function
()
{
const
result
=
cp
.
spawnSync
(
`node`
,
[
`../node_modules/.bin/tsc`
],
{
const
result
=
cp
.
spawnSync
(
`node`
,
[
`../node_modules/.bin/tsc`
],
{
cwd
:
path
.
join
(
__dirname
,
'
../out-editor-esm
'
)
cwd
:
path
.
join
(
__dirname
,
'
../out-editor-esm
'
)
});
});
...
@@ -235,3 +235,60 @@ function filterStream(testFunc) {
...
@@ -235,3 +235,60 @@ function filterStream(testFunc) {
this
.
emit
(
'
data
'
,
data
);
this
.
emit
(
'
data
'
,
data
);
});
});
}
}
//#region monaco type checking
function
createTscCompileTask
(
watch
)
{
return
()
=>
{
const
createReporter
=
require
(
'
./lib/reporter
'
).
createReporter
;
return
new
Promise
((
resolve
,
reject
)
=>
{
const
args
=
[
'
./node_modules/.bin/tsc
'
,
'
-p
'
,
'
./src/tsconfig.monaco.json
'
,
'
--noEmit
'
];
if
(
watch
)
{
args
.
push
(
'
-w
'
);
}
const
child
=
cp
.
spawn
(
`node`
,
args
,
{
cwd
:
path
.
join
(
__dirname
,
'
..
'
),
// stdio: [null, 'pipe', 'inherit']
});
let
errors
=
[];
let
reporter
=
createReporter
();
let
report
;
let
magic
=
/
[\u
001b
\u
009b
][
[()#;?
]
*
(?:[
0-9
]{1,4}(?:
;
[
0-9
]{0,4})
*
)?[
0-9A-ORZcf-nqry=><
]
/g
;
// https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
child
.
stdout
.
on
(
'
data
'
,
data
=>
{
let
str
=
String
(
data
);
str
=
str
.
replace
(
magic
,
''
).
trim
();
if
(
str
.
indexOf
(
'
Starting compilation
'
)
>=
0
||
str
.
indexOf
(
'
File change detected
'
)
>=
0
)
{
errors
.
length
=
0
;
report
=
reporter
.
end
(
false
);
}
else
if
(
str
.
indexOf
(
'
Compilation complete
'
)
>=
0
)
{
report
.
end
();
}
else
if
(
str
)
{
let
match
=
/
(
.*
\(\d
+,
\d
+
\)
:
)(
.*:
)(
.*
)
/
.
exec
(
str
);
if
(
match
)
{
// trying to massage the message so that it matches the gulp-tsb error messages
// e.g. src/vs/base/common/strings.ts(663,5): error TS2322: Type '1234' is not assignable to type 'string'.
let
fullpath
=
path
.
join
(
root
,
match
[
1
]);
let
message
=
match
[
3
];
// @ts-ignore
reporter
(
fullpath
+
message
);
}
else
{
// @ts-ignore
reporter
(
str
);
}
}
});
child
.
on
(
'
exit
'
,
resolve
);
child
.
on
(
'
error
'
,
reject
);
});
};
}
gulp
.
task
(
'
monaco-typecheck-watch
'
,
createTscCompileTask
(
true
));
gulp
.
task
(
'
monaco-typecheck
'
,
createTscCompileTask
(
false
));
//#endregion
build/lib/reporter.js
浏览文件 @
1d27e33c
...
@@ -34,7 +34,13 @@ catch (err) {
...
@@ -34,7 +34,13 @@ catch (err) {
}
}
function
log
()
{
function
log
()
{
var
errors
=
_
.
flatten
(
allErrors
);
var
errors
=
_
.
flatten
(
allErrors
);
errors
.
map
(
function
(
err
)
{
return
util
.
log
(
util
.
colors
.
red
(
'
Error
'
)
+
"
:
"
+
err
);
});
var
seen
=
new
Set
();
errors
.
map
(
function
(
err
)
{
if
(
!
seen
.
has
(
err
))
{
seen
.
add
(
err
);
util
.
log
(
util
.
colors
.
red
(
'
Error
'
)
+
"
:
"
+
err
);
}
});
var
regex
=
/^
([^
(
]
+
)\((\d
+
)
,
(\d
+
)\)
:
(
.*
)
$/
;
var
regex
=
/^
([^
(
]
+
)\((\d
+
)
,
(\d
+
)\)
:
(
.*
)
$/
;
var
messages
=
errors
var
messages
=
errors
.
map
(
function
(
err
)
{
return
regex
.
exec
(
err
);
})
.
map
(
function
(
err
)
{
return
regex
.
exec
(
err
);
})
...
@@ -80,4 +86,3 @@ function createReporter() {
...
@@ -80,4 +86,3 @@ function createReporter() {
return
ReportFunc
;
return
ReportFunc
;
}
}
exports
.
createReporter
=
createReporter
;
exports
.
createReporter
=
createReporter
;
;
build/lib/reporter.ts
浏览文件 @
1d27e33c
...
@@ -11,7 +11,7 @@ import * as util from 'gulp-util';
...
@@ -11,7 +11,7 @@ import * as util from 'gulp-util';
import
*
as
fs
from
'
fs
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
path
from
'
path
'
;
import
*
as
path
from
'
path
'
;
const
allErrors
:
Error
[][]
=
[];
const
allErrors
:
string
[][]
=
[];
let
startTime
:
number
=
null
;
let
startTime
:
number
=
null
;
let
count
=
0
;
let
count
=
0
;
...
@@ -42,7 +42,14 @@ try {
...
@@ -42,7 +42,14 @@ try {
function
log
():
void
{
function
log
():
void
{
const
errors
=
_
.
flatten
(
allErrors
);
const
errors
=
_
.
flatten
(
allErrors
);
errors
.
map
(
err
=>
util
.
log
(
`
${
util
.
colors
.
red
(
'
Error
'
)}
:
${
err
}
`
));
const
seen
=
new
Set
<
string
>
();
errors
.
map
(
err
=>
{
if
(
!
seen
.
has
(
err
))
{
seen
.
add
(
err
);
util
.
log
(
`
${
util
.
colors
.
red
(
'
Error
'
)}
:
${
err
}
`
);
}
});
const
regex
=
/^
([^
(
]
+
)\((\d
+
)
,
(\d
+
)\)
:
(
.*
)
$/
;
const
regex
=
/^
([^
(
]
+
)\((\d
+
)
,
(\d
+
)\)
:
(
.*
)
$/
;
const
messages
=
errors
const
messages
=
errors
...
@@ -61,17 +68,17 @@ function log(): void {
...
@@ -61,17 +68,17 @@ function log(): void {
}
}
export
interface
IReporter
{
export
interface
IReporter
{
(
err
:
Error
):
void
;
(
err
:
string
):
void
;
hasErrors
():
boolean
;
hasErrors
():
boolean
;
end
(
emitError
:
boolean
):
NodeJS
.
ReadWriteStream
;
end
(
emitError
:
boolean
):
NodeJS
.
ReadWriteStream
;
}
}
export
function
createReporter
():
IReporter
{
export
function
createReporter
():
IReporter
{
const
errors
:
Error
[]
=
[];
const
errors
:
string
[]
=
[];
allErrors
.
push
(
errors
);
allErrors
.
push
(
errors
);
class
ReportFunc
{
class
ReportFunc
{
constructor
(
err
:
Error
)
{
constructor
(
err
:
string
)
{
errors
.
push
(
err
);
errors
.
push
(
err
);
}
}
...
@@ -97,4 +104,4 @@ export function createReporter(): IReporter {
...
@@ -97,4 +104,4 @@ export function createReporter(): IReporter {
}
}
return
<
IReporter
><
any
>
ReportFunc
;
return
<
IReporter
><
any
>
ReportFunc
;
}
;
}
gulpfile.js
浏览文件 @
1d27e33c
...
@@ -28,8 +28,8 @@ gulp.task('default', ['compile']);
...
@@ -28,8 +28,8 @@ gulp.task('default', ['compile']);
// All
// All
gulp
.
task
(
'
clean
'
,
[
'
clean-client
'
,
'
clean-extensions
'
]);
gulp
.
task
(
'
clean
'
,
[
'
clean-client
'
,
'
clean-extensions
'
]);
gulp
.
task
(
'
compile
'
,
[
'
compile-client
'
,
'
compile-extensions
'
]);
gulp
.
task
(
'
compile
'
,
[
'
monaco-typecheck
'
,
'
compile-client
'
,
'
compile-extensions
'
]);
gulp
.
task
(
'
watch
'
,
[
'
watch-client
'
,
'
watch-extensions
'
]);
gulp
.
task
(
'
watch
'
,
[
'
monaco-typecheck-watch
'
,
'
watch-client
'
,
'
watch-extensions
'
]);
// All Build
// All Build
gulp
.
task
(
'
clean-build
'
,
[
'
clean-client-build
'
,
'
clean-extensions-build
'
]);
gulp
.
task
(
'
clean-build
'
,
[
'
clean-client-build
'
,
'
clean-extensions-build
'
]);
...
@@ -74,4 +74,4 @@ if (runningEditorTasks) {
...
@@ -74,4 +74,4 @@ if (runningEditorTasks) {
const
build
=
path
.
join
(
__dirname
,
'
build
'
);
const
build
=
path
.
join
(
__dirname
,
'
build
'
);
require
(
'
glob
'
).
sync
(
'
gulpfile.*.js
'
,
{
cwd
:
build
})
require
(
'
glob
'
).
sync
(
'
gulpfile.*.js
'
,
{
cwd
:
build
})
.
forEach
(
f
=>
require
(
`./build/
${
f
}
`
));
.
forEach
(
f
=>
require
(
`./build/
${
f
}
`
));
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录