@codingame/monaco-vscode-remote-agent-service-override 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/remote/browser/remote.contribution.js +2 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteConnectionHealth.js +158 -0
- package/vscode/src/vs/workbench/contrib/remote/common/remote.contribution.js +1 -49
- package/vscode/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-remote-agent-service-override",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@2.1.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.1.2",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-environment-service-override": "2.1.
|
|
23
|
+
"@codingame/monaco-vscode-environment-service-override": "2.1.2"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -5,6 +5,7 @@ import { TunnelFactoryContribution } from './tunnelFactory.js';
|
|
|
5
5
|
import { RemoteAgentConnectionStatusListener, RemoteMarkers } from './remote.js';
|
|
6
6
|
import { RemoteStatusIndicator } from './remoteIndicator.js';
|
|
7
7
|
import { ForwardedPortsView, PortRestore, AutomaticPortForwarding } from 'vscode/vscode/vs/workbench/contrib/remote/browser/remoteExplorer';
|
|
8
|
+
import { InitialRemoteConnectionHealthContribution } from './remoteConnectionHealth.js';
|
|
8
9
|
|
|
9
10
|
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
10
11
|
workbenchContributionsRegistry.registerWorkbenchContribution(ShowCandidateContribution, 2 );
|
|
@@ -15,3 +16,4 @@ workbenchContributionsRegistry.registerWorkbenchContribution(ForwardedPortsView,
|
|
|
15
16
|
workbenchContributionsRegistry.registerWorkbenchContribution(PortRestore, 4 );
|
|
16
17
|
workbenchContributionsRegistry.registerWorkbenchContribution(AutomaticPortForwarding, 4 );
|
|
17
18
|
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteMarkers, 4 );
|
|
19
|
+
workbenchContributionsRegistry.registerWorkbenchContribution(InitialRemoteConnectionHealthContribution, 3 );
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { remoteConnectionLatencyMeasurer, IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
|
|
3
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
4
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
|
+
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
6
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
7
|
+
import { getRemoteName } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
|
|
8
|
+
import { IBannerService } from 'vscode/vscode/vs/workbench/services/banner/browser/bannerService';
|
|
9
|
+
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
10
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
11
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
12
|
+
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
|
|
13
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
14
|
+
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
15
|
+
import Severity from 'vscode/vscode/vs/base/common/severity';
|
|
16
|
+
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
17
|
+
|
|
18
|
+
const REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY = 'remote.unsupportedConnectionChoice';
|
|
19
|
+
let InitialRemoteConnectionHealthContribution = class InitialRemoteConnectionHealthContribution {
|
|
20
|
+
constructor(_remoteAgentService, _environmentService, _telemetryService, bannerService, dialogService, openerService, hostService, storageService, productService) {
|
|
21
|
+
this._remoteAgentService = _remoteAgentService;
|
|
22
|
+
this._environmentService = _environmentService;
|
|
23
|
+
this._telemetryService = _telemetryService;
|
|
24
|
+
this.bannerService = bannerService;
|
|
25
|
+
this.dialogService = dialogService;
|
|
26
|
+
this.openerService = openerService;
|
|
27
|
+
this.hostService = hostService;
|
|
28
|
+
this.storageService = storageService;
|
|
29
|
+
this.productService = productService;
|
|
30
|
+
if (this._environmentService.remoteAuthority) {
|
|
31
|
+
this._checkInitialRemoteConnectionHealth();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async _confirmConnection() {
|
|
35
|
+
const { result, checkboxChecked } = await this.dialogService.prompt({
|
|
36
|
+
type: Severity.Warning,
|
|
37
|
+
message: ( localizeWithPath(
|
|
38
|
+
'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
|
|
39
|
+
'unsupportedGlibcWarning',
|
|
40
|
+
"You are about to connect to an OS version that is unsupported by {0}.",
|
|
41
|
+
this.productService.nameLong
|
|
42
|
+
)),
|
|
43
|
+
buttons: [
|
|
44
|
+
{
|
|
45
|
+
label: ( localizeWithPath(
|
|
46
|
+
'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
|
|
47
|
+
{ key: 'allow', comment: ['&& denotes a mnemonic'] },
|
|
48
|
+
"&&Allow"
|
|
49
|
+
)),
|
|
50
|
+
run: () => 1
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: ( localizeWithPath(
|
|
54
|
+
'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
|
|
55
|
+
{ key: 'learnMore', comment: ['&& denotes a mnemonic'] },
|
|
56
|
+
"&&Learn More"
|
|
57
|
+
)),
|
|
58
|
+
run: async () => { await this.openerService.open('https://aka.ms/vscode-remote/faq/old-linux'); return 2 ; }
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
cancelButton: {
|
|
62
|
+
run: () => 0
|
|
63
|
+
},
|
|
64
|
+
checkbox: {
|
|
65
|
+
label: ( localizeWithPath(
|
|
66
|
+
'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
|
|
67
|
+
'remember',
|
|
68
|
+
"Do not show again"
|
|
69
|
+
)),
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (result === 2 ) {
|
|
73
|
+
return await this._confirmConnection();
|
|
74
|
+
}
|
|
75
|
+
const allowed = result === 1 ;
|
|
76
|
+
if (allowed && checkboxChecked) {
|
|
77
|
+
this.storageService.store(`${REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY}.${this._environmentService.remoteAuthority}`, allowed, 0 , 1 );
|
|
78
|
+
}
|
|
79
|
+
return allowed;
|
|
80
|
+
}
|
|
81
|
+
async _checkInitialRemoteConnectionHealth() {
|
|
82
|
+
try {
|
|
83
|
+
const environment = await this._remoteAgentService.getRawEnvironment();
|
|
84
|
+
if (environment && environment.isUnsupportedGlibc) {
|
|
85
|
+
let allowed = this.storageService.getBoolean(`${REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY}.${this._environmentService.remoteAuthority}`, 0 );
|
|
86
|
+
if (allowed === undefined) {
|
|
87
|
+
allowed = await this._confirmConnection();
|
|
88
|
+
}
|
|
89
|
+
if (allowed) {
|
|
90
|
+
const actions = [
|
|
91
|
+
{
|
|
92
|
+
label: ( localizeWithPath(
|
|
93
|
+
'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
|
|
94
|
+
'unsupportedGlibcBannerLearnMore',
|
|
95
|
+
"Learn More"
|
|
96
|
+
)),
|
|
97
|
+
href: 'https://aka.ms/vscode-remote/faq/old-linux'
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
this.bannerService.show({
|
|
101
|
+
id: 'unsupportedGlibcWarning.banner',
|
|
102
|
+
message: ( localizeWithPath(
|
|
103
|
+
'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
|
|
104
|
+
'unsupportedGlibcWarning.banner',
|
|
105
|
+
"You are connected to an OS version that is unsupported by {0}.",
|
|
106
|
+
this.productService.nameLong
|
|
107
|
+
)),
|
|
108
|
+
actions,
|
|
109
|
+
icon: Codicon.warning,
|
|
110
|
+
disableCloseAction: true
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.hostService.openWindow({ forceReuseWindow: true, remoteAuthority: null });
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
this._telemetryService.publicLog2('remoteConnectionSuccess', {
|
|
119
|
+
web: isWeb,
|
|
120
|
+
connectionTimeMs: await this._remoteAgentService.getConnection()?.getInitialConnectionTimeMs(),
|
|
121
|
+
remoteName: getRemoteName(this._environmentService.remoteAuthority)
|
|
122
|
+
});
|
|
123
|
+
await this._measureExtHostLatency();
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
this._telemetryService.publicLog2('remoteConnectionFailure', {
|
|
127
|
+
web: isWeb,
|
|
128
|
+
connectionTimeMs: await this._remoteAgentService.getConnection()?.getInitialConnectionTimeMs(),
|
|
129
|
+
remoteName: getRemoteName(this._environmentService.remoteAuthority),
|
|
130
|
+
message: err ? err.message : ''
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async _measureExtHostLatency() {
|
|
135
|
+
const measurement = await remoteConnectionLatencyMeasurer.measure(this._remoteAgentService);
|
|
136
|
+
if (measurement === undefined) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this._telemetryService.publicLog2('remoteConnectionLatency', {
|
|
140
|
+
web: isWeb,
|
|
141
|
+
remoteName: getRemoteName(this._environmentService.remoteAuthority),
|
|
142
|
+
latencyMs: measurement.current
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
InitialRemoteConnectionHealthContribution = ( __decorate([
|
|
147
|
+
( __param(0, IRemoteAgentService)),
|
|
148
|
+
( __param(1, IWorkbenchEnvironmentService)),
|
|
149
|
+
( __param(2, ITelemetryService)),
|
|
150
|
+
( __param(3, IBannerService)),
|
|
151
|
+
( __param(4, IDialogService)),
|
|
152
|
+
( __param(5, IOpenerService)),
|
|
153
|
+
( __param(6, IHostService)),
|
|
154
|
+
( __param(7, IStorageService)),
|
|
155
|
+
( __param(8, IProductService))
|
|
156
|
+
], InitialRemoteConnectionHealthContribution));
|
|
157
|
+
|
|
158
|
+
export { InitialRemoteConnectionHealthContribution };
|
|
@@ -4,7 +4,7 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
|
4
4
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
5
5
|
import { OS, isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
6
6
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
7
|
-
import {
|
|
7
|
+
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
|
|
8
8
|
import { ILoggerService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
9
9
|
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
10
10
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
@@ -17,8 +17,6 @@ import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
|
|
|
17
17
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
18
18
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
19
19
|
import { PersistentConnection } from 'vscode/vscode/vs/platform/remote/common/remoteAgentConnection';
|
|
20
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
21
|
-
import { getRemoteName } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
|
|
22
20
|
import { IDownloadService } from 'vscode/vscode/vs/platform/download/common/download';
|
|
23
21
|
import { DownloadServiceChannel } from '../../../../platform/download/common/downloadIpc.js';
|
|
24
22
|
import { RemoteLoggerChannelClient } from '../../../../platform/log/common/logIpc.js';
|
|
@@ -132,56 +130,10 @@ RemoteInvalidWorkspaceDetector = ( __decorate([
|
|
|
132
130
|
( __param(4, IFileDialogService)),
|
|
133
131
|
( __param(5, IRemoteAgentService))
|
|
134
132
|
], RemoteInvalidWorkspaceDetector));
|
|
135
|
-
let InitialRemoteConnectionHealthContribution = class InitialRemoteConnectionHealthContribution {
|
|
136
|
-
constructor(_remoteAgentService, _environmentService, _telemetryService) {
|
|
137
|
-
this._remoteAgentService = _remoteAgentService;
|
|
138
|
-
this._environmentService = _environmentService;
|
|
139
|
-
this._telemetryService = _telemetryService;
|
|
140
|
-
if (this._environmentService.remoteAuthority) {
|
|
141
|
-
this._checkInitialRemoteConnectionHealth();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async _checkInitialRemoteConnectionHealth() {
|
|
145
|
-
try {
|
|
146
|
-
await this._remoteAgentService.getRawEnvironment();
|
|
147
|
-
this._telemetryService.publicLog2('remoteConnectionSuccess', {
|
|
148
|
-
web: isWeb,
|
|
149
|
-
connectionTimeMs: await this._remoteAgentService.getConnection()?.getInitialConnectionTimeMs(),
|
|
150
|
-
remoteName: getRemoteName(this._environmentService.remoteAuthority)
|
|
151
|
-
});
|
|
152
|
-
await this._measureExtHostLatency();
|
|
153
|
-
}
|
|
154
|
-
catch (err) {
|
|
155
|
-
this._telemetryService.publicLog2('remoteConnectionFailure', {
|
|
156
|
-
web: isWeb,
|
|
157
|
-
connectionTimeMs: await this._remoteAgentService.getConnection()?.getInitialConnectionTimeMs(),
|
|
158
|
-
remoteName: getRemoteName(this._environmentService.remoteAuthority),
|
|
159
|
-
message: err ? err.message : ''
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
async _measureExtHostLatency() {
|
|
164
|
-
const measurement = await remoteConnectionLatencyMeasurer.measure(this._remoteAgentService);
|
|
165
|
-
if (measurement === undefined) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
this._telemetryService.publicLog2('remoteConnectionLatency', {
|
|
169
|
-
web: isWeb,
|
|
170
|
-
remoteName: getRemoteName(this._environmentService.remoteAuthority),
|
|
171
|
-
latencyMs: measurement.current
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
InitialRemoteConnectionHealthContribution = ( __decorate([
|
|
176
|
-
( __param(0, IRemoteAgentService)),
|
|
177
|
-
( __param(1, IWorkbenchEnvironmentService)),
|
|
178
|
-
( __param(2, ITelemetryService))
|
|
179
|
-
], InitialRemoteConnectionHealthContribution));
|
|
180
133
|
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
181
134
|
workbenchContributionsRegistry.registerWorkbenchContribution(LabelContribution, 1 );
|
|
182
135
|
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteChannelsContribution, 3 );
|
|
183
136
|
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteInvalidWorkspaceDetector, 1 );
|
|
184
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(InitialRemoteConnectionHealthContribution, 3 );
|
|
185
137
|
{
|
|
186
138
|
class TriggerReconnectAction extends Action2 {
|
|
187
139
|
constructor() {
|
|
@@ -23,7 +23,8 @@ class RemoteExtensionEnvironmentChannelClient {
|
|
|
23
23
|
arch: data.arch,
|
|
24
24
|
marks: data.marks,
|
|
25
25
|
useHostProxy: data.useHostProxy,
|
|
26
|
-
profiles: revive(data.profiles)
|
|
26
|
+
profiles: revive(data.profiles),
|
|
27
|
+
isUnsupportedGlibc: data.isUnsupportedGlibc
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
static async getExtensionHostExitInfo(channel, remoteAuthority, reconnectionToken) {
|