Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f1e01146
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 搜索 >>
提交
f1e01146
编写于
6月 11, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
context key: remoteConnectionState
上级
a15a1261
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
3 deletion
+10
-3
src/vs/platform/remote/common/remoteAgentConnection.ts
src/vs/platform/remote/common/remoteAgentConnection.ts
+3
-1
src/vs/workbench/browser/contextkeys.ts
src/vs/workbench/browser/contextkeys.ts
+2
-0
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
...ch/contrib/remote/electron-browser/remote.contribution.ts
+5
-2
未找到文件。
src/vs/platform/remote/common/remoteAgentConnection.ts
浏览文件 @
f1e01146
...
...
@@ -280,7 +280,7 @@ export class ConnectionGainEvent {
export
class
ReconnectionPermanentFailureEvent
{
public
readonly
type
=
PersistenConnectionEventType
.
ReconnectionPermanentFailure
;
}
export
type
PersistenConnectionEvent
=
Connection
LostEvent
|
ReconnectionWaitEvent
|
ReconnectionRunningEvent
|
ConnectionGain
Event
|
ReconnectionPermanentFailureEvent
;
export
type
PersistenConnectionEvent
=
Connection
GainEvent
|
ConnectionLostEvent
|
ReconnectionWaitEvent
|
ReconnectionRunning
Event
|
ReconnectionPermanentFailureEvent
;
abstract
class
PersistentConnection
extends
Disposable
{
...
...
@@ -302,6 +302,8 @@ abstract class PersistentConnection extends Disposable {
this
.
_isReconnecting
=
false
;
this
.
_permanentFailure
=
false
;
this
.
_onDidStateChange
.
fire
(
new
ConnectionGainEvent
());
this
.
_register
(
protocol
.
onSocketClose
(()
=>
this
.
_beginReconnecting
()));
this
.
_register
(
protocol
.
onSocketTimeout
(()
=>
this
.
_beginReconnecting
()));
}
...
...
src/vs/workbench/browser/contextkeys.ts
浏览文件 @
f1e01146
...
...
@@ -27,6 +27,8 @@ export const IsWindowsContext = new RawContextKey<boolean>('isWindows', isWindow
export
const
RemoteAuthorityContext
=
new
RawContextKey
<
string
>
(
'
remoteAuthority
'
,
''
);
export
const
RemoteConnectionState
=
new
RawContextKey
<
''
|
'
initializing
'
|
'
disconnected
'
|
'
connected
'
>
(
'
remoteConnectionState
'
,
''
);
export
const
HasMacNativeTabsContext
=
new
RawContextKey
<
boolean
>
(
'
hasMacNativeTabs
'
,
false
);
export
const
SupportsWorkspacesContext
=
new
RawContextKey
<
boolean
>
(
'
supportsWorkspaces
'
,
true
);
...
...
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
浏览文件 @
f1e01146
...
...
@@ -40,6 +40,7 @@ import Severity from 'vs/base/common/severity';
import
{
ReloadWindowAction
}
from
'
vs/workbench/electron-browser/actions/windowActions
'
;
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
RemoteConnectionState
}
from
'
vs/workbench/browser/contextkeys
'
;
const
WINDOW_ACTIONS_COMMAND_ID
=
'
remote.showActions
'
;
const
CLOSE_REMOTE_COMMAND_ID
=
'
remote.closeRemote
'
;
...
...
@@ -50,7 +51,7 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
private
windowCommandMenu
:
IMenu
;
private
hasWindowActions
:
boolean
=
false
;
private
remoteAuthority
:
string
|
undefined
;
private
disconnected
:
boolean
=
fals
e
;
private
disconnected
:
boolean
=
tru
e
;
constructor
(
@
IStatusbarService
private
readonly
statusbarService
:
IStatusbarService
,
...
...
@@ -77,6 +78,7 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
if
(
this
.
remoteAuthority
)
{
// Pending entry until extensions are ready
this
.
renderWindowIndicator
(
nls
.
localize
(
'
host.open
'
,
"
$(sync~spin) Opening Remote...
"
),
undefined
,
WINDOW_ACTIONS_COMMAND_ID
);
RemoteConnectionState
.
bindTo
(
this
.
contextKeyService
).
set
(
'
initializing
'
);
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
6_close
'
,
...
...
@@ -118,6 +120,7 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
private
setDisconnected
(
isDisconnected
:
boolean
):
void
{
if
(
this
.
disconnected
!==
isDisconnected
)
{
this
.
disconnected
=
isDisconnected
;
RemoteConnectionState
.
bindTo
(
this
.
contextKeyService
).
set
(
isDisconnected
?
'
disconnected
'
:
'
connected
'
);
this
.
updateWindowIndicator
();
}
}
...
...
@@ -162,7 +165,7 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
private
showIndicatorActions
(
menu
:
IMenu
)
{
const
actions
=
!
this
.
disconnected
?
menu
.
getActions
()
:
[];
const
actions
=
!
this
.
disconnected
||
!
this
.
remoteAuthority
?
menu
.
getActions
()
:
[];
const
items
:
(
IQuickPickItem
|
IQuickPickSeparator
)[]
=
[];
for
(
let
actionGroup
of
actions
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录