Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9c2a1dc4
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 搜索 >>
提交
9c2a1dc4
编写于
12月 22, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't restore ports that are already detected
Part of microsoft/vscode-remote-release#4112
上级
1478078e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
25 addition
and
12 deletion
+25
-12
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/extHostTunnelService.ts
src/vs/workbench/api/common/extHostTunnelService.ts
+1
-4
src/vs/workbench/api/node/extHostTunnelService.ts
src/vs/workbench/api/node/extHostTunnelService.ts
+0
-1
src/vs/workbench/contrib/remote/browser/remote.ts
src/vs/workbench/contrib/remote/browser/remote.ts
+2
-1
src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
+19
-0
src/vs/workbench/services/remote/common/remoteExplorerService.ts
...workbench/services/remote/common/remoteExplorerService.ts
+3
-1
未找到文件。
src/vs/workbench/api/browser/mainThreadTunnelService.ts
浏览文件 @
9c2a1dc4
...
...
@@ -51,10 +51,6 @@ export class MainThreadTunnelService extends Disposable implements MainThreadTun
this
.
remoteExplorerService
.
onFoundNewCandidates
(
candidates
);
}
async
$tunnelServiceReady
():
Promise
<
void
>
{
return
this
.
remoteExplorerService
.
restore
();
}
async
$setTunnelProvider
():
Promise
<
void
>
{
const
tunnelProvider
:
ITunnelProvider
=
{
forwardPort
:
(
tunnelOptions
:
TunnelOptions
,
tunnelCreationOptions
:
TunnelCreationOptions
)
=>
{
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
9c2a1dc4
...
...
@@ -971,7 +971,6 @@ export interface MainThreadTunnelServiceShape extends IDisposable {
$closeTunnel
(
remote
:
{
host
:
string
,
port
:
number
}):
Promise
<
void
>
;
$getTunnels
():
Promise
<
TunnelDescription
[]
>
;
$setTunnelProvider
():
Promise
<
void
>
;
$tunnelServiceReady
():
Promise
<
void
>
;
$onFoundNewCandidates
(
candidates
:
{
host
:
string
,
port
:
number
,
detail
:
string
}[]):
Promise
<
void
>
;
}
...
...
src/vs/workbench/api/common/extHostTunnelService.ts
浏览文件 @
9c2a1dc4
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
ExtHostTunnelServiceShape
,
MainContext
,
MainThreadTunnelServiceShape
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostTunnelServiceShape
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
RemoteTunnel
,
TunnelCreationOptions
,
TunnelOptions
}
from
'
vs/platform/remote/common/tunnel
'
;
...
...
@@ -44,12 +44,10 @@ export const IExtHostTunnelService = createDecorator<IExtHostTunnelService>('IEx
export
class
ExtHostTunnelService
implements
IExtHostTunnelService
{
declare
readonly
_serviceBrand
:
undefined
;
onDidChangeTunnels
:
vscode
.
Event
<
void
>
=
(
new
Emitter
<
void
>
()).
event
;
private
readonly
_proxy
:
MainThreadTunnelServiceShape
;
constructor
(
@
IExtHostRpcService
extHostRpc
:
IExtHostRpcService
,
)
{
this
.
_proxy
=
extHostRpc
.
getProxy
(
MainContext
.
MainThreadTunnelService
);
}
async
openTunnel
(
extension
:
IExtensionDescription
,
forward
:
TunnelOptions
):
Promise
<
vscode
.
Tunnel
|
undefined
>
{
...
...
@@ -59,7 +57,6 @@ export class ExtHostTunnelService implements IExtHostTunnelService {
return
[];
}
async
setTunnelExtensionFunctions
(
provider
:
vscode
.
RemoteAuthorityResolver
|
undefined
):
Promise
<
IDisposable
>
{
await
this
.
_proxy
.
$tunnelServiceReady
();
return
{
dispose
:
()
=>
{
}
};
}
$forwardPort
(
tunnelOptions
:
TunnelOptions
,
tunnelCreationOptions
:
TunnelCreationOptions
):
Promise
<
TunnelDto
>
|
undefined
{
return
undefined
;
}
...
...
src/vs/workbench/api/node/extHostTunnelService.ts
浏览文件 @
9c2a1dc4
...
...
@@ -183,7 +183,6 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
}
else
{
this
.
_forwardPortProvider
=
undefined
;
}
await
this
.
_proxy
.
$tunnelServiceReady
();
return
toDisposable
(()
=>
{
this
.
_forwardPortProvider
=
undefined
;
});
...
...
src/vs/workbench/contrib/remote/browser/remote.ts
浏览文件 @
9c2a1dc4
...
...
@@ -17,7 +17,7 @@ import { IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService'
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
FilterViewPaneContainer
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
AutomaticPortForwarding
,
ForwardedPortsView
,
VIEWLET_ID
}
from
'
vs/workbench/contrib/remote/browser/remoteExplorer
'
;
import
{
AutomaticPortForwarding
,
ForwardedPortsView
,
PortRestore
,
VIEWLET_ID
}
from
'
vs/workbench/contrib/remote/browser/remoteExplorer
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IViewDescriptor
,
IViewsRegistry
,
Extensions
,
ViewContainerLocation
,
IViewContainersRegistry
,
IViewDescriptorService
}
from
'
vs/workbench/common/views
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
...
...
@@ -817,4 +817,5 @@ const workbenchContributionsRegistry = Registry.as<IWorkbenchContributionsRegist
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteAgentConnectionStatusListener
,
LifecyclePhase
.
Eventually
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteStatusIndicator
,
LifecyclePhase
.
Starting
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
ForwardedPortsView
,
LifecyclePhase
.
Eventually
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
PortRestore
,
LifecyclePhase
.
Eventually
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
AutomaticPortForwarding
,
LifecyclePhase
.
Eventually
);
src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
浏览文件 @
9c2a1dc4
...
...
@@ -28,6 +28,7 @@ import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/co
import
{
ITASExperimentService
}
from
'
vs/workbench/services/experiment/common/experimentService
'
;
import
{
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
portsViewIcon
}
from
'
vs/workbench/contrib/remote/browser/remoteIcons
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
export
const
VIEWLET_ID
=
'
workbench.view.remote
'
;
...
...
@@ -169,6 +170,24 @@ export class ForwardedPortsView extends Disposable implements IWorkbenchContribu
}
}
export
class
PortRestore
implements
IWorkbenchContribution
{
constructor
(
@
IRemoteExplorerService
readonly
remoteExplorerService
:
IRemoteExplorerService
,
)
{
if
(
!
this
.
remoteExplorerService
.
tunnelModel
.
environmentTunnelsSet
)
{
Event
.
once
(
this
.
remoteExplorerService
.
tunnelModel
.
onEnvironmentTunnelsSet
)(
async
()
=>
{
await
this
.
restore
();
});
}
else
{
this
.
restore
();
}
}
private
async
restore
()
{
return
this
.
remoteExplorerService
.
restore
();
}
}
export
class
AutomaticPortForwarding
extends
Disposable
implements
IWorkbenchContribution
{
...
...
src/vs/workbench/services/remote/common/remoteExplorerService.ts
浏览文件 @
9c2a1dc4
...
...
@@ -183,7 +183,9 @@ export class TunnelModel extends Disposable {
if
(
this
.
configurationService
.
getValue
(
'
remote.restoreForwardedPorts
'
))
{
if
(
this
.
tunnelRestoreValue
)
{
(
<
Tunnel
[]
|
undefined
>
JSON
.
parse
(
this
.
tunnelRestoreValue
))?.
forEach
(
tunnel
=>
{
this
.
forward
({
host
:
tunnel
.
remoteHost
,
port
:
tunnel
.
remotePort
},
tunnel
.
localPort
,
tunnel
.
name
);
if
(
!
mapHasAddressLocalhostOrAllInterfaces
(
this
.
detected
,
tunnel
.
remoteHost
,
tunnel
.
remotePort
))
{
this
.
forward
({
host
:
tunnel
.
remoteHost
,
port
:
tunnel
.
remotePort
},
tunnel
.
localPort
,
tunnel
.
name
);
}
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录