Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c94bc234
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,发现更多精彩内容 >>
提交
c94bc234
编写于
10月 09, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cached data for extensions, second try
上级
f4ed8a58
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
47 deletion
+51
-47
src/vs/loader.js
src/vs/loader.js
+50
-45
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
...nch/services/extensions/electron-browser/extensionHost.ts
+1
-2
未找到文件。
src/vs/loader.js
浏览文件 @
c94bc234
...
...
@@ -19,10 +19,11 @@
*---------------------------------------------------------------------------------------------
*--------------------------------------------------------------------------------------------*/
var
_amdLoaderGlobal
=
this
;
var
_commonjsGlobal
=
typeof
global
===
'
object
'
?
global
:
{};
var
AMDLoader
;
(
function
(
AMDLoader
)
{
AMDLoader
.
global
=
_amdLoaderGlobal
;
var
Environment
=
/** @class */
(
function
()
{
var
Environment
=
(
function
()
{
function
Environment
()
{
this
.
_detected
=
false
;
this
.
_isWindows
=
false
;
...
...
@@ -93,7 +94,7 @@ var AMDLoader;
*--------------------------------------------------------------------------------------------*/
var
AMDLoader
;
(
function
(
AMDLoader
)
{
var
LoaderEvent
=
/** @class */
(
function
()
{
var
LoaderEvent
=
(
function
()
{
function
LoaderEvent
(
type
,
detail
,
timestamp
)
{
this
.
type
=
type
;
this
.
detail
=
detail
;
...
...
@@ -102,7 +103,7 @@ var AMDLoader;
return
LoaderEvent
;
}());
AMDLoader
.
LoaderEvent
=
LoaderEvent
;
var
LoaderEventRecorder
=
/** @class */
(
function
()
{
var
LoaderEventRecorder
=
(
function
()
{
function
LoaderEventRecorder
(
loaderAvailableTimestamp
)
{
this
.
_events
=
[
new
LoaderEvent
(
1
/* LoaderAvailable */
,
''
,
loaderAvailableTimestamp
)];
}
...
...
@@ -115,7 +116,7 @@ var AMDLoader;
return
LoaderEventRecorder
;
}());
AMDLoader
.
LoaderEventRecorder
=
LoaderEventRecorder
;
var
NullLoaderEventRecorder
=
/** @class */
(
function
()
{
var
NullLoaderEventRecorder
=
(
function
()
{
function
NullLoaderEventRecorder
()
{
}
NullLoaderEventRecorder
.
prototype
.
record
=
function
(
type
,
detail
)
{
...
...
@@ -124,9 +125,9 @@ var AMDLoader;
NullLoaderEventRecorder
.
prototype
.
getEvents
=
function
()
{
return
[];
};
NullLoaderEventRecorder
.
INSTANCE
=
new
NullLoaderEventRecorder
();
return
NullLoaderEventRecorder
;
}());
NullLoaderEventRecorder
.
INSTANCE
=
new
NullLoaderEventRecorder
();
AMDLoader
.
NullLoaderEventRecorder
=
NullLoaderEventRecorder
;
})(
AMDLoader
||
(
AMDLoader
=
{}));
/*---------------------------------------------------------------------------------------------
...
...
@@ -135,7 +136,7 @@ var AMDLoader;
*--------------------------------------------------------------------------------------------*/
var
AMDLoader
;
(
function
(
AMDLoader
)
{
var
Utilities
=
/** @class */
(
function
()
{
var
Utilities
=
(
function
()
{
function
Utilities
()
{
}
/**
...
...
@@ -221,11 +222,11 @@ var AMDLoader;
}
return
(
this
.
HAS_PERFORMANCE_NOW
?
AMDLoader
.
global
.
performance
.
now
()
:
Date
.
now
());
};
Utilities
.
NEXT_ANONYMOUS_ID
=
1
;
Utilities
.
PERFORMANCE_NOW_PROBED
=
false
;
Utilities
.
HAS_PERFORMANCE_NOW
=
false
;
return
Utilities
;
}());
Utilities
.
NEXT_ANONYMOUS_ID
=
1
;
Utilities
.
PERFORMANCE_NOW_PROBED
=
false
;
Utilities
.
HAS_PERFORMANCE_NOW
=
false
;
AMDLoader
.
Utilities
=
Utilities
;
})(
AMDLoader
||
(
AMDLoader
=
{}));
/*---------------------------------------------------------------------------------------------
...
...
@@ -234,7 +235,7 @@ var AMDLoader;
*--------------------------------------------------------------------------------------------*/
var
AMDLoader
;
(
function
(
AMDLoader
)
{
var
ConfigurationOptionsUtil
=
/** @class */
(
function
()
{
var
ConfigurationOptionsUtil
=
(
function
()
{
function
ConfigurationOptionsUtil
()
{
}
/**
...
...
@@ -343,7 +344,7 @@ var AMDLoader;
return
ConfigurationOptionsUtil
;
}());
AMDLoader
.
ConfigurationOptionsUtil
=
ConfigurationOptionsUtil
;
var
Configuration
=
/** @class */
(
function
()
{
var
Configuration
=
(
function
()
{
function
Configuration
(
env
,
options
)
{
this
.
_env
=
env
;
this
.
options
=
ConfigurationOptionsUtil
.
mergeConfigurationOptions
(
options
);
...
...
@@ -554,7 +555,7 @@ var AMDLoader;
/**
* Load `scriptSrc` only once (avoid multiple <script> tags)
*/
var
OnlyOnceScriptLoader
=
/** @class */
(
function
()
{
var
OnlyOnceScriptLoader
=
(
function
()
{
function
OnlyOnceScriptLoader
(
env
)
{
this
.
_env
=
env
;
this
.
_scriptLoader
=
null
;
...
...
@@ -596,7 +597,7 @@ var AMDLoader;
};
return
OnlyOnceScriptLoader
;
}());
var
BrowserScriptLoader
=
/** @class */
(
function
()
{
var
BrowserScriptLoader
=
(
function
()
{
function
BrowserScriptLoader
()
{
}
/**
...
...
@@ -634,7 +635,7 @@ var AMDLoader;
};
return
BrowserScriptLoader
;
}());
var
WorkerScriptLoader
=
/** @class */
(
function
()
{
var
WorkerScriptLoader
=
(
function
()
{
function
WorkerScriptLoader
()
{
}
WorkerScriptLoader
.
prototype
.
load
=
function
(
moduleManager
,
scriptSrc
,
callback
,
errorback
)
{
...
...
@@ -648,7 +649,7 @@ var AMDLoader;
};
return
WorkerScriptLoader
;
}());
var
NodeScriptLoader
=
/** @class */
(
function
()
{
var
NodeScriptLoader
=
(
function
()
{
function
NodeScriptLoader
(
env
)
{
this
.
_env
=
env
;
this
.
_didInitialize
=
false
;
...
...
@@ -719,7 +720,7 @@ var AMDLoader;
var
compileWrapper
=
script
.
runInThisContext
(
options
);
var
dirname
=
that
.
_path
.
dirname
(
filename
);
var
require
=
makeRequireFunction
(
this
);
var
args
=
[
this
.
exports
,
require
,
this
,
filename
,
dirname
,
process
,
AMDLoader
.
g
lobal
,
Buffer
];
var
args
=
[
this
.
exports
,
require
,
this
,
filename
,
dirname
,
process
,
_commonjsG
lobal
,
Buffer
];
var
result
=
compileWrapper
.
apply
(
this
.
exports
,
args
);
that
.
_processCachedData
(
moduleManager
,
script
,
cachedDataPath
);
return
result
;
...
...
@@ -830,15 +831,17 @@ var AMDLoader;
errorCode
:
'
cachedDataRejected
'
,
path
:
cachedDataPath
});
NodeScriptLoader
.
_runSoon
(
function
()
{
return
_this
.
_fs
.
unlink
(
cachedDataPath
,
function
(
err
)
{
if
(
err
)
{
moduleManager
.
getConfig
().
getOptionsLiteral
().
onNodeCachedData
({
errorCode
:
'
unlink
'
,
path
:
cachedDataPath
,
detail
:
err
});
}
});
},
moduleManager
.
getConfig
().
getOptionsLiteral
().
nodeCachedDataWriteDelay
);
NodeScriptLoader
.
_runSoon
(
function
()
{
return
_this
.
_fs
.
unlink
(
cachedDataPath
,
function
(
err
)
{
if
(
err
)
{
moduleManager
.
getConfig
().
getOptionsLiteral
().
onNodeCachedData
({
errorCode
:
'
unlink
'
,
path
:
cachedDataPath
,
detail
:
err
});
}
});
},
moduleManager
.
getConfig
().
getOptionsLiteral
().
nodeCachedDataWriteDelay
);
}
else
if
(
script
.
cachedDataProduced
)
{
// data produced => tell outside world
...
...
@@ -847,24 +850,26 @@ var AMDLoader;
length
:
script
.
cachedData
.
length
});
// data produced => write cache file
NodeScriptLoader
.
_runSoon
(
function
()
{
return
_this
.
_fs
.
writeFile
(
cachedDataPath
,
script
.
cachedData
,
function
(
err
)
{
if
(
err
)
{
moduleManager
.
getConfig
().
getOptionsLiteral
().
onNodeCachedData
({
errorCode
:
'
writeFile
'
,
path
:
cachedDataPath
,
detail
:
err
});
}
});
},
moduleManager
.
getConfig
().
getOptionsLiteral
().
nodeCachedDataWriteDelay
);
NodeScriptLoader
.
_runSoon
(
function
()
{
return
_this
.
_fs
.
writeFile
(
cachedDataPath
,
script
.
cachedData
,
function
(
err
)
{
if
(
err
)
{
moduleManager
.
getConfig
().
getOptionsLiteral
().
onNodeCachedData
({
errorCode
:
'
writeFile
'
,
path
:
cachedDataPath
,
detail
:
err
});
}
});
},
moduleManager
.
getConfig
().
getOptionsLiteral
().
nodeCachedDataWriteDelay
);
}
};
NodeScriptLoader
.
_runSoon
=
function
(
callback
,
minTimeout
)
{
var
timeout
=
minTimeout
+
Math
.
ceil
(
Math
.
random
()
*
minTimeout
);
setTimeout
(
callback
,
timeout
);
};
NodeScriptLoader
.
_BOM
=
0xFEFF
;
return
NodeScriptLoader
;
}());
NodeScriptLoader
.
_BOM
=
0xFEFF
;
function
createScriptLoader
(
env
)
{
return
new
OnlyOnceScriptLoader
(
env
);
}
...
...
@@ -878,7 +883,7 @@ var AMDLoader;
(
function
(
AMDLoader
)
{
// ------------------------------------------------------------------------
// ModuleIdResolver
var
ModuleIdResolver
=
/** @class */
(
function
()
{
var
ModuleIdResolver
=
(
function
()
{
function
ModuleIdResolver
(
fromModuleId
)
{
var
lastSlash
=
fromModuleId
.
lastIndexOf
(
'
/
'
);
if
(
lastSlash
!==
-
1
)
{
...
...
@@ -921,13 +926,13 @@ var AMDLoader;
}
return
result
;
};
ModuleIdResolver
.
ROOT
=
new
ModuleIdResolver
(
''
);
return
ModuleIdResolver
;
}());
ModuleIdResolver
.
ROOT
=
new
ModuleIdResolver
(
''
);
AMDLoader
.
ModuleIdResolver
=
ModuleIdResolver
;
// ------------------------------------------------------------------------
// Module
var
Module
=
/** @class */
(
function
()
{
var
Module
=
(
function
()
{
function
Module
(
id
,
strId
,
dependencies
,
callback
,
errorback
,
moduleIdResolver
)
{
this
.
id
=
id
;
this
.
strId
=
strId
;
...
...
@@ -1017,7 +1022,7 @@ var AMDLoader;
return
Module
;
}());
AMDLoader
.
Module
=
Module
;
var
ModuleIdProvider
=
/** @class */
(
function
()
{
var
ModuleIdProvider
=
(
function
()
{
function
ModuleIdProvider
()
{
this
.
_nextId
=
0
;
this
.
_strModuleIdToIntModuleId
=
new
Map
();
...
...
@@ -1044,17 +1049,17 @@ var AMDLoader;
};
return
ModuleIdProvider
;
}());
var
RegularDependency
=
/** @class */
(
function
()
{
var
RegularDependency
=
(
function
()
{
function
RegularDependency
(
id
)
{
this
.
id
=
id
;
}
RegularDependency
.
EXPORTS
=
new
RegularDependency
(
0
/* EXPORTS */
);
RegularDependency
.
MODULE
=
new
RegularDependency
(
1
/* MODULE */
);
RegularDependency
.
REQUIRE
=
new
RegularDependency
(
2
/* REQUIRE */
);
return
RegularDependency
;
}());
RegularDependency
.
EXPORTS
=
new
RegularDependency
(
0
/* EXPORTS */
);
RegularDependency
.
MODULE
=
new
RegularDependency
(
1
/* MODULE */
);
RegularDependency
.
REQUIRE
=
new
RegularDependency
(
2
/* REQUIRE */
);
AMDLoader
.
RegularDependency
=
RegularDependency
;
var
PluginDependency
=
/** @class */
(
function
()
{
var
PluginDependency
=
(
function
()
{
function
PluginDependency
(
id
,
pluginId
,
pluginParam
)
{
this
.
id
=
id
;
this
.
pluginId
=
pluginId
;
...
...
@@ -1063,7 +1068,7 @@ var AMDLoader;
return
PluginDependency
;
}());
AMDLoader
.
PluginDependency
=
PluginDependency
;
var
ModuleManager
=
/** @class */
(
function
()
{
var
ModuleManager
=
(
function
()
{
function
ModuleManager
(
env
,
scriptLoader
,
defineFunc
,
requireFunc
,
loaderAvailableTimestamp
)
{
if
(
loaderAvailableTimestamp
===
void
0
)
{
loaderAvailableTimestamp
=
0
;
}
this
.
_env
=
env
;
...
...
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
浏览文件 @
c94bc234
...
...
@@ -177,8 +177,7 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
VSCODE_IPC_HOOK_EXTHOST
:
pipeName
,
VSCODE_HANDLES_UNCAUGHT_ERRORS
:
true
,
VSCODE_LOG_STACK
:
!
this
.
_isExtensionDevTestFromCli
&&
(
this
.
_isExtensionDevHost
||
!
this
.
_environmentService
.
isBuilt
||
product
.
quality
!==
'
stable
'
||
this
.
_environmentService
.
verbose
),
VSCODE_LOG_LEVEL
:
this
.
_environmentService
.
verbose
?
'
trace
'
:
this
.
_environmentService
.
log
,
VSCODE_NODE_CACHED_DATA_DIR
:
''
VSCODE_LOG_LEVEL
:
this
.
_environmentService
.
verbose
?
'
trace
'
:
this
.
_environmentService
.
log
}),
// We only detach the extension host on windows. Linux and Mac orphan by default
// and detach under Linux and Mac create another process group.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录