Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3e98ad51
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,发现更多精彩内容 >>
提交
3e98ad51
编写于
7月 24, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add 'remoteName' context key (replaces remoteAuthority)
上级
b4e3cf33
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
27 addition
and
18 deletion
+27
-18
src/vs/platform/remote/common/remoteHosts.ts
src/vs/platform/remote/common/remoteHosts.ts
+12
-0
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-9
src/vs/workbench/browser/contextkeys.ts
src/vs/workbench/browser/contextkeys.ts
+5
-2
src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts
...workbench/contrib/extensions/browser/extensionsViewlet.ts
+4
-4
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
...h/contrib/preferences/browser/preferences.contribution.ts
+2
-2
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
...ch/contrib/remote/electron-browser/remote.contribution.ts
+2
-1
未找到文件。
src/vs/platform/remote/common/remoteHosts.ts
浏览文件 @
3e98ad51
...
@@ -11,3 +11,15 @@ export const REMOTE_HOST_SCHEME = Schemas.vscodeRemote;
...
@@ -11,3 +11,15 @@ export const REMOTE_HOST_SCHEME = Schemas.vscodeRemote;
export
function
getRemoteAuthority
(
uri
:
URI
):
string
|
undefined
{
export
function
getRemoteAuthority
(
uri
:
URI
):
string
|
undefined
{
return
uri
.
scheme
===
REMOTE_HOST_SCHEME
?
uri
.
authority
:
undefined
;
return
uri
.
scheme
===
REMOTE_HOST_SCHEME
?
uri
.
authority
:
undefined
;
}
}
export
function
getRemoteName
(
authority
:
string
|
undefined
):
string
|
undefined
{
if
(
!
authority
)
{
return
undefined
;
}
const
pos
=
authority
.
indexOf
(
'
+
'
);
if
(
pos
<
0
)
{
// funky? bad authority?
return
authority
;
}
return
authority
.
substr
(
0
,
pos
);
}
\ No newline at end of file
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
3e98ad51
...
@@ -72,6 +72,7 @@ import { ExtHostLabelService } from 'vs/workbench/api/common/extHostLabelService
...
@@ -72,6 +72,7 @@ import { ExtHostLabelService } from 'vs/workbench/api/common/extHostLabelService
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
getSingletonServiceDescriptors
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
getSingletonServiceDescriptors
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
getRemoteName
}
from
'
vs/platform/remote/common/remoteHosts
'
;
export
interface
IExtensionApiFactory
{
export
interface
IExtensionApiFactory
{
(
extension
:
IExtensionDescription
,
registry
:
ExtensionDescriptionRegistry
,
configProvider
:
ExtHostConfigProvider
):
typeof
vscode
;
(
extension
:
IExtensionDescription
,
registry
:
ExtensionDescriptionRegistry
,
configProvider
:
ExtHostConfigProvider
):
typeof
vscode
;
...
@@ -277,15 +278,7 @@ export function createApiFactory(
...
@@ -277,15 +278,7 @@ export function createApiFactory(
return
extHostWindow
.
openUri
(
uri
,
{
allowTunneling
:
!!
initData
.
remote
.
isRemote
});
return
extHostWindow
.
openUri
(
uri
,
{
allowTunneling
:
!!
initData
.
remote
.
isRemote
});
},
},
get
remoteName
()
{
get
remoteName
()
{
if
(
!
initData
.
remote
.
authority
)
{
return
getRemoteName
(
initData
.
remote
.
authority
);
return
undefined
;
}
const
pos
=
initData
.
remote
.
authority
.
indexOf
(
'
+
'
);
if
(
pos
<
0
)
{
// funky? bad authority?
return
initData
.
remote
.
authority
;
}
return
initData
.
remote
.
authority
.
substr
(
0
,
pos
);
}
}
};
};
if
(
!
initData
.
environment
.
extensionTestsLocationURI
)
{
if
(
!
initData
.
environment
.
extensionTestsLocationURI
)
{
...
...
src/vs/workbench/browser/contextkeys.ts
浏览文件 @
3e98ad51
...
@@ -20,6 +20,7 @@ import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/
...
@@ -20,6 +20,7 @@ import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
isMacintosh
,
isLinux
,
isWindows
,
isWeb
}
from
'
vs/base/common/platform
'
;
import
{
isMacintosh
,
isLinux
,
isWindows
,
isWeb
}
from
'
vs/base/common/platform
'
;
import
{
PanelPositionContext
}
from
'
vs/workbench/common/panel
'
;
import
{
PanelPositionContext
}
from
'
vs/workbench/common/panel
'
;
import
{
getRemoteName
}
from
'
vs/platform/remote/common/remoteHosts
'
;
export
const
IsMacContext
=
new
RawContextKey
<
boolean
>
(
'
isMac
'
,
isMacintosh
);
export
const
IsMacContext
=
new
RawContextKey
<
boolean
>
(
'
isMac
'
,
isMacintosh
);
export
const
IsLinuxContext
=
new
RawContextKey
<
boolean
>
(
'
isLinux
'
,
isLinux
);
export
const
IsLinuxContext
=
new
RawContextKey
<
boolean
>
(
'
isLinux
'
,
isLinux
);
...
@@ -28,8 +29,9 @@ export const IsWindowsContext = new RawContextKey<boolean>('isWindows', isWindow
...
@@ -28,8 +29,9 @@ export const IsWindowsContext = new RawContextKey<boolean>('isWindows', isWindow
export
const
IsWebContext
=
new
RawContextKey
<
boolean
>
(
'
isWeb
'
,
isWeb
);
export
const
IsWebContext
=
new
RawContextKey
<
boolean
>
(
'
isWeb
'
,
isWeb
);
export
const
IsMacNativeContext
=
new
RawContextKey
<
boolean
>
(
'
isMacNative
'
,
isMacintosh
&&
!
isWeb
);
export
const
IsMacNativeContext
=
new
RawContextKey
<
boolean
>
(
'
isMacNative
'
,
isMacintosh
&&
!
isWeb
);
export
const
RemoteAuthorityContext
=
new
RawContextKey
<
string
>
(
'
remoteAuthority
'
,
''
);
export
const
Deprecated_
RemoteAuthorityContext
=
new
RawContextKey
<
string
>
(
'
remoteAuthority
'
,
''
);
export
const
RemoteNameContext
=
new
RawContextKey
<
string
>
(
'
remoteName
'
,
''
);
export
const
RemoteConnectionState
=
new
RawContextKey
<
''
|
'
initializing
'
|
'
disconnected
'
|
'
connected
'
>
(
'
remoteConnectionState
'
,
''
);
export
const
RemoteConnectionState
=
new
RawContextKey
<
''
|
'
initializing
'
|
'
disconnected
'
|
'
connected
'
>
(
'
remoteConnectionState
'
,
''
);
export
const
HasMacNativeTabsContext
=
new
RawContextKey
<
boolean
>
(
'
hasMacNativeTabs
'
,
false
);
export
const
HasMacNativeTabsContext
=
new
RawContextKey
<
boolean
>
(
'
hasMacNativeTabs
'
,
false
);
...
@@ -121,7 +123,8 @@ export class WorkbenchContextKeysHandler extends Disposable {
...
@@ -121,7 +123,8 @@ export class WorkbenchContextKeysHandler extends Disposable {
IsWebContext
.
bindTo
(
this
.
contextKeyService
);
IsWebContext
.
bindTo
(
this
.
contextKeyService
);
IsMacNativeContext
.
bindTo
(
this
.
contextKeyService
);
IsMacNativeContext
.
bindTo
(
this
.
contextKeyService
);
RemoteAuthorityContext
.
bindTo
(
this
.
contextKeyService
).
set
(
this
.
environmentService
.
configuration
.
remoteAuthority
||
''
);
Deprecated_RemoteAuthorityContext
.
bindTo
(
this
.
contextKeyService
).
set
(
this
.
environmentService
.
configuration
.
remoteAuthority
||
''
);
// remove once
RemoteNameContext
.
bindTo
(
this
.
contextKeyService
).
set
(
getRemoteName
(
this
.
environmentService
.
configuration
.
remoteAuthority
)
||
''
);
// macOS Native Tabs
// macOS Native Tabs
const
windowConfig
=
this
.
configurationService
.
getValue
<
IWindowsConfiguration
>
();
const
windowConfig
=
this
.
configurationService
.
getValue
<
IWindowsConfiguration
>
();
...
...
src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts
浏览文件 @
3e98ad51
...
@@ -55,7 +55,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
...
@@ -55,7 +55,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ViewContainerViewlet
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
ViewContainerViewlet
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
Remote
Authority
Context
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
Remote
Name
Context
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
MementoObject
}
from
'
vs/workbench/common/memento
'
;
import
{
MementoObject
}
from
'
vs/workbench/common/memento
'
;
...
@@ -144,7 +144,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
...
@@ -144,7 +144,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
id
,
id
,
name
:
viewIdNameMappings
[
id
],
name
:
viewIdNameMappings
[
id
],
ctorDescriptor
:
{
ctor
:
EnabledExtensionsView
},
ctorDescriptor
:
{
ctor
:
EnabledExtensionsView
},
when
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
defaultExtensionViews
'
),
ContextKeyExpr
.
has
(
'
hasInstalledExtensions
'
),
Remote
Authority
Context
.
isEqualTo
(
''
)),
when
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
defaultExtensionViews
'
),
ContextKeyExpr
.
has
(
'
hasInstalledExtensions
'
),
Remote
Name
Context
.
isEqualTo
(
''
)),
weight
:
40
,
weight
:
40
,
canToggleVisibility
:
true
,
canToggleVisibility
:
true
,
order
:
1
order
:
1
...
@@ -159,7 +159,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
...
@@ -159,7 +159,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
id
,
id
,
name
:
viewIdNameMappings
[
id
],
name
:
viewIdNameMappings
[
id
],
ctorDescriptor
:
{
ctor
:
DisabledExtensionsView
},
ctorDescriptor
:
{
ctor
:
DisabledExtensionsView
},
when
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
defaultExtensionViews
'
),
ContextKeyExpr
.
has
(
'
hasInstalledExtensions
'
),
Remote
Authority
Context
.
isEqualTo
(
''
)),
when
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
defaultExtensionViews
'
),
ContextKeyExpr
.
has
(
'
hasInstalledExtensions
'
),
Remote
Name
Context
.
isEqualTo
(
''
)),
weight
:
10
,
weight
:
10
,
canToggleVisibility
:
true
,
canToggleVisibility
:
true
,
order
:
3
,
order
:
3
,
...
@@ -208,7 +208,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
...
@@ -208,7 +208,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
id
:
`extensions.
${
server
.
authority
}
.default`
,
id
:
`extensions.
${
server
.
authority
}
.default`
,
get
name
()
{
return
getInstalledViewName
();
},
get
name
()
{
return
getInstalledViewName
();
},
ctorDescriptor
:
{
ctor
:
ServerExtensionsView
,
arguments
:
[
server
,
EventOf
.
map
<
void
,
string
>
(
onDidChangeServerLabel
,
()
=>
getInstalledViewName
())]
},
ctorDescriptor
:
{
ctor
:
ServerExtensionsView
,
arguments
:
[
server
,
EventOf
.
map
<
void
,
string
>
(
onDidChangeServerLabel
,
()
=>
getInstalledViewName
())]
},
when
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
defaultExtensionViews
'
),
ContextKeyExpr
.
has
(
'
hasInstalledExtensions
'
),
Remote
Authority
Context
.
notEqualsTo
(
''
)),
when
:
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
defaultExtensionViews
'
),
ContextKeyExpr
.
has
(
'
hasInstalledExtensions
'
),
Remote
Name
Context
.
notEqualsTo
(
''
)),
weight
:
40
,
weight
:
40
,
order
:
1
order
:
1
}];
}];
...
...
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
浏览文件 @
3e98ad51
...
@@ -13,7 +13,7 @@ import * as nls from 'vs/nls';
...
@@ -13,7 +13,7 @@ import * as nls from 'vs/nls';
import
{
MenuId
,
MenuRegistry
,
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
MenuId
,
MenuRegistry
,
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
WorkbenchStateContext
,
RemoteAuthorityContext
,
IsMacNativ
eContext
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
WorkbenchStateContext
,
IsMacNativeContext
,
RemoteNam
eContext
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
@@ -424,7 +424,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
...
@@ -424,7 +424,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
title
:
{
value
:
label
,
original
:
`Open Remote Settings (
${
hostLabel
}
)`
},
title
:
{
value
:
label
,
original
:
`Open Remote Settings (
${
hostLabel
}
)`
},
category
:
{
value
:
nls
.
localize
(
'
preferencesCategory
'
,
"
Preferences
"
),
original
:
'
Preferences
'
}
category
:
{
value
:
nls
.
localize
(
'
preferencesCategory
'
,
"
Preferences
"
),
original
:
'
Preferences
'
}
},
},
when
:
Remote
Authority
Context
.
notEqualsTo
(
''
)
when
:
Remote
Name
Context
.
notEqualsTo
(
''
)
});
});
});
});
}
}
...
...
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
浏览文件 @
3e98ad51
...
@@ -37,7 +37,7 @@ import Severity from 'vs/base/common/severity';
...
@@ -37,7 +37,7 @@ import Severity from 'vs/base/common/severity';
import
{
ReloadWindowAction
}
from
'
vs/workbench/browser/actions/windowActions
'
;
import
{
ReloadWindowAction
}
from
'
vs/workbench/browser/actions/windowActions
'
;
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
RemoteConnectionState
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
RemoteConnectionState
,
Deprecated_RemoteAuthorityContext
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
IDownloadService
}
from
'
vs/platform/download/common/download
'
;
import
{
IDownloadService
}
from
'
vs/platform/download/common/download
'
;
const
WINDOW_ACTIONS_COMMAND_ID
=
'
remote.showActions
'
;
const
WINDOW_ACTIONS_COMMAND_ID
=
'
remote.showActions
'
;
...
@@ -119,6 +119,7 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
...
@@ -119,6 +119,7 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
if
(
this
.
disconnected
!==
isDisconnected
)
{
if
(
this
.
disconnected
!==
isDisconnected
)
{
this
.
disconnected
=
isDisconnected
;
this
.
disconnected
=
isDisconnected
;
RemoteConnectionState
.
bindTo
(
this
.
contextKeyService
).
set
(
isDisconnected
?
'
disconnected
'
:
'
connected
'
);
RemoteConnectionState
.
bindTo
(
this
.
contextKeyService
).
set
(
isDisconnected
?
'
disconnected
'
:
'
connected
'
);
Deprecated_RemoteAuthorityContext
.
bindTo
(
this
.
contextKeyService
).
set
(
!
isDisconnected
&&
this
.
remoteAuthority
||
''
);
this
.
updateWindowIndicator
();
this
.
updateWindowIndicator
();
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录