Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d0eaa02c
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,发现更多精彩内容 >>
提交
d0eaa02c
编写于
3月 08, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Better support for ESM workers
上级
66091601
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
26 addition
and
32 deletion
+26
-32
build/gulpfile.editor.js
build/gulpfile.editor.js
+1
-1
build/lib/standalone.js
build/lib/standalone.js
+0
-9
build/lib/standalone.ts
build/lib/standalone.ts
+0
-9
build/monaco/LICENSE
build/monaco/LICENSE
+1
-1
build/monaco/package.json
build/monaco/package.json
+2
-1
src/vs/editor/common/services/editorSimpleWorker.ts
src/vs/editor/common/services/editorSimpleWorker.ts
+22
-11
未找到文件。
build/gulpfile.editor.js
浏览文件 @
d0eaa02c
...
...
@@ -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
(
'
clean-editor-esm
'
,
util
.
rimraf
(
'
out-editor-esm
'
));
gulp
.
task
(
'
extract-editor-esm
'
,
[
'
clean-editor-esm
'
],
function
()
{
gulp
.
task
(
'
extract-editor-esm
'
,
[
'
clean-editor-esm
'
,
'
clean-editor-distro
'
],
function
()
{
standalone
.
createESMSourcesAndResources
({
entryPoints
:
[
'
vs/editor/editor.main
'
,
...
...
build/lib/standalone.js
浏览文件 @
d0eaa02c
...
...
@@ -112,15 +112,6 @@ function createESMSourcesAndResources(options) {
}
var
fileContents
=
fs
.
readFileSync
(
filename
).
toString
();
var
info
=
ts
.
preProcessFile
(
fileContents
);
if
(
info
.
isLibFile
)
{
console
.
log
(
"
1. oh no, what does this mean!!!
"
);
}
if
(
info
.
typeReferenceDirectives
.
length
>
0
)
{
console
.
log
(
"
2. oh no, what does this mean!!!
"
);
}
if
(
info
.
referencedFiles
.
length
>
0
)
{
console
.
log
(
"
3. oh no, what does this mean!!!
"
);
}
for
(
var
i
=
info
.
importedFiles
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
importedFilename
=
info
.
importedFiles
[
i
].
fileName
;
var
pos
=
info
.
importedFiles
[
i
].
pos
;
...
...
build/lib/standalone.ts
浏览文件 @
d0eaa02c
...
...
@@ -130,15 +130,6 @@ export function createESMSourcesAndResources(options: IOptions): void {
let
fileContents
=
fs
.
readFileSync
(
filename
).
toString
();
const
info
=
ts
.
preProcessFile
(
fileContents
);
if
(
info
.
isLibFile
)
{
console
.
log
(
`1. oh no, what does this mean!!!`
);
}
if
(
info
.
typeReferenceDirectives
.
length
>
0
)
{
console
.
log
(
`2. oh no, what does this mean!!!`
);
}
if
(
info
.
referencedFiles
.
length
>
0
)
{
console
.
log
(
`3. oh no, what does this mean!!!`
);
}
for
(
let
i
=
info
.
importedFiles
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
importedFilename
=
info
.
importedFiles
[
i
].
fileName
;
...
...
build/monaco/LICENSE
浏览文件 @
d0eaa02c
The MIT License (MIT)
Copyright (c) 2016 Microsoft Corporation
Copyright (c) 2016
- present
Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
build/monaco/package.json
浏览文件 @
d0eaa02c
{
"name"
:
"monaco-editor-core"
,
"private"
:
true
,
"version"
:
"0.
9
.0"
,
"version"
:
"0.
11
.0"
,
"description"
:
"A browser based code editor"
,
"author"
:
"Microsoft Corporation"
,
"license"
:
"MIT"
,
"module"
:
"./esm/vs/editor/editor.main.js"
,
"repository"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/Microsoft/vscode"
...
...
src/vs/editor/common/services/editorSimpleWorker.ts
浏览文件 @
d0eaa02c
...
...
@@ -288,14 +288,23 @@ class MirrorModel extends BaseMirrorModel implements ICommonModel {
}
}
/**
* @internal
*/
export
interface
IForeignModuleFactory
{
(
ctx
:
IWorkerContext
,
createData
:
any
):
any
;
}
/**
* @internal
*/
export
abstract
class
BaseEditorSimpleWorker
{
private
_foreignModuleFactory
:
IForeignModuleFactory
;
private
_foreignModule
:
any
;
constructor
(
foreignModule
:
any
)
{
this
.
_foreignModule
=
foreignModule
;
constructor
(
foreignModuleFactory
:
IForeignModuleFactory
)
{
this
.
_foreignModuleFactory
=
foreignModuleFactory
;
this
.
_foreignModule
=
null
;
}
protected
abstract
_getModel
(
uri
:
string
):
ICommonModel
;
...
...
@@ -474,7 +483,14 @@ export abstract class BaseEditorSimpleWorker {
// ---- BEGIN foreign module support --------------------------------------------------------------------------
public
loadForeignModule
(
moduleId
:
string
,
createData
:
any
):
TPromise
<
string
[]
>
{
if
(
this
.
_foreignModule
)
{
let
ctx
:
IWorkerContext
=
{
getMirrorModels
:
():
IMirrorModel
[]
=>
{
return
this
.
_getModels
();
}
};
if
(
this
.
_foreignModuleFactory
)
{
this
.
_foreignModule
=
this
.
_foreignModuleFactory
(
ctx
,
createData
);
// static foreing module
let
methods
:
string
[]
=
[];
for
(
let
prop
in
this
.
_foreignModule
)
{
...
...
@@ -486,12 +502,7 @@ export abstract class BaseEditorSimpleWorker {
}
return
new
TPromise
<
any
>
((
c
,
e
)
=>
{
// Use the global require to be sure to get the global config
(
<
any
>
self
).
require
([
moduleId
],
(
foreignModule
:
{
create
:
(
ctx
:
IWorkerContext
,
createData
:
any
)
=>
any
;
})
=>
{
let
ctx
:
IWorkerContext
=
{
getMirrorModels
:
():
IMirrorModel
[]
=>
{
return
this
.
_getModels
();
}
};
(
<
any
>
self
).
require
([
moduleId
],
(
foreignModule
:
{
create
:
IForeignModuleFactory
})
=>
{
this
.
_foreignModule
=
foreignModule
.
create
(
ctx
,
createData
);
let
methods
:
string
[]
=
[];
...
...
@@ -531,8 +542,8 @@ export class EditorSimpleWorkerImpl extends BaseEditorSimpleWorker implements IR
private
_models
:
{
[
uri
:
string
]:
MirrorModel
;
};
constructor
(
foreignModule
:
an
y
)
{
super
(
foreignModule
);
constructor
(
foreignModule
Factory
:
IForeignModuleFactor
y
)
{
super
(
foreignModule
Factory
);
this
.
_models
=
Object
.
create
(
null
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录