Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2a575f14
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,发现更多精彩内容 >>
提交
2a575f14
编写于
6月 12, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix usage of IMainContext / IExtHostContext
上级
f9911c74
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
8 deletion
+14
-8
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+2
-2
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+6
-1
src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts
...vs/workbench/test/electron-browser/api/testRPCProtocol.ts
+4
-3
未找到文件。
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
2a575f14
...
...
@@ -46,7 +46,7 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation';
import
*
as
vscode
from
'
vscode
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
*
as
files
from
'
vs/platform/files/common/files
'
;
import
{
MainContext
,
ExtHostContext
,
IInitData
,
I
ExtHost
Context
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
ExtHostContext
,
IInitData
,
I
Main
Context
}
from
'
./extHost.protocol
'
;
import
*
as
languageConfiguration
from
'
vs/editor/common/modes/languageConfiguration
'
;
import
{
TextEditorCursorStyle
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
ProxyIdentifier
}
from
'
vs/workbench/services/extensions/node/proxyIdentifier
'
;
...
...
@@ -89,7 +89,7 @@ function proposedApiFunction<T>(extension: IExtensionDescription, fn: T): T {
*/
export
function
createApiFactory
(
initData
:
IInitData
,
rpcProtocol
:
I
ExtHost
Context
,
rpcProtocol
:
I
Main
Context
,
extHostWorkspace
:
ExtHostWorkspace
,
extHostConfiguration
:
ExtHostConfiguration
,
extensionService
:
ExtHostExtensionService
,
...
...
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
2a575f14
...
...
@@ -13,7 +13,7 @@ import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/n
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ExtHostStorage
}
from
'
vs/workbench/api/node/extHostStorage
'
;
import
{
createApiFactory
,
initializeExtensionApi
,
checkProposedApiEnabled
}
from
'
vs/workbench/api/node/extHost.api.impl
'
;
import
{
MainContext
,
MainThreadExtensionServiceShape
,
IWorkspaceData
,
IEnvironment
,
IInitData
,
ExtHostExtensionServiceShape
,
MainThreadTelemetryShape
,
I
ExtHost
Context
}
from
'
./extHost.protocol
'
;
import
{
MainContext
,
MainThreadExtensionServiceShape
,
IWorkspaceData
,
IEnvironment
,
IInitData
,
ExtHostExtensionServiceShape
,
MainThreadTelemetryShape
,
I
Main
Context
}
from
'
./extHost.protocol
'
;
import
{
IExtensionMemento
,
ExtensionsActivator
,
ActivatedExtension
,
IExtensionAPI
,
IExtensionContext
,
EmptyExtension
,
IExtensionModule
,
ExtensionActivationTimesBuilder
,
ExtensionActivationTimes
,
ExtensionActivationReason
,
ExtensionActivatedByEvent
}
from
'
vs/workbench/api/node/extHostExtensionActivator
'
;
import
{
ExtHostConfiguration
}
from
'
vs/workbench/api/node/extHostConfiguration
'
;
import
{
ExtHostWorkspace
}
from
'
vs/workbench/api/node/extHostWorkspace
'
;
...
...
@@ -136,7 +136,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
* This class is constructed manually because it is a service, so it doesn't use any ctor injection
*/
constructor
(
initData
:
IInitData
,
extHostContext
:
I
ExtHost
Context
,
extHostContext
:
I
Main
Context
,
extHostWorkspace
:
ExtHostWorkspace
,
extHostConfiguration
:
ExtHostConfiguration
,
extHostLogService
:
ExtHostLogService
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
2a575f14
...
...
@@ -182,7 +182,11 @@ export class ExtensionHostProcessManager extends Disposable {
}
this
.
_extensionHostProcessRPCProtocol
=
new
RPCProtocol
(
protocol
);
const
extHostContext
:
IExtHostContext
=
this
.
_extensionHostProcessRPCProtocol
;
const
extHostContext
:
IExtHostContext
=
{
getProxy
:
<
T
>
(
identifier
:
ProxyIdentifier
<
T
>
):
T
=>
this
.
_extensionHostProcessRPCProtocol
.
getProxy
(
identifier
),
set
:
<
T
,
R
extends
T
>
(
identifier
:
ProxyIdentifier
<
T
>
,
instance
:
R
):
R
=>
this
.
_extensionHostProcessRPCProtocol
.
set
(
identifier
,
instance
),
assertRegistered
:
(
identifiers
:
ProxyIdentifier
<
any
>
[]):
void
=>
this
.
_extensionHostProcessRPCProtocol
.
assertRegistered
(
identifiers
),
};
// Named customers
const
namedCustomers
=
ExtHostCustomersRegistry
.
getNamedCustomers
();
...
...
@@ -231,6 +235,7 @@ export class ExtensionHostProcessManager extends Disposable {
}
export
class
ExtensionService
extends
Disposable
implements
IExtensionService
{
public
_serviceBrand
:
any
;
private
readonly
_onDidRegisterExtensions
:
Emitter
<
void
>
;
...
...
src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts
浏览文件 @
2a575f14
...
...
@@ -6,10 +6,11 @@
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ProxyIdentifier
,
IRPCProtocol
}
from
'
vs/workbench/services/extensions/node/proxyIdentifier
'
;
import
{
ProxyIdentifier
}
from
'
vs/workbench/services/extensions/node/proxyIdentifier
'
;
import
{
CharCode
}
from
'
vs/base/common/charCode
'
;
import
{
IExtHostContext
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
export
function
SingleProxyRPCProtocol
(
thing
:
any
):
I
RPCProtocol
{
export
function
SingleProxyRPCProtocol
(
thing
:
any
):
I
ExtHostContext
{
return
{
getProxy
<
T
>
():
T
{
return
thing
;
...
...
@@ -23,7 +24,7 @@ export function SingleProxyRPCProtocol(thing: any): IRPCProtocol {
declare
var
Proxy
:
any
;
// TODO@TypeScript
export
class
TestRPCProtocol
implements
I
RPCProtocol
{
export
class
TestRPCProtocol
implements
I
ExtHostContext
{
private
_callCountValue
:
number
=
0
;
private
_idle
:
Promise
<
any
>
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录