Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
428d4768
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,发现更多精彩内容 >>
提交
428d4768
编写于
10月 07, 2016
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Run extension host detached under Windows to ensure correct extension shutdown
上级
d90ca30f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
6 deletion
+29
-6
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+10
-3
src/vs/workbench/node/extensionHostMain.ts
src/vs/workbench/node/extensionHostMain.ts
+11
-3
src/vs/workbench/services/thread/electron-browser/threadService.ts
...rkbench/services/thread/electron-browser/threadService.ts
+8
-0
未找到文件。
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
428d4768
...
...
@@ -148,16 +148,21 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
return
this
.
_activatedExtensions
[
extensionId
].
exports
;
}
public
deactivate
(
extensionId
:
string
):
void
{
public
deactivate
(
extensionId
:
string
):
TPromise
<
void
>
{
let
result
:
TPromise
<
void
>
=
TPromise
.
as
(
void
0
);
let
extension
=
this
.
_activatedExtensions
[
extensionId
];
if
(
!
extension
)
{
return
;
return
result
;
}
// call deactivate if available
try
{
if
(
typeof
extension
.
module
.
deactivate
===
'
function
'
)
{
extension
.
module
.
deactivate
();
result
=
TPromise
.
wrap
(
extension
.
module
.
deactivate
()).
then
(
null
,
(
err
)
=>
{
// TODO: Do something with err if this is not the shutdown case
return
TPromise
.
as
(
void
0
);
});
}
}
catch
(
err
)
{
// TODO: Do something with err if this is not the shutdown case
...
...
@@ -169,6 +174,8 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
}
catch
(
err
)
{
// TODO: Do something with err if this is not the shutdown case
}
return
result
;
}
public
registrationDone
(
messages
:
IMessage
[]):
void
{
...
...
src/vs/workbench/node/extensionHostMain.ts
浏览文件 @
428d4768
...
...
@@ -23,6 +23,7 @@ import {ExtHostThreadService} from 'vs/workbench/services/thread/common/extHostT
import
{
RemoteTelemetryService
}
from
'
vs/workbench/api/node/extHostTelemetry
'
;
import
{
ExtensionScanner
,
MessagesCollector
}
from
'
vs/workbench/node/extensionPoints
'
;
import
{
IWorkspaceContextService
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
const
DIRNAME
=
URI
.
parse
(
require
.
toUrl
(
'
./
'
)).
fsPath
;
const
BASE_PATH
=
paths
.
normalize
(
paths
.
join
(
DIRNAME
,
'
../../../..
'
));
...
...
@@ -151,21 +152,28 @@ export class ExtensionHostMain {
}
this
.
_isTerminating
=
true
;
errors
.
setUnexpectedErrorHandler
((
err
)
=>
{
// TODO: write to log once we have one
});
let
allPromises
:
TPromise
<
void
>
[]
=
[];
try
{
let
allExtensions
=
ExtensionsRegistry
.
getAllExtensionDescriptions
();
let
allExtensionsIds
=
allExtensions
.
map
(
ext
=>
ext
.
id
);
let
activatedExtensions
=
allExtensionsIds
.
filter
(
id
=>
this
.
_extensionService
.
isActivated
(
id
));
a
ctivatedExtensions
.
forEach
((
extensionId
)
=>
{
this
.
_extensionService
.
deactivate
(
extensionId
);
a
llPromises
=
activatedExtensions
.
map
((
extensionId
)
=>
{
return
this
.
_extensionService
.
deactivate
(
extensionId
);
});
}
catch
(
err
)
{
// TODO: write to log once we have one
}
let
extensionsDeactivated
=
TPromise
.
join
(
allPromises
).
then
<
void
>
(()
=>
void
0
);
// Give extensions 1 second to wrap up any async dispose, then exit
setTimeout
(()
=>
{
exit
(
);
TPromise
.
any
<
void
>
([
TPromise
.
timeout
(
4000
),
extensionsDeactivated
]).
then
(()
=>
exit
(),
()
=>
exit
()
);
},
1000
);
}
...
...
src/vs/workbench/services/thread/electron-browser/threadService.ts
浏览文件 @
428d4768
...
...
@@ -12,6 +12,7 @@ import * as objects from 'vs/base/common/objects';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
findFreePort
}
from
'
vs/base/node/ports
'
;
import
{
IMainProcessExtHostIPC
,
create
}
from
'
vs/platform/extensions/common/ipcRemoteCom
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
...
...
@@ -151,6 +152,13 @@ class ExtensionHostProcessManager {
if
(
port
)
{
opts
.
execArgv
=
[
'
--nolazy
'
,
(
this
.
isExtensionDevelopmentDebugging
?
'
--debug-brk=
'
:
'
--debug=
'
)
+
port
];
}
// We only detach the extension host on windows. Linux and Mac orphan by default
// and detach under Linux and Mac create another process group.
if
(
isWindows
)
{
// We detach because we have noticed that when the renderer exits, its child processes
// (i.e. extension host) is taken down in a brutal fashion by the OS
opts
.
detached
=
true
;
}
// Run Extension Host as fork of current process
this
.
extensionHostProcessHandle
=
fork
(
URI
.
parse
(
require
.
toUrl
(
'
bootstrap
'
)).
fsPath
,
[
'
--type=extensionHost
'
],
opts
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录