Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
44cf9c91
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,体验更适合开发者的 AI 搜索 >>
提交
44cf9c91
编写于
12月 13, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make worker ExtHostTunnelService and remove dependency in ExtHostExtensionService
上级
0181e95b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
24 addition
and
23 deletion
+24
-23
src/vs/platform/remote/common/remoteAuthorityResolver.ts
src/vs/platform/remote/common/remoteAuthorityResolver.ts
+5
-0
src/vs/workbench/api/browser/mainThreadTunnelService.ts
src/vs/workbench/api/browser/mainThreadTunnelService.ts
+0
-4
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+0
-1
src/vs/workbench/api/common/extHostExtensionService.ts
src/vs/workbench/api/common/extHostExtensionService.ts
+3
-8
src/vs/workbench/api/common/extHostTunnelService.ts
src/vs/workbench/api/common/extHostTunnelService.ts
+10
-1
src/vs/workbench/api/node/extHostTunnelService.ts
src/vs/workbench/api/node/extHostTunnelService.ts
+0
-6
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+4
-1
src/vs/workbench/services/extensions/worker/extHost.services.ts
.../workbench/services/extensions/worker/extHost.services.ts
+2
-2
未找到文件。
src/vs/platform/remote/common/remoteAuthorityResolver.ts
浏览文件 @
44cf9c91
...
@@ -17,9 +17,14 @@ export interface ResolvedOptions {
...
@@ -17,9 +17,14 @@ export interface ResolvedOptions {
readonly
extensionHostEnv
?:
{
[
key
:
string
]:
string
|
null
};
readonly
extensionHostEnv
?:
{
[
key
:
string
]:
string
|
null
};
}
}
export
interface
TunnelInformation
{
detectedTunnels
?:
{
remote
:
{
port
:
number
,
host
:
string
},
localAddress
:
string
}[];
}
export
interface
ResolverResult
{
export
interface
ResolverResult
{
authority
:
ResolvedAuthority
;
authority
:
ResolvedAuthority
;
options
?:
ResolvedOptions
;
options
?:
ResolvedOptions
;
tunnelInformation
?:
TunnelInformation
;
}
}
export
enum
RemoteAuthorityResolverErrorCode
{
export
enum
RemoteAuthorityResolverErrorCode
{
...
...
src/vs/workbench/api/browser/mainThreadTunnelService.ts
浏览文件 @
44cf9c91
...
@@ -31,10 +31,6 @@ export class MainThreadTunnelService implements MainThreadTunnelServiceShape {
...
@@ -31,10 +31,6 @@ export class MainThreadTunnelService implements MainThreadTunnelServiceShape {
return
this
.
remoteExplorerService
.
close
(
remotePort
);
return
this
.
remoteExplorerService
.
close
(
remotePort
);
}
}
$addDetected
(
tunnels
:
{
remote
:
{
port
:
number
,
host
:
string
},
localAddress
:
string
}[]):
Promise
<
void
>
{
return
Promise
.
resolve
(
this
.
remoteExplorerService
.
addDetected
(
tunnels
));
}
async
$registerCandidateFinder
():
Promise
<
void
>
{
async
$registerCandidateFinder
():
Promise
<
void
>
{
this
.
remoteExplorerService
.
registerCandidateFinder
(()
=>
this
.
_proxy
.
$findCandidatePorts
());
this
.
remoteExplorerService
.
registerCandidateFinder
(()
=>
this
.
_proxy
.
$findCandidatePorts
());
}
}
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
44cf9c91
...
@@ -776,7 +776,6 @@ export interface MainThreadWindowShape extends IDisposable {
...
@@ -776,7 +776,6 @@ export interface MainThreadWindowShape extends IDisposable {
export
interface
MainThreadTunnelServiceShape
extends
IDisposable
{
export
interface
MainThreadTunnelServiceShape
extends
IDisposable
{
$openTunnel
(
tunnelOptions
:
TunnelOptions
):
Promise
<
TunnelDto
|
undefined
>
;
$openTunnel
(
tunnelOptions
:
TunnelOptions
):
Promise
<
TunnelDto
|
undefined
>
;
$closeTunnel
(
remotePort
:
number
):
Promise
<
void
>
;
$closeTunnel
(
remotePort
:
number
):
Promise
<
void
>
;
$addDetected
(
tunnels
:
{
remote
:
{
port
:
number
,
host
:
string
},
localAddress
:
string
}[]):
Promise
<
void
>
;
$registerCandidateFinder
():
Promise
<
void
>
;
$registerCandidateFinder
():
Promise
<
void
>
;
}
}
...
...
src/vs/workbench/api/common/extHostExtensionService.ts
浏览文件 @
44cf9c91
...
@@ -32,7 +32,6 @@ import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitData
...
@@ -32,7 +32,6 @@ import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitData
import
{
IExtensionStoragePaths
}
from
'
vs/workbench/api/common/extHostStoragePaths
'
;
import
{
IExtensionStoragePaths
}
from
'
vs/workbench/api/common/extHostStoragePaths
'
;
import
{
IExtHostRpcService
}
from
'
vs/workbench/api/common/extHostRpcService
'
;
import
{
IExtHostRpcService
}
from
'
vs/workbench/api/common/extHostRpcService
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
IExtHostTunnelService
}
from
'
vs/workbench/api/common/extHostTunnelService
'
;
interface
ITestRunner
{
interface
ITestRunner
{
/** Old test runner API, as exported from `vscode/lib/testrunner` */
/** Old test runner API, as exported from `vscode/lib/testrunner` */
...
@@ -77,7 +76,6 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
...
@@ -77,7 +76,6 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
protected
readonly
_extHostWorkspace
:
ExtHostWorkspace
;
protected
readonly
_extHostWorkspace
:
ExtHostWorkspace
;
protected
readonly
_extHostConfiguration
:
ExtHostConfiguration
;
protected
readonly
_extHostConfiguration
:
ExtHostConfiguration
;
protected
readonly
_logService
:
ILogService
;
protected
readonly
_logService
:
ILogService
;
protected
readonly
_extHostTunnelService
:
IExtHostTunnelService
;
protected
readonly
_mainThreadWorkspaceProxy
:
MainThreadWorkspaceShape
;
protected
readonly
_mainThreadWorkspaceProxy
:
MainThreadWorkspaceShape
;
protected
readonly
_mainThreadTelemetryProxy
:
MainThreadTelemetryShape
;
protected
readonly
_mainThreadTelemetryProxy
:
MainThreadTelemetryShape
;
...
@@ -106,8 +104,7 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
...
@@ -106,8 +104,7 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
@
IExtHostConfiguration
extHostConfiguration
:
IExtHostConfiguration
,
@
IExtHostConfiguration
extHostConfiguration
:
IExtHostConfiguration
,
@
ILogService
logService
:
ILogService
,
@
ILogService
logService
:
ILogService
,
@
IExtHostInitDataService
initData
:
IExtHostInitDataService
,
@
IExtHostInitDataService
initData
:
IExtHostInitDataService
,
@
IExtensionStoragePaths
storagePath
:
IExtensionStoragePaths
,
@
IExtensionStoragePaths
storagePath
:
IExtensionStoragePaths
@
IExtHostTunnelService
extHostTunnelService
:
IExtHostTunnelService
)
{
)
{
this
.
_hostUtils
=
hostUtils
;
this
.
_hostUtils
=
hostUtils
;
this
.
_extHostContext
=
extHostContext
;
this
.
_extHostContext
=
extHostContext
;
...
@@ -116,7 +113,6 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
...
@@ -116,7 +113,6 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
this
.
_extHostWorkspace
=
extHostWorkspace
;
this
.
_extHostWorkspace
=
extHostWorkspace
;
this
.
_extHostConfiguration
=
extHostConfiguration
;
this
.
_extHostConfiguration
=
extHostConfiguration
;
this
.
_logService
=
logService
;
this
.
_logService
=
logService
;
this
.
_extHostTunnelService
=
extHostTunnelService
;
this
.
_disposables
=
new
DisposableStore
();
this
.
_disposables
=
new
DisposableStore
();
this
.
_mainThreadWorkspaceProxy
=
this
.
_extHostContext
.
getProxy
(
MainContext
.
MainThreadWorkspace
);
this
.
_mainThreadWorkspaceProxy
=
this
.
_extHostContext
.
getProxy
(
MainContext
.
MainThreadWorkspace
);
...
@@ -656,13 +652,12 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
...
@@ -656,13 +652,12 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
extensionHostEnv
:
result
.
extensionHostEnv
extensionHostEnv
:
result
.
extensionHostEnv
};
};
await
this
.
_extHostTunnelService
.
addDetected
(
result
.
detectedTunnels
);
return
{
return
{
type
:
'
ok
'
,
type
:
'
ok
'
,
value
:
{
value
:
{
authority
,
authority
,
options
options
,
tunnelInformation
:
{
detectedTunnels
:
result
.
detectedTunnels
}
}
}
};
};
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
src/vs/workbench/api/common/extHostTunnelService.ts
浏览文件 @
44cf9c91
...
@@ -22,7 +22,16 @@ export interface TunnelDto {
...
@@ -22,7 +22,16 @@ export interface TunnelDto {
export
interface
IExtHostTunnelService
extends
ExtHostTunnelServiceShape
{
export
interface
IExtHostTunnelService
extends
ExtHostTunnelServiceShape
{
readonly
_serviceBrand
:
undefined
;
readonly
_serviceBrand
:
undefined
;
makeTunnel
(
forward
:
TunnelOptions
):
Promise
<
vscode
.
Tunnel
|
undefined
>
;
makeTunnel
(
forward
:
TunnelOptions
):
Promise
<
vscode
.
Tunnel
|
undefined
>
;
addDetected
(
tunnels
:
{
remote
:
{
port
:
number
,
host
:
string
},
localAddress
:
string
}[]
|
undefined
):
Promise
<
void
>
;
}
}
export
const
IExtHostTunnelService
=
createDecorator
<
IExtHostTunnelService
>
(
'
IExtHostTunnelService
'
);
export
const
IExtHostTunnelService
=
createDecorator
<
IExtHostTunnelService
>
(
'
IExtHostTunnelService
'
);
export
class
ExtHostTunnelService
implements
IExtHostTunnelService
{
_serviceBrand
:
undefined
;
async
makeTunnel
(
forward
:
TunnelOptions
):
Promise
<
vscode
.
Tunnel
|
undefined
>
{
return
undefined
;
}
async
$findCandidatePorts
():
Promise
<
{
port
:
number
;
detail
:
string
;
}[]
>
{
return
[];
}
}
src/vs/workbench/api/node/extHostTunnelService.ts
浏览文件 @
44cf9c91
...
@@ -45,12 +45,6 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
...
@@ -45,12 +45,6 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
return
undefined
;
return
undefined
;
}
}
async
addDetected
(
tunnels
:
{
remote
:
{
port
:
number
,
host
:
string
},
localAddress
:
string
}[]
|
undefined
):
Promise
<
void
>
{
if
(
tunnels
)
{
return
this
.
_proxy
.
$addDetected
(
tunnels
);
}
}
registerCandidateFinder
():
Promise
<
void
>
{
registerCandidateFinder
():
Promise
<
void
>
{
return
this
.
_proxy
.
$registerCandidateFinder
();
return
this
.
_proxy
.
$registerCandidateFinder
();
}
}
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
44cf9c91
...
@@ -38,6 +38,7 @@ import { flatten } from 'vs/base/common/arrays';
...
@@ -38,6 +38,7 @@ import { flatten } from 'vs/base/common/arrays';
import
{
IStaticExtensionsService
}
from
'
vs/workbench/services/extensions/common/staticExtensions
'
;
import
{
IStaticExtensionsService
}
from
'
vs/workbench/services/extensions/common/staticExtensions
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
IRemoteExplorerService
}
from
'
vs/workbench/services/remote/common/remoteExplorerService
'
;
class
DeltaExtensionsQueueItem
{
class
DeltaExtensionsQueueItem
{
constructor
(
constructor
(
...
@@ -70,7 +71,8 @@ export class ExtensionService extends AbstractExtensionService implements IExten
...
@@ -70,7 +71,8 @@ export class ExtensionService extends AbstractExtensionService implements IExten
@
IStaticExtensionsService
private
readonly
_staticExtensions
:
IStaticExtensionsService
,
@
IStaticExtensionsService
private
readonly
_staticExtensions
:
IStaticExtensionsService
,
@
IElectronService
private
readonly
_electronService
:
IElectronService
,
@
IElectronService
private
readonly
_electronService
:
IElectronService
,
@
IHostService
private
readonly
_hostService
:
IHostService
,
@
IHostService
private
readonly
_hostService
:
IHostService
,
@
IElectronEnvironmentService
private
readonly
_electronEnvironmentService
:
IElectronEnvironmentService
@
IElectronEnvironmentService
private
readonly
_electronEnvironmentService
:
IElectronEnvironmentService
,
@
IRemoteExplorerService
private
readonly
_remoteExplorerService
:
IRemoteExplorerService
)
{
)
{
super
(
super
(
instantiationService
,
instantiationService
,
...
@@ -471,6 +473,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
...
@@ -471,6 +473,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
// set the resolved authority
// set the resolved authority
this
.
_remoteAuthorityResolverService
.
setResolvedAuthority
(
resolvedAuthority
.
authority
,
resolvedAuthority
.
options
);
this
.
_remoteAuthorityResolverService
.
setResolvedAuthority
(
resolvedAuthority
.
authority
,
resolvedAuthority
.
options
);
this
.
_remoteExplorerService
.
addDetected
(
resolvedAuthority
.
tunnelInformation
?.
detectedTunnels
);
// monitor for breakage
// monitor for breakage
const
connection
=
this
.
_remoteAgentService
.
getConnection
();
const
connection
=
this
.
_remoteAgentService
.
getConnection
();
...
...
src/vs/workbench/services/extensions/worker/extHost.services.ts
浏览文件 @
44cf9c91
...
@@ -21,7 +21,7 @@ import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensio
...
@@ -21,7 +21,7 @@ import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensio
import
{
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ExtHostLogService
}
from
'
vs/workbench/api/worker/extHostLogService
'
;
import
{
ExtHostLogService
}
from
'
vs/workbench/api/worker/extHostLogService
'
;
import
{
IExtHostTunnelService
}
from
'
vs/workbench/api/common/extHostTunnelService
'
;
import
{
IExtHostTunnelService
,
ExtHostTunnelService
}
from
'
vs/workbench/api/common/extHostTunnelService
'
;
// register singleton services
// register singleton services
registerSingleton
(
ILogService
,
ExtHostLogService
);
registerSingleton
(
ILogService
,
ExtHostLogService
);
...
@@ -34,6 +34,7 @@ registerSingleton(IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors);
...
@@ -34,6 +34,7 @@ registerSingleton(IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors);
registerSingleton
(
IExtHostStorage
,
ExtHostStorage
);
registerSingleton
(
IExtHostStorage
,
ExtHostStorage
);
registerSingleton
(
IExtHostExtensionService
,
ExtHostExtensionService
);
registerSingleton
(
IExtHostExtensionService
,
ExtHostExtensionService
);
registerSingleton
(
IExtHostSearch
,
ExtHostSearch
);
registerSingleton
(
IExtHostSearch
,
ExtHostSearch
);
registerSingleton
(
IExtHostTunnelService
,
ExtHostTunnelService
);
// register services that only throw errors
// register services that only throw errors
function
NotImplementedProxy
<
T
>
(
name
:
ServiceIdentifier
<
T
>
):
{
new
():
T
}
{
function
NotImplementedProxy
<
T
>
(
name
:
ServiceIdentifier
<
T
>
):
{
new
():
T
}
{
...
@@ -54,4 +55,3 @@ registerSingleton(IExtHostTerminalService, WorkerExtHostTerminalService);
...
@@ -54,4 +55,3 @@ registerSingleton(IExtHostTerminalService, WorkerExtHostTerminalService);
registerSingleton
(
IExtHostTask
,
WorkerExtHostTask
);
registerSingleton
(
IExtHostTask
,
WorkerExtHostTask
);
registerSingleton
(
IExtHostDebugService
,
WorkerExtHostDebugService
);
registerSingleton
(
IExtHostDebugService
,
WorkerExtHostDebugService
);
registerSingleton
(
IExtensionStoragePaths
,
class
extends
NotImplementedProxy
(
IExtensionStoragePaths
)
{
whenReady
=
Promise
.
resolve
();
});
registerSingleton
(
IExtensionStoragePaths
,
class
extends
NotImplementedProxy
(
IExtensionStoragePaths
)
{
whenReady
=
Promise
.
resolve
();
});
registerSingleton
(
IExtHostTunnelService
,
class
extends
NotImplementedProxy
(
IExtHostTunnelService
)
{
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录