@codingame/monaco-vscode-remote-agent-service-override 3.0.0 → 3.1.0
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/remoteAgent.js +5 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.contribution.js +6 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.js +97 -0
- package/vscode/src/vs/workbench/services/tunnel/browser/tunnelService.js +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-remote-agent-service-override",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
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@3.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@3.1.0",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-environment-service-override": "3.
|
|
23
|
+
"@codingame/monaco-vscode-environment-service-override": "3.1.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
package/remoteAgent.js
CHANGED
|
@@ -21,11 +21,14 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
|
|
|
21
21
|
import { IRemoteUserDataProfilesService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles';
|
|
22
22
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
23
23
|
import { IActiveLanguagePackService } from 'vscode/vscode/vs/workbench/services/localization/common/locale';
|
|
24
|
+
import { ITunnelService } from 'vscode/vscode/vs/platform/tunnel/common/tunnel';
|
|
25
|
+
import { TunnelService } from './vscode/src/vs/workbench/services/tunnel/browser/tunnelService.js';
|
|
24
26
|
import getServiceOverride$1 from '@codingame/monaco-vscode-environment-service-override';
|
|
25
27
|
import { getWorkbenchConstructionOptions } from 'vscode/workbench';
|
|
26
28
|
import { registerServiceInitializePreParticipant } from 'vscode/lifecycle';
|
|
27
29
|
import './vscode/src/vs/workbench/contrib/remote/common/remote.contribution.js';
|
|
28
30
|
import './vscode/src/vs/workbench/contrib/remote/browser/remote.contribution.js';
|
|
31
|
+
import './vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.contribution.js';
|
|
29
32
|
|
|
30
33
|
let CustomRemoteSocketFactoryService = class CustomRemoteSocketFactoryService extends RemoteSocketFactoryService {
|
|
31
34
|
constructor(browserWorkbenchEnvironmentService) {
|
|
@@ -82,7 +85,8 @@ function getServiceOverride({ scanRemoteExtensions = false } = {}) {
|
|
|
82
85
|
[( IRemoteAuthorityResolverService.toString())]: new SyncDescriptor(InjectedRemoteAuthorityResolverService, []),
|
|
83
86
|
[( IRemoteExplorerService.toString())]: new SyncDescriptor(RemoteExplorerService, [], true),
|
|
84
87
|
[( IExternalUriOpenerService.toString())]: new SyncDescriptor(ExternalUriOpenerService, [], true),
|
|
85
|
-
[( IRemoteExtensionsScannerService.toString())]: new SyncDescriptor(CustomRemoteExtensionsScannerService, [scanRemoteExtensions], true)
|
|
88
|
+
[( IRemoteExtensionsScannerService.toString())]: new SyncDescriptor(CustomRemoteExtensionsScannerService, [scanRemoteExtensions], true),
|
|
89
|
+
[( ITunnelService.toString())]: new SyncDescriptor(TunnelService, [], true)
|
|
86
90
|
};
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
2
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { RemoteStartEntry } from './remoteStartEntry.js';
|
|
4
|
+
|
|
5
|
+
( Registry.as(Extensions.Workbench))
|
|
6
|
+
.registerWorkbenchContribution(RemoteStartEntry, 3 );
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
5
|
+
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
|
|
6
|
+
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
8
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
9
|
+
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
10
|
+
import { IWorkbenchExtensionEnablementService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement';
|
|
11
|
+
import { RawContextKey, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
12
|
+
|
|
13
|
+
var RemoteStartEntry_1;
|
|
14
|
+
const showStartEntryInWeb = ( new RawContextKey('showRemoteStartEntryInWeb', false));
|
|
15
|
+
let RemoteStartEntry = class RemoteStartEntry extends Disposable {
|
|
16
|
+
static { RemoteStartEntry_1 = this; }
|
|
17
|
+
static { this.REMOTE_WEB_START_ENTRY_ACTIONS_COMMAND_ID = 'workbench.action.remote.showWebStartEntryActions'; }
|
|
18
|
+
constructor(commandService, productService, extensionManagementService, extensionEnablementService, telemetryService, contextKeyService) {
|
|
19
|
+
super();
|
|
20
|
+
this.commandService = commandService;
|
|
21
|
+
this.productService = productService;
|
|
22
|
+
this.extensionManagementService = extensionManagementService;
|
|
23
|
+
this.extensionEnablementService = extensionEnablementService;
|
|
24
|
+
this.telemetryService = telemetryService;
|
|
25
|
+
this.contextKeyService = contextKeyService;
|
|
26
|
+
const remoteExtensionTips = this.productService.remoteExtensionTips?.['tunnel'];
|
|
27
|
+
this.startCommand = remoteExtensionTips?.startEntry?.startCommand ?? '';
|
|
28
|
+
this.remoteExtensionId = remoteExtensionTips?.extensionId ?? '';
|
|
29
|
+
this._init();
|
|
30
|
+
this.registerActions();
|
|
31
|
+
this.registerListeners();
|
|
32
|
+
}
|
|
33
|
+
registerActions() {
|
|
34
|
+
const category = ( localize2WithPath(
|
|
35
|
+
'vs/workbench/contrib/remote/browser/remoteStartEntry',
|
|
36
|
+
'remote.category',
|
|
37
|
+
"Remote"
|
|
38
|
+
));
|
|
39
|
+
const startEntry = this;
|
|
40
|
+
registerAction2(class extends Action2 {
|
|
41
|
+
constructor() {
|
|
42
|
+
super({
|
|
43
|
+
id: RemoteStartEntry_1.REMOTE_WEB_START_ENTRY_ACTIONS_COMMAND_ID,
|
|
44
|
+
category,
|
|
45
|
+
title: ( localize2WithPath(
|
|
46
|
+
'vs/workbench/contrib/remote/browser/remoteStartEntry',
|
|
47
|
+
'remote.showWebStartEntryActions',
|
|
48
|
+
"Show Remote Start Entry for web"
|
|
49
|
+
)),
|
|
50
|
+
f1: false
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async run() {
|
|
54
|
+
await startEntry.showWebRemoteStartActions();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
registerListeners() {
|
|
59
|
+
this._register(this.extensionEnablementService.onEnablementChanged(async (result) => {
|
|
60
|
+
for (const ext of result) {
|
|
61
|
+
if (ExtensionIdentifier.equals(this.remoteExtensionId, ext.identifier.id)) {
|
|
62
|
+
if (this.extensionEnablementService.isEnabled(ext)) {
|
|
63
|
+
showStartEntryInWeb.bindTo(this.contextKeyService).set(true);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
showStartEntryInWeb.bindTo(this.contextKeyService).set(false);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
async _init() {
|
|
73
|
+
const installed = (await this.extensionManagementService.getInstalled()).find(value => ExtensionIdentifier.equals(value.identifier.id, this.remoteExtensionId));
|
|
74
|
+
if (installed) {
|
|
75
|
+
if (this.extensionEnablementService.isEnabled(installed)) {
|
|
76
|
+
showStartEntryInWeb.bindTo(this.contextKeyService).set(true);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async showWebRemoteStartActions() {
|
|
81
|
+
this.commandService.executeCommand(this.startCommand);
|
|
82
|
+
this.telemetryService.publicLog2('workbenchActionExecuted', {
|
|
83
|
+
id: this.startCommand,
|
|
84
|
+
from: 'remote start entry'
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
RemoteStartEntry = RemoteStartEntry_1 = ( __decorate([
|
|
89
|
+
( __param(0, ICommandService)),
|
|
90
|
+
( __param(1, IProductService)),
|
|
91
|
+
( __param(2, IExtensionManagementService)),
|
|
92
|
+
( __param(3, IWorkbenchExtensionEnablementService)),
|
|
93
|
+
( __param(4, ITelemetryService)),
|
|
94
|
+
( __param(5, IContextKeyService))
|
|
95
|
+
], RemoteStartEntry));
|
|
96
|
+
|
|
97
|
+
export { RemoteStartEntry, showStartEntryInWeb };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
3
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
4
|
+
import { AbstractTunnelService, isTunnelProvider } from 'vscode/vscode/vs/platform/tunnel/common/tunnel';
|
|
5
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
6
|
+
|
|
7
|
+
let TunnelService = class TunnelService extends AbstractTunnelService {
|
|
8
|
+
constructor(logService, environmentService, configurationService) {
|
|
9
|
+
super(logService, configurationService);
|
|
10
|
+
this.environmentService = environmentService;
|
|
11
|
+
}
|
|
12
|
+
isPortPrivileged(_port) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
retainOrCreateTunnel(tunnelProvider, remoteHost, remotePort, _localHost, localPort, elevateIfNeeded, privacy, protocol) {
|
|
16
|
+
const existing = this.getTunnelFromMap(remoteHost, remotePort);
|
|
17
|
+
if (existing) {
|
|
18
|
+
++existing.refcount;
|
|
19
|
+
return existing.value;
|
|
20
|
+
}
|
|
21
|
+
if (isTunnelProvider(tunnelProvider)) {
|
|
22
|
+
return this.createWithProvider(tunnelProvider, remoteHost, remotePort, localPort, elevateIfNeeded, privacy, protocol);
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
canTunnel(uri) {
|
|
27
|
+
return super.canTunnel(uri) && !!this.environmentService.remoteAuthority;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
TunnelService = ( __decorate([
|
|
31
|
+
( __param(0, ILogService)),
|
|
32
|
+
( __param(1, IWorkbenchEnvironmentService)),
|
|
33
|
+
( __param(2, IConfigurationService))
|
|
34
|
+
], TunnelService));
|
|
35
|
+
|
|
36
|
+
export { TunnelService };
|