Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
566d7723
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,发现更多精彩内容 >>
未验证
提交
566d7723
编写于
7月 31, 2019
作者:
R
Rob Lourens
提交者:
GitHub
7月 31, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #77824 from microsoft/roblou/remoteEnvReconnection
Fix remote EH environment after reconnection
上级
299f0476
1c1e82f9
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
57 addition
and
0 deletion
+57
-0
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-0
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+14
-0
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
...ch/contrib/remote/electron-browser/remote.contribution.ts
+21
-0
src/vs/workbench/services/extensions/common/abstractExtensionService.ts
...ch/services/extensions/common/abstractExtensionService.ts
+5
-0
src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts
...services/extensions/common/extensionHostProcessManager.ts
+9
-0
src/vs/workbench/services/extensions/common/extensions.ts
src/vs/workbench/services/extensions/common/extensions.ts
+7
-0
未找到文件。
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
566d7723
...
...
@@ -876,6 +876,7 @@ export interface ExtHostExtensionServiceShape {
$startExtensionHost
(
enabledExtensionIds
:
ExtensionIdentifier
[]):
Promise
<
void
>
;
$activateByEvent
(
activationEvent
:
string
):
Promise
<
void
>
;
$activate
(
extensionId
:
ExtensionIdentifier
,
activationEvent
:
string
):
Promise
<
boolean
>
;
$setRemoteEnvironment
(
env
:
{
[
key
:
string
]:
string
|
null
}):
Promise
<
void
>
;
$deltaExtensions
(
toAdd
:
IExtensionDescription
[],
toRemove
:
ExtensionIdentifier
[]):
Promise
<
void
>
;
...
...
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
566d7723
...
...
@@ -749,6 +749,20 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
return
buff
;
}
public
async
$setRemoteEnvironment
(
env
:
{
[
key
:
string
]:
string
|
null
}):
Promise
<
void
>
{
if
(
!
this
.
_initData
.
remote
.
isRemote
)
{
return
;
}
for
(
const
key
in
env
)
{
const
value
=
env
[
key
];
if
(
value
===
null
)
{
delete
process
.
env
[
key
];
}
else
{
process
.
env
[
key
]
=
value
;
}
}
}
}
function
loadCommonJSModule
<
T
>
(
logService
:
ILogService
,
modulePath
:
string
,
activationTimesBuilder
:
ExtensionActivationTimesBuilder
):
Promise
<
T
>
{
...
...
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
浏览文件 @
566d7723
...
...
@@ -284,6 +284,26 @@ class ProgressReporter {
}
}
class
RemoteExtensionHostEnvironmentUpdater
implements
IWorkbenchContribution
{
constructor
(
@
IRemoteAgentService
remoteAgentService
:
IRemoteAgentService
,
@
IRemoteAuthorityResolverService
remoteResolverService
:
IRemoteAuthorityResolverService
,
@
IExtensionService
extensionService
:
IExtensionService
)
{
const
connection
=
remoteAgentService
.
getConnection
();
if
(
connection
)
{
connection
.
onDidStateChange
(
async
e
=>
{
if
(
e
.
type
===
PersistentConnectionEventType
.
ConnectionGain
)
{
const
resolveResult
=
await
remoteResolverService
.
resolveAuthority
(
connection
.
remoteAuthority
);
if
(
resolveResult
.
options
&&
resolveResult
.
options
.
extensionHostEnv
)
{
await
extensionService
.
setRemoteEnvironment
(
resolveResult
.
options
.
extensionHostEnv
);
}
}
});
}
}
}
class
RemoteAgentConnectionStatusListener
implements
IWorkbenchContribution
{
constructor
(
@
IRemoteAgentService
remoteAgentService
:
IRemoteAgentService
,
...
...
@@ -440,6 +460,7 @@ const workbenchContributionsRegistry = Registry.as<IWorkbenchContributionsRegist
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteChannelsContribution
,
LifecyclePhase
.
Starting
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteAgentDiagnosticListener
,
LifecyclePhase
.
Eventually
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteAgentConnectionStatusListener
,
LifecyclePhase
.
Eventually
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteExtensionHostEnvironmentUpdater
,
LifecyclePhase
.
Eventually
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteWindowActiveIndicator
,
LifecyclePhase
.
Starting
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteTelemetryEnablementUpdater
,
LifecyclePhase
.
Ready
);
workbenchContributionsRegistry
.
registerWorkbenchContribution
(
RemoteEmptyWorkbenchPresentation
,
LifecyclePhase
.
Starting
);
...
...
src/vs/workbench/services/extensions/common/abstractExtensionService.ts
浏览文件 @
566d7723
...
...
@@ -263,6 +263,11 @@ export abstract class AbstractExtensionService extends Disposable implements IEx
return
0
;
}
public
async
setRemoteEnvironment
(
env
:
{
[
key
:
string
]:
string
|
null
}):
Promise
<
void
>
{
await
this
.
_extensionHostProcessManagers
.
map
(
manager
=>
manager
.
setRemoteEnvironment
(
env
));
}
//#endregion
// --- impl
...
...
src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts
浏览文件 @
566d7723
...
...
@@ -288,6 +288,15 @@ export class ExtensionHostProcessManager extends Disposable {
}
return
proxy
.
$deltaExtensions
(
toAdd
,
toRemove
);
}
public
async
setRemoteEnvironment
(
env
:
{
[
key
:
string
]:
string
|
null
}):
Promise
<
void
>
{
const
proxy
=
await
this
.
_getExtensionHostProcessProxy
();
if
(
!
proxy
)
{
return
;
}
return
proxy
.
$setRemoteEnvironment
(
env
);
}
}
const
colorTables
=
[
...
...
src/vs/workbench/services/extensions/common/extensions.ts
浏览文件 @
566d7723
...
...
@@ -229,6 +229,12 @@ export interface IExtensionService {
*/
stopExtensionHost
():
void
;
/**
* Modify the environment of the remote extension host
* @param env New properties for the remote extension host
*/
setRemoteEnvironment
(
env
:
{
[
key
:
string
]:
string
|
null
}):
Promise
<
void
>
;
_logOrShowMessage
(
severity
:
Severity
,
msg
:
string
):
void
;
_activateById
(
extensionId
:
ExtensionIdentifier
,
activationEvent
:
string
):
Promise
<
void
>
;
_onWillActivateExtension
(
extensionId
:
ExtensionIdentifier
):
void
;
...
...
@@ -278,6 +284,7 @@ export class NullExtensionService implements IExtensionService {
restartExtensionHost
():
void
{
}
startExtensionHost
():
void
{
}
stopExtensionHost
():
void
{
}
async
setRemoteEnvironment
(
_env
:
{
[
key
:
string
]:
string
|
null
}):
Promise
<
void
>
{
}
canAddExtension
():
boolean
{
return
false
;
}
canRemoveExtension
():
boolean
{
return
false
;
}
_logOrShowMessage
(
_severity
:
Severity
,
_msg
:
string
):
void
{
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录