Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f737b017
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f737b017
编写于
4月 26, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update monaco.d.ts generation, recompile build-folder
上级
4e636bf5
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
1162 addition
and
1161 deletion
+1162
-1161
build/lib/bundle.js
build/lib/bundle.js
+1
-1
build/lib/compilation.js
build/lib/compilation.js
+1
-0
build/lib/extensions.js
build/lib/extensions.js
+1
-0
build/lib/git.js
build/lib/git.js
+2
-0
build/lib/i18n.js
build/lib/i18n.js
+1049
-1049
build/lib/optimize.js
build/lib/optimize.js
+1
-0
build/lib/reporter.js
build/lib/reporter.js
+3
-0
build/lib/test/i18n.test.js
build/lib/test/i18n.test.js
+40
-40
build/lib/tslint/allowAsyncRule.js
build/lib/tslint/allowAsyncRule.js
+11
-5
build/lib/tslint/duplicateImportsRule.js
build/lib/tslint/duplicateImportsRule.js
+11
-5
build/lib/tslint/importPatternsRule.js
build/lib/tslint/importPatternsRule.js
+11
-5
build/lib/tslint/layeringRule.js
build/lib/tslint/layeringRule.js
+11
-5
build/lib/tslint/noUnexternalizedStringsRule.js
build/lib/tslint/noUnexternalizedStringsRule.js
+11
-5
build/lib/util.js
build/lib/util.js
+1
-0
build/monaco/api.js
build/monaco/api.js
+5
-21
build/monaco/api.ts
build/monaco/api.ts
+3
-25
未找到文件。
build/lib/bundle.js
浏览文件 @
f737b017
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
exports
.
__esModule
=
true
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
})
;
var
fs
=
require
(
"
fs
"
);
var
path
=
require
(
"
path
"
);
var
vm
=
require
(
"
vm
"
);
...
...
build/lib/compilation.js
浏览文件 @
f737b017
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
gulp
=
require
(
"
gulp
"
);
var
tsb
=
require
(
"
gulp-tsb
"
);
var
es
=
require
(
"
event-stream
"
);
...
...
build/lib/extensions.js
浏览文件 @
f737b017
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
event_stream_1
=
require
(
"
event-stream
"
);
var
assign
=
require
(
"
object-assign
"
);
var
remote
=
require
(
"
gulp-remote-src
"
);
...
...
build/lib/git.js
浏览文件 @
f737b017
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
path
=
require
(
"
path
"
);
var
fs
=
require
(
"
fs
"
);
/**
...
...
@@ -31,6 +32,7 @@ function getVersion(repo) {
return
fs
.
readFileSync
(
refPath
,
'
utf8
'
).
trim
();
}
catch
(
e
)
{
// noop
}
var
packedRefsPath
=
path
.
join
(
git
,
'
packed-refs
'
);
var
refsRaw
;
...
...
build/lib/i18n.js
浏览文件 @
f737b017
此差异已折叠。
点击以展开。
build/lib/optimize.js
浏览文件 @
f737b017
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
path
=
require
(
"
path
"
);
var
gulp
=
require
(
"
gulp
"
);
var
sourcemaps
=
require
(
"
gulp-sourcemaps
"
);
...
...
build/lib/reporter.js
浏览文件 @
f737b017
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
es
=
require
(
"
event-stream
"
);
var
_
=
require
(
"
underscore
"
);
var
util
=
require
(
"
gulp-util
"
);
...
...
@@ -29,6 +30,7 @@ try {
fs
.
mkdirSync
(
path
.
dirname
(
buildLogPath
));
}
catch
(
err
)
{
// ignore
}
function
log
()
{
var
errors
=
_
.
flatten
(
allErrors
);
...
...
@@ -45,6 +47,7 @@ function log() {
fs
.
writeFileSync
(
buildLogPath
,
JSON
.
stringify
(
messages
));
}
catch
(
err
)
{
//noop
}
util
.
log
(
"
Finished
"
+
util
.
colors
.
green
(
'
compilation
'
)
+
"
with
"
+
errors
.
length
+
"
errors after
"
+
util
.
colors
.
magenta
((
new
Date
().
getTime
()
-
startTime
)
+
'
ms
'
));
}
...
...
build/lib/test/i18n.test.js
浏览文件 @
f737b017
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
assert
=
require
(
"
assert
"
);
var
i18n
=
require
(
"
../i18n
"
);
suite
(
'
XLF Parser Tests
'
,
function
()
{
var
sampleXlf
=
'
<?xml version="1.0" encoding="utf-8"?><xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"><file original="vs/base/common/keybinding" source-language="en" datatype="plaintext"><body><trans-unit id="key1"><source xml:lang="en">Key #1</source></trans-unit><trans-unit id="key2"><source xml:lang="en">Key #2 &</source></trans-unit></body></file></xliff>
'
;
var
sampleTranslatedXlf
=
'
<?xml version="1.0" encoding="utf-8"?><xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"><file original="vs/base/common/keybinding" source-language="en" target-language="ru" datatype="plaintext"><body><trans-unit id="key1"><source xml:lang="en">Key #1</source><target>Кнопка #1</target></trans-unit><trans-unit id="key2"><source xml:lang="en">Key #2 &</source><target>Кнопка #2 &</target></trans-unit></body></file></xliff>
'
;
var
originalFilePath
=
'
vs/base/common/keybinding
'
;
var
keys
=
[
'
key1
'
,
'
key2
'
];
var
messages
=
[
'
Key #1
'
,
'
Key #2 &
'
];
var
translatedMessages
=
{
key1
:
'
Кнопка #1
'
,
key2
:
'
Кнопка #2 &
'
};
test
(
'
Keys & messages to XLF conversion
'
,
function
()
{
var
xlf
=
new
i18n
.
XLF
(
'
vscode-workbench
'
);
xlf
.
addFile
(
originalFilePath
,
keys
,
messages
);
var
xlfString
=
xlf
.
toString
();
assert
.
strictEqual
(
xlfString
.
replace
(
/
\s{2,}
/g
,
''
),
sampleXlf
);
});
test
(
'
XLF to keys & messages conversion
'
,
function
()
{
i18n
.
XLF
.
parse
(
sampleTranslatedXlf
).
then
(
function
(
resolvedFiles
)
{
assert
.
deepEqual
(
resolvedFiles
[
0
].
messages
,
translatedMessages
);
assert
.
strictEqual
(
resolvedFiles
[
0
].
originalFilePath
,
originalFilePath
);
});
});
test
(
'
JSON file source path to Transifex resource match
'
,
function
()
{
var
editorProject
=
'
vscode-editor
'
,
workbenchProject
=
'
vscode-workbench
'
;
var
platform
=
{
name
:
'
vs/platform
'
,
project
:
editorProject
},
editorContrib
=
{
name
:
'
vs/editor/contrib
'
,
project
:
editorProject
},
editor
=
{
name
:
'
vs/editor
'
,
project
:
editorProject
},
base
=
{
name
:
'
vs/base
'
,
project
:
editorProject
},
code
=
{
name
:
'
vs/code
'
,
project
:
workbenchProject
},
workbenchParts
=
{
name
:
'
vs/workbench/parts/html
'
,
project
:
workbenchProject
},
workbenchServices
=
{
name
:
'
vs/workbench/services/files
'
,
project
:
workbenchProject
},
workbench
=
{
name
:
'
vs/workbench
'
,
project
:
workbenchProject
};
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/platform/actions/browser/menusExtensionPoint
'
),
platform
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/editor/contrib/clipboard/browser/clipboard
'
),
editorContrib
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/editor/common/modes/modesRegistry
'
),
editor
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/base/common/errorMessage
'
),
base
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/code/electron-main/window
'
),
code
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/workbench/parts/html/browser/webview
'
),
workbenchParts
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/workbench/services/files/node/fileService
'
),
workbenchServices
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/workbench/browser/parts/panel/panelActions
'
),
workbench
);
});
});
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
assert
=
require
(
"
assert
"
);
var
i18n
=
require
(
"
../i18n
"
);
suite
(
'
XLF Parser Tests
'
,
function
()
{
var
sampleXlf
=
'
<?xml version="1.0" encoding="utf-8"?><xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"><file original="vs/base/common/keybinding" source-language="en" datatype="plaintext"><body><trans-unit id="key1"><source xml:lang="en">Key #1</source></trans-unit><trans-unit id="key2"><source xml:lang="en">Key #2 &</source></trans-unit></body></file></xliff>
'
;
var
sampleTranslatedXlf
=
'
<?xml version="1.0" encoding="utf-8"?><xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"><file original="vs/base/common/keybinding" source-language="en" target-language="ru" datatype="plaintext"><body><trans-unit id="key1"><source xml:lang="en">Key #1</source><target>Кнопка #1</target></trans-unit><trans-unit id="key2"><source xml:lang="en">Key #2 &</source><target>Кнопка #2 &</target></trans-unit></body></file></xliff>
'
;
var
originalFilePath
=
'
vs/base/common/keybinding
'
;
var
keys
=
[
'
key1
'
,
'
key2
'
];
var
messages
=
[
'
Key #1
'
,
'
Key #2 &
'
];
var
translatedMessages
=
{
key1
:
'
Кнопка #1
'
,
key2
:
'
Кнопка #2 &
'
};
test
(
'
Keys & messages to XLF conversion
'
,
function
()
{
var
xlf
=
new
i18n
.
XLF
(
'
vscode-workbench
'
);
xlf
.
addFile
(
originalFilePath
,
keys
,
messages
);
var
xlfString
=
xlf
.
toString
();
assert
.
strictEqual
(
xlfString
.
replace
(
/
\s{2,}
/g
,
''
),
sampleXlf
);
});
test
(
'
XLF to keys & messages conversion
'
,
function
()
{
i18n
.
XLF
.
parse
(
sampleTranslatedXlf
).
then
(
function
(
resolvedFiles
)
{
assert
.
deepEqual
(
resolvedFiles
[
0
].
messages
,
translatedMessages
);
assert
.
strictEqual
(
resolvedFiles
[
0
].
originalFilePath
,
originalFilePath
);
});
});
test
(
'
JSON file source path to Transifex resource match
'
,
function
()
{
var
editorProject
=
'
vscode-editor
'
,
workbenchProject
=
'
vscode-workbench
'
;
var
platform
=
{
name
:
'
vs/platform
'
,
project
:
editorProject
},
editorContrib
=
{
name
:
'
vs/editor/contrib
'
,
project
:
editorProject
},
editor
=
{
name
:
'
vs/editor
'
,
project
:
editorProject
},
base
=
{
name
:
'
vs/base
'
,
project
:
editorProject
},
code
=
{
name
:
'
vs/code
'
,
project
:
workbenchProject
},
workbenchParts
=
{
name
:
'
vs/workbench/parts/html
'
,
project
:
workbenchProject
},
workbenchServices
=
{
name
:
'
vs/workbench/services/files
'
,
project
:
workbenchProject
},
workbench
=
{
name
:
'
vs/workbench
'
,
project
:
workbenchProject
};
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/platform/actions/browser/menusExtensionPoint
'
),
platform
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/editor/contrib/clipboard/browser/clipboard
'
),
editorContrib
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/editor/common/modes/modesRegistry
'
),
editor
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/base/common/errorMessage
'
),
base
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/code/electron-main/window
'
),
code
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/workbench/parts/html/browser/webview
'
),
workbenchParts
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/workbench/services/files/node/fileService
'
),
workbenchServices
);
assert
.
deepEqual
(
i18n
.
getResource
(
'
vs/workbench/browser/parts/panel/panelActions
'
),
workbench
);
});
});
build/lib/tslint/allowAsyncRule.js
浏览文件 @
f737b017
...
...
@@ -3,11 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
};
return
function
(
d
,
b
)
{
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
ts
=
require
(
"
typescript
"
);
var
Lint
=
require
(
"
tslint
"
);
var
Rule
=
(
function
(
_super
)
{
...
...
build/lib/tslint/duplicateImportsRule.js
浏览文件 @
f737b017
...
...
@@ -3,11 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
};
return
function
(
d
,
b
)
{
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
path_1
=
require
(
"
path
"
);
var
Lint
=
require
(
"
tslint
"
);
var
Rule
=
(
function
(
_super
)
{
...
...
build/lib/tslint/importPatternsRule.js
浏览文件 @
f737b017
...
...
@@ -3,11 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
};
return
function
(
d
,
b
)
{
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
Lint
=
require
(
"
tslint
"
);
var
minimatch
=
require
(
"
minimatch
"
);
var
Rule
=
(
function
(
_super
)
{
...
...
build/lib/tslint/layeringRule.js
浏览文件 @
f737b017
...
...
@@ -3,11 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
};
return
function
(
d
,
b
)
{
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
Lint
=
require
(
"
tslint
"
);
var
path_1
=
require
(
"
path
"
);
var
Rule
=
(
function
(
_super
)
{
...
...
build/lib/tslint/noUnexternalizedStringsRule.js
浏览文件 @
f737b017
...
...
@@ -3,11 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
b
.
hasOwnProperty
(
p
))
d
[
p
]
=
b
[
p
];
};
return
function
(
d
,
b
)
{
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
ts
=
require
(
"
typescript
"
);
var
Lint
=
require
(
"
tslint
"
);
/**
...
...
build/lib/util.js
浏览文件 @
f737b017
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
es
=
require
(
"
event-stream
"
);
var
debounce
=
require
(
"
debounce
"
);
var
_filter
=
require
(
"
gulp-filter
"
);
...
...
build/monaco/api.js
浏览文件 @
f737b017
...
...
@@ -3,9 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
fs
=
require
(
"
fs
"
);
var
ts
=
require
(
"
typescript
"
);
var
path
=
require
(
"
path
"
);
var
tsfmt
=
require
(
'
../../tsfmt.json
'
);
var
util
=
require
(
'
gulp-util
'
);
function
log
(
message
)
{
var
rest
=
[];
...
...
@@ -147,9 +149,11 @@ function getMassagedTopLevelDeclarationText(sourceFile, declaration) {
if
(
memberText
.
indexOf
(
'
@internal
'
)
>=
0
||
memberText
.
indexOf
(
'
private
'
)
>=
0
)
{
// console.log('BEFORE: ', result);
result
=
result
.
replace
(
memberText
,
''
);
// console.log('AFTER: ', result);
}
}
catch
(
err
)
{
// life..
}
});
}
...
...
@@ -158,11 +162,10 @@ function getMassagedTopLevelDeclarationText(sourceFile, declaration) {
return
result
;
}
function
format
(
text
)
{
var
options
=
getDefaultOptions
();
// Parse the source text
var
sourceFile
=
ts
.
createSourceFile
(
'
file.ts
'
,
text
,
ts
.
ScriptTarget
.
Latest
,
/*setParentPointers*/
true
);
// Get the formatting edits on the input sources
var
edits
=
ts
.
formatting
.
formatDocument
(
sourceFile
,
getRuleProvider
(
options
),
options
);
var
edits
=
ts
.
formatting
.
formatDocument
(
sourceFile
,
getRuleProvider
(
tsfmt
),
tsfmt
);
// Apply the edits on the input code
return
applyEdits
(
text
,
edits
);
function
getRuleProvider
(
options
)
{
...
...
@@ -183,25 +186,6 @@ function format(text) {
}
return
result
;
}
function
getDefaultOptions
()
{
return
{
indentSize
:
4
,
tabSize
:
4
,
newLineCharacter
:
'
\r\n
'
,
convertTabsToSpaces
:
true
,
indentStyle
:
ts
.
IndentStyle
.
Block
,
insertSpaceAfterCommaDelimiter
:
true
,
insertSpaceAfterSemicolonInForStatements
:
true
,
insertSpaceBeforeAndAfterBinaryOperators
:
true
,
insertSpaceAfterKeywordsInControlFlowStatements
:
true
,
insertSpaceAfterFunctionKeywordForAnonymousFunctions
:
false
,
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis
:
false
,
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets
:
false
,
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces
:
true
,
placeOpenBraceOnNewLineForFunctions
:
false
,
placeOpenBraceOnNewLineForControlBlocks
:
false
,
};
}
}
function
createReplacer
(
data
)
{
data
=
data
||
''
;
...
...
build/monaco/api.ts
浏览文件 @
f737b017
...
...
@@ -6,6 +6,7 @@
import
fs
=
require
(
'
fs
'
);
import
ts
=
require
(
'
typescript
'
);
import
path
=
require
(
'
path
'
);
const
tsfmt
=
require
(
'
../../tsfmt.json
'
);
var
util
=
require
(
'
gulp-util
'
);
function
log
(
message
:
any
,
...
rest
:
any
[]):
void
{
...
...
@@ -182,13 +183,12 @@ function getMassagedTopLevelDeclarationText(sourceFile:ts.SourceFile, declaratio
}
function
format
(
text
:
string
):
string
{
let
options
=
getDefaultOptions
();
// Parse the source text
let
sourceFile
=
ts
.
createSourceFile
(
'
file.ts
'
,
text
,
ts
.
ScriptTarget
.
Latest
,
/*setParentPointers*/
true
);
// Get the formatting edits on the input sources
let
edits
=
(
<
any
>
ts
).
formatting
.
formatDocument
(
sourceFile
,
getRuleProvider
(
options
),
options
);
let
edits
=
(
<
any
>
ts
).
formatting
.
formatDocument
(
sourceFile
,
getRuleProvider
(
tsfmt
),
tsfmt
);
// Apply the edits on the input code
return
applyEdits
(
text
,
edits
);
...
...
@@ -212,28 +212,6 @@ function format(text:string): string {
}
return
result
;
}
function
getDefaultOptions
():
ts
.
FormatCodeSettings
{
return
{
indentSize
:
4
,
tabSize
:
4
,
newLineCharacter
:
'
\r\n
'
,
convertTabsToSpaces
:
true
,
indentStyle
:
ts
.
IndentStyle
.
Block
,
insertSpaceAfterCommaDelimiter
:
true
,
insertSpaceAfterSemicolonInForStatements
:
true
,
insertSpaceBeforeAndAfterBinaryOperators
:
true
,
insertSpaceAfterKeywordsInControlFlowStatements
:
true
,
insertSpaceAfterFunctionKeywordForAnonymousFunctions
:
false
,
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis
:
false
,
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets
:
false
,
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
:
true
,
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces
:
true
,
placeOpenBraceOnNewLineForFunctions
:
false
,
placeOpenBraceOnNewLineForControlBlocks
:
false
,
};
}
}
function
createReplacer
(
data
:
string
):
(
str
:
string
)
=>
string
{
...
...
@@ -401,4 +379,4 @@ export function run(out: string, inputFiles: { [file: string]: string; }): IMona
export
function
complainErrors
()
{
logErr
(
'
Not running monaco.d.ts generation due to compile errors
'
);
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录