Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a36823fc
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,发现更多精彩内容 >>
提交
a36823fc
编写于
10月 03, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - don't delay extension host starting that much anymore, move (and fix) timer marks
上级
9588b6fe
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
30 deletion
+13
-30
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+1
-7
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+12
-23
未找到文件。
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
a36823fc
...
...
@@ -123,7 +123,6 @@ export class WorkbenchShell extends Disposable {
private
configurationService
:
IConfigurationService
;
private
contextService
:
IWorkspaceContextService
;
private
telemetryService
:
ITelemetryService
;
private
extensionService
:
ExtensionService
;
private
broadcastService
:
IBroadcastService
;
private
themeService
:
WorkbenchThemeService
;
private
lifecycleService
:
LifecycleService
;
...
...
@@ -398,12 +397,7 @@ export class WorkbenchShell extends Disposable {
const
extensionEnablementService
=
this
.
_register
(
instantiationService
.
createInstance
(
ExtensionEnablementService
));
serviceCollection
.
set
(
IExtensionEnablementService
,
extensionEnablementService
);
this
.
extensionService
=
instantiationService
.
createInstance
(
ExtensionService
);
serviceCollection
.
set
(
IExtensionService
,
this
.
extensionService
);
perf
.
mark
(
'
willLoadExtensions
'
);
this
.
extensionService
.
whenInstalledExtensionsRegistered
().
then
(()
=>
perf
.
mark
(
'
didLoadExtensions
'
));
serviceCollection
.
set
(
IExtensionService
,
instantiationService
.
createInstance
(
ExtensionService
));
this
.
themeService
=
instantiationService
.
createInstance
(
WorkbenchThemeService
,
document
.
body
);
serviceCollection
.
set
(
IWorkbenchThemeService
,
this
.
themeService
);
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
a36823fc
...
...
@@ -31,9 +31,9 @@ import { IMessagePassingProtocol } from 'vs/base/parts/ipc/node/ipc';
import
{
ExtHostCustomersRegistry
}
from
'
vs/workbench/api/electron-browser/extHostCustomers
'
;
import
{
IWindowService
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IDisposable
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
mark
}
from
'
vs/base/common/performance
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
{
ILifecycleService
,
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
Barrier
}
from
'
vs/base/common/async
'
;
import
{
Barrier
,
runWhenIdle
}
from
'
vs/base/common/async
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
ExtensionHostProfiler
}
from
'
vs/workbench/services/extensions/electron-browser/extensionHostProfiler
'
;
import
product
from
'
vs/platform/node/product
'
;
...
...
@@ -311,7 +311,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
this
.
_extensionHostProcessActivationTimes
=
Object
.
create
(
null
);
this
.
_extensionHostExtensionRuntimeErrors
=
Object
.
create
(
null
);
this
.
startDelayed
(
lifecycleService
);
this
.
_
startDelayed
(
lifecycleService
);
if
(
this
.
_extensionEnablementService
.
allUserExtensionsDisabled
)
{
this
.
_notificationService
.
prompt
(
Severity
.
Info
,
nls
.
localize
(
'
extensionsDisabled
'
,
"
All installed extensions are temporarily disabled. Reload the window to return to the previous state.
"
),
[{
...
...
@@ -323,17 +323,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
}
}
private
startDelayed
(
lifecycleService
:
ILifecycleService
):
void
{
let
started
=
false
;
const
startOnce
=
()
=>
{
if
(
!
started
)
{
started
=
true
;
this
.
_startExtensionHostProcess
([]);
this
.
_scanAndHandleExtensions
();
}
};
private
_startDelayed
(
lifecycleService
:
ILifecycleService
):
void
{
// delay extension host creation and extension scanning
// until the workbench is restoring. we cannot defer the
// extension host more (LifecyclePhase.Running) because
...
...
@@ -341,15 +331,14 @@ export class ExtensionService extends Disposable implements IExtensionService {
// and this would result in a deadlock
// see https://github.com/Microsoft/vscode/issues/41322
lifecycleService
.
when
(
LifecyclePhase
.
Restoring
).
then
(()
=>
{
// we add an additional delay of 800ms because the extension host
// starting is a potential expensive operation and we do no want
// to fight with editors, viewlets and panels restoring.
setTimeout
(()
=>
startOnce
(),
800
);
// reschedule to ensure this runs after restoring viewlets, panels, and editors
runWhenIdle
(()
=>
{
perf
.
mark
(
'
willLoadExtensions
'
);
this
.
_scanAndHandleExtensions
();
this
.
_startExtensionHostProcess
([]);
this
.
whenInstalledExtensionsRegistered
().
then
(()
=>
perf
.
mark
(
'
didLoadExtensions
'
));
},
50
/*max delay*/
);
});
// if we are running before the 800ms delay, make sure to start
// the extension host right away though.
lifecycleService
.
when
(
LifecyclePhase
.
Running
).
then
(()
=>
startOnce
());
}
public
dispose
():
void
{
...
...
@@ -601,7 +590,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
ExtensionService
.
_handleExtensionPoint
(
extensionPoints
[
i
],
availableExtensions
,
messageHandler
);
}
mark
(
'
extensionHostReady
'
);
perf
.
mark
(
'
extensionHostReady
'
);
this
.
_installedExtensionsReady
.
open
();
this
.
_onDidRegisterExtensions
.
fire
(
void
0
);
this
.
_onDidChangeExtensionsStatus
.
fire
(
availableExtensions
.
map
(
e
=>
e
.
id
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录