Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9f11bfb3
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,发现更多精彩内容 >>
提交
9f11bfb3
编写于
2月 21, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small rename
上级
de3ec3dd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+10
-10
未找到文件。
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
9f11bfb3
...
...
@@ -162,7 +162,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
private
readonly
_mainThreadExtensionsProxy
:
MainThreadExtensionServiceShape
;
private
readonly
_almostReadyToRunExtensions
:
Barrier
;
private
readonly
_
barrier
:
Barrier
;
private
readonly
_
readyToRunExtensions
:
Barrier
;
private
readonly
_registry
:
ExtensionDescriptionRegistry
;
private
readonly
_storage
:
ExtHostStorage
;
private
readonly
_storagePath
:
ExtensionStoragePath
;
...
...
@@ -194,7 +194,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
this
.
_mainThreadExtensionsProxy
=
this
.
_extHostContext
.
getProxy
(
MainContext
.
MainThreadExtensionService
);
this
.
_almostReadyToRunExtensions
=
new
Barrier
();
this
.
_
barrier
=
new
Barrier
();
this
.
_
readyToRunExtensions
=
new
Barrier
();
this
.
_registry
=
new
ExtensionDescriptionRegistry
(
initData
.
extensions
);
this
.
_storage
=
new
ExtHostStorage
(
this
.
_extHostContext
);
this
.
_storagePath
=
new
ExtensionStoragePath
(
initData
.
workspace
,
initData
.
environment
);
...
...
@@ -253,7 +253,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
this
.
_almostReadyToRunExtensions
.
open
();
await
this
.
_extHostWorkspace
.
waitForInitializeCall
();
this
.
_
barrier
.
open
();
this
.
_
readyToRunExtensions
.
open
();
}
catch
(
err
)
{
errors
.
onUnexpectedError
(
err
);
}
...
...
@@ -276,7 +276,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
}
public
isActivated
(
extensionId
:
ExtensionIdentifier
):
boolean
{
if
(
this
.
_
barrier
.
isOpen
())
{
if
(
this
.
_
readyToRunExtensions
.
isOpen
())
{
return
this
.
_activator
.
isActivated
(
extensionId
);
}
return
false
;
...
...
@@ -303,11 +303,11 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
}
public
getExtensionRegistry
():
Promise
<
ExtensionDescriptionRegistry
>
{
return
this
.
_
barrier
.
wait
().
then
(
_
=>
this
.
_registry
);
return
this
.
_
readyToRunExtensions
.
wait
().
then
(
_
=>
this
.
_registry
);
}
public
getExtensionExports
(
extensionId
:
ExtensionIdentifier
):
IExtensionAPI
|
null
|
undefined
{
if
(
this
.
_
barrier
.
isOpen
())
{
if
(
this
.
_
readyToRunExtensions
.
isOpen
())
{
return
this
.
_activator
.
getActivatedExtension
(
extensionId
).
exports
;
}
else
{
return
null
;
...
...
@@ -332,7 +332,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
private
_deactivate
(
extensionId
:
ExtensionIdentifier
):
Promise
<
void
>
{
let
result
=
Promise
.
resolve
(
undefined
);
if
(
!
this
.
_
barrier
.
isOpen
())
{
if
(
!
this
.
_
readyToRunExtensions
.
isOpen
())
{
return
result
;
}
...
...
@@ -661,7 +661,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
}
this
.
_started
=
true
;
return
this
.
_
barrier
.
wait
()
return
this
.
_
readyToRunExtensions
.
wait
()
.
then
(()
=>
this
.
_handleEagerExtensions
())
.
then
(()
=>
this
.
_handleExtensionTests
())
.
then
(()
=>
{
...
...
@@ -712,13 +712,13 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
public
$activateByEvent
(
activationEvent
:
string
):
Promise
<
void
>
{
return
(
this
.
_
barrier
.
wait
()
this
.
_
readyToRunExtensions
.
wait
()
.
then
(
_
=>
this
.
_activateByEvent
(
activationEvent
,
false
))
);
}
public
async
$activate
(
extensionId
:
ExtensionIdentifier
,
activationEvent
:
string
):
Promise
<
boolean
>
{
await
this
.
_
barrier
.
wait
();
await
this
.
_
readyToRunExtensions
.
wait
();
if
(
!
this
.
_registry
.
getExtensionDescription
(
extensionId
))
{
// unknown extension => ignore
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录