@codingame/monaco-vscode-debug-service-override 1.85.1 → 1.85.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/debug.js +4 -1
- package/package.json +3 -3
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +73 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +141 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +1 -1
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +9 -9
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +0 -207
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +0 -13
package/debug.js
CHANGED
|
@@ -5,6 +5,8 @@ import { LanguageFeaturesService } from './vscode/src/vs/editor/common/services/
|
|
|
5
5
|
import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
6
6
|
import { ConfigurationResolverService } from './vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js';
|
|
7
7
|
import { IConfigurationResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolver';
|
|
8
|
+
import { IExtensionHostDebugService } from 'vscode/vscode/vs/platform/debug/common/extensionHostDebug';
|
|
9
|
+
import { BrowserExtensionHostDebugService } from './vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js';
|
|
8
10
|
import getServiceOverride$1 from '@codingame/monaco-vscode-layout-service-override';
|
|
9
11
|
import './vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js';
|
|
10
12
|
|
|
@@ -17,7 +19,8 @@ function getServiceOverride() {
|
|
|
17
19
|
...getServiceOverride$1(),
|
|
18
20
|
[( ILanguageFeaturesService.toString())]: new SyncDescriptor(LanguageFeaturesService, [], true),
|
|
19
21
|
[( IDebugService.toString())]: new SyncDescriptor(DebugService, [], true),
|
|
20
|
-
[( IConfigurationResolverService.toString())]: new SyncDescriptor(ConfigurationResolverService, [], true)
|
|
22
|
+
[( IConfigurationResolverService.toString())]: new SyncDescriptor(ConfigurationResolverService, [], true),
|
|
23
|
+
[( IExtensionHostDebugService.toString())]: new SyncDescriptor(BrowserExtensionHostDebugService, [], true)
|
|
21
24
|
};
|
|
22
25
|
}
|
|
23
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-debug-service-override",
|
|
3
|
-
"version": "1.85.
|
|
3
|
+
"version": "1.85.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@1.85.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.2",
|
|
22
22
|
"monaco-editor": "0.45.0",
|
|
23
|
-
"@codingame/monaco-vscode-layout-service-override": "1.85.
|
|
23
|
+
"@codingame/monaco-vscode-layout-service-override": "1.85.2"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
|
|
4
|
+
class ExtensionHostDebugBroadcastChannel {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._onCloseEmitter = ( new Emitter());
|
|
7
|
+
this._onReloadEmitter = ( new Emitter());
|
|
8
|
+
this._onTerminateEmitter = ( new Emitter());
|
|
9
|
+
this._onAttachEmitter = ( new Emitter());
|
|
10
|
+
}
|
|
11
|
+
static { this.ChannelName = 'extensionhostdebugservice'; }
|
|
12
|
+
call(ctx, command, arg) {
|
|
13
|
+
switch (command) {
|
|
14
|
+
case 'close':
|
|
15
|
+
return Promise.resolve(this._onCloseEmitter.fire({ sessionId: arg[0] }));
|
|
16
|
+
case 'reload':
|
|
17
|
+
return Promise.resolve(this._onReloadEmitter.fire({ sessionId: arg[0] }));
|
|
18
|
+
case 'terminate':
|
|
19
|
+
return Promise.resolve(this._onTerminateEmitter.fire({ sessionId: arg[0] }));
|
|
20
|
+
case 'attach':
|
|
21
|
+
return Promise.resolve(this._onAttachEmitter.fire({ sessionId: arg[0], port: arg[1], subId: arg[2] }));
|
|
22
|
+
}
|
|
23
|
+
throw new Error('Method not implemented.');
|
|
24
|
+
}
|
|
25
|
+
listen(ctx, event, arg) {
|
|
26
|
+
switch (event) {
|
|
27
|
+
case 'close':
|
|
28
|
+
return this._onCloseEmitter.event;
|
|
29
|
+
case 'reload':
|
|
30
|
+
return this._onReloadEmitter.event;
|
|
31
|
+
case 'terminate':
|
|
32
|
+
return this._onTerminateEmitter.event;
|
|
33
|
+
case 'attach':
|
|
34
|
+
return this._onAttachEmitter.event;
|
|
35
|
+
}
|
|
36
|
+
throw new Error('Method not implemented.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class ExtensionHostDebugChannelClient extends Disposable {
|
|
40
|
+
constructor(channel) {
|
|
41
|
+
super();
|
|
42
|
+
this.channel = channel;
|
|
43
|
+
}
|
|
44
|
+
reload(sessionId) {
|
|
45
|
+
this.channel.call('reload', [sessionId]);
|
|
46
|
+
}
|
|
47
|
+
get onReload() {
|
|
48
|
+
return this.channel.listen('reload');
|
|
49
|
+
}
|
|
50
|
+
close(sessionId) {
|
|
51
|
+
this.channel.call('close', [sessionId]);
|
|
52
|
+
}
|
|
53
|
+
get onClose() {
|
|
54
|
+
return this.channel.listen('close');
|
|
55
|
+
}
|
|
56
|
+
attachSession(sessionId, port, subId) {
|
|
57
|
+
this.channel.call('attach', [sessionId, port, subId]);
|
|
58
|
+
}
|
|
59
|
+
get onAttachSession() {
|
|
60
|
+
return this.channel.listen('attach');
|
|
61
|
+
}
|
|
62
|
+
terminateSession(sessionId, subId) {
|
|
63
|
+
this.channel.call('terminate', [sessionId, subId]);
|
|
64
|
+
}
|
|
65
|
+
get onTerminateSession() {
|
|
66
|
+
return this.channel.listen('terminate');
|
|
67
|
+
}
|
|
68
|
+
openExtensionDevelopmentHostWindow(args, debugRenderer) {
|
|
69
|
+
return this.channel.call('openExtensionDevelopmentHostWindow', [args, debugRenderer]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { ExtensionHostDebugBroadcastChannel, ExtensionHostDebugChannelClient };
|
|
@@ -5,7 +5,7 @@ import { CancellationTokenSource, CancellationToken } from 'monaco-editor/esm/vs
|
|
|
5
5
|
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
6
|
import * as json from 'monaco-editor/esm/vs/base/common/json.js';
|
|
7
7
|
import { DisposableStore, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
8
|
-
import * as
|
|
8
|
+
import * as Objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
9
9
|
import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
10
10
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
11
11
|
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -439,7 +439,7 @@ class AbstractLaunch {
|
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
getConfiguration(name) {
|
|
442
|
-
const config =
|
|
442
|
+
const config = Objects.deepClone(this.getConfig());
|
|
443
443
|
if (!config || !config.configurations) {
|
|
444
444
|
return undefined;
|
|
445
445
|
}
|
|
@@ -534,7 +534,7 @@ let Launch = class Launch extends AbstractLaunch {
|
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
async writeConfiguration(configuration) {
|
|
537
|
-
const fullConfig =
|
|
537
|
+
const fullConfig = Objects.deepClone(this.getConfig());
|
|
538
538
|
if (!fullConfig.configurations) {
|
|
539
539
|
fullConfig.configurations = [];
|
|
540
540
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
4
|
+
import { ExtensionHostDebugChannelClient, ExtensionHostDebugBroadcastChannel } from '../../../../platform/debug/common/extensionHostDebugIpc.js';
|
|
5
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
6
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
7
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
8
|
+
import { isFolderToOpen, isWorkspaceToOpen } from 'vscode/vscode/vs/platform/window/common/window';
|
|
9
|
+
import { toWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, hasWorkspaceFileExtension, IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
10
|
+
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService';
|
|
11
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
12
|
+
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
|
|
13
|
+
|
|
14
|
+
var BrowserExtensionHostDebugService_1;
|
|
15
|
+
let BrowserExtensionHostDebugService = class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient {
|
|
16
|
+
static { BrowserExtensionHostDebugService_1 = this; }
|
|
17
|
+
static { this.LAST_EXTENSION_DEVELOPMENT_WORKSPACE_KEY = 'debug.lastExtensionDevelopmentWorkspace'; }
|
|
18
|
+
constructor(remoteAgentService, environmentService, logService, hostService, contextService, storageService, fileService) {
|
|
19
|
+
const connection = remoteAgentService.getConnection();
|
|
20
|
+
let channel;
|
|
21
|
+
if (connection) {
|
|
22
|
+
channel = connection.getChannel(ExtensionHostDebugBroadcastChannel.ChannelName);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
channel = { call: async () => undefined, listen: () => Event.None };
|
|
26
|
+
}
|
|
27
|
+
super(channel);
|
|
28
|
+
this.storageService = storageService;
|
|
29
|
+
this.fileService = fileService;
|
|
30
|
+
if (environmentService.options && environmentService.options.workspaceProvider) {
|
|
31
|
+
this.workspaceProvider = environmentService.options.workspaceProvider;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.workspaceProvider = { open: async () => true, workspace: undefined, trusted: undefined };
|
|
35
|
+
logService.warn('Extension Host Debugging not available due to missing workspace provider.');
|
|
36
|
+
}
|
|
37
|
+
this._register(this.onReload(event => {
|
|
38
|
+
if (environmentService.isExtensionDevelopment && environmentService.debugExtensionHost.debugId === event.sessionId) {
|
|
39
|
+
hostService.reload();
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
this._register(this.onClose(event => {
|
|
43
|
+
if (environmentService.isExtensionDevelopment && environmentService.debugExtensionHost.debugId === event.sessionId) {
|
|
44
|
+
hostService.close();
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
if (environmentService.isExtensionDevelopment && !environmentService.extensionTestsLocationURI) {
|
|
48
|
+
const workspaceId = toWorkspaceIdentifier(contextService.getWorkspace());
|
|
49
|
+
if (isSingleFolderWorkspaceIdentifier(workspaceId) || isWorkspaceIdentifier(workspaceId)) {
|
|
50
|
+
const serializedWorkspace = isSingleFolderWorkspaceIdentifier(workspaceId) ? { folderUri: workspaceId.uri.toJSON() } : { workspaceUri: workspaceId.configPath.toJSON() };
|
|
51
|
+
storageService.store(BrowserExtensionHostDebugService_1.LAST_EXTENSION_DEVELOPMENT_WORKSPACE_KEY, JSON.stringify(serializedWorkspace), 0 , 1 );
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
storageService.remove(BrowserExtensionHostDebugService_1.LAST_EXTENSION_DEVELOPMENT_WORKSPACE_KEY, 0 );
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async openExtensionDevelopmentHostWindow(args, _debugRenderer) {
|
|
59
|
+
const environment = ( new Map());
|
|
60
|
+
const fileUriArg = this.findArgument('file-uri', args);
|
|
61
|
+
if (fileUriArg && !hasWorkspaceFileExtension(fileUriArg)) {
|
|
62
|
+
environment.set('openFile', fileUriArg);
|
|
63
|
+
}
|
|
64
|
+
const copyArgs = [
|
|
65
|
+
'extensionDevelopmentPath',
|
|
66
|
+
'extensionTestsPath',
|
|
67
|
+
'extensionEnvironment',
|
|
68
|
+
'debugId',
|
|
69
|
+
'inspect-brk-extensions',
|
|
70
|
+
'inspect-extensions',
|
|
71
|
+
];
|
|
72
|
+
for (const argName of copyArgs) {
|
|
73
|
+
const value = this.findArgument(argName, args);
|
|
74
|
+
if (value) {
|
|
75
|
+
environment.set(argName, value);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let debugWorkspace = undefined;
|
|
79
|
+
const folderUriArg = this.findArgument('folder-uri', args);
|
|
80
|
+
if (folderUriArg) {
|
|
81
|
+
debugWorkspace = { folderUri: ( URI.parse(folderUriArg)) };
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const fileUriArg = this.findArgument('file-uri', args);
|
|
85
|
+
if (fileUriArg && hasWorkspaceFileExtension(fileUriArg)) {
|
|
86
|
+
debugWorkspace = { workspaceUri: ( URI.parse(fileUriArg)) };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const extensionTestsPath = this.findArgument('extensionTestsPath', args);
|
|
90
|
+
if (!debugWorkspace && !extensionTestsPath) {
|
|
91
|
+
const lastExtensionDevelopmentWorkspace = this.storageService.get(BrowserExtensionHostDebugService_1.LAST_EXTENSION_DEVELOPMENT_WORKSPACE_KEY, 0 );
|
|
92
|
+
if (lastExtensionDevelopmentWorkspace) {
|
|
93
|
+
try {
|
|
94
|
+
const serializedWorkspace = JSON.parse(lastExtensionDevelopmentWorkspace);
|
|
95
|
+
if (serializedWorkspace.workspaceUri) {
|
|
96
|
+
debugWorkspace = { workspaceUri: URI.revive(serializedWorkspace.workspaceUri) };
|
|
97
|
+
}
|
|
98
|
+
else if (serializedWorkspace.folderUri) {
|
|
99
|
+
debugWorkspace = { folderUri: URI.revive(serializedWorkspace.folderUri) };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (debugWorkspace) {
|
|
107
|
+
const debugWorkspaceResource = isFolderToOpen(debugWorkspace) ? debugWorkspace.folderUri : isWorkspaceToOpen(debugWorkspace) ? debugWorkspace.workspaceUri : undefined;
|
|
108
|
+
if (debugWorkspaceResource) {
|
|
109
|
+
const workspaceExists = await this.fileService.exists(debugWorkspaceResource);
|
|
110
|
+
if (!workspaceExists) {
|
|
111
|
+
debugWorkspace = undefined;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const success = await this.workspaceProvider.open(debugWorkspace, {
|
|
116
|
+
reuse: false,
|
|
117
|
+
payload: Array.from(environment.entries())
|
|
118
|
+
});
|
|
119
|
+
return { success };
|
|
120
|
+
}
|
|
121
|
+
findArgument(key, args) {
|
|
122
|
+
for (const a of args) {
|
|
123
|
+
const k = `--${key}=`;
|
|
124
|
+
if (a.indexOf(k) === 0) {
|
|
125
|
+
return a.substring(k.length);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
BrowserExtensionHostDebugService = BrowserExtensionHostDebugService_1 = ( __decorate([
|
|
132
|
+
( __param(0, IRemoteAgentService)),
|
|
133
|
+
( __param(1, IBrowserWorkbenchEnvironmentService)),
|
|
134
|
+
( __param(2, ILogService)),
|
|
135
|
+
( __param(3, IHostService)),
|
|
136
|
+
( __param(4, IWorkspaceContextService)),
|
|
137
|
+
( __param(5, IStorageService)),
|
|
138
|
+
( __param(6, IFileService))
|
|
139
|
+
], BrowserExtensionHostDebugService));
|
|
140
|
+
|
|
141
|
+
export { BrowserExtensionHostDebugService };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
3
|
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
|
-
import * as
|
|
4
|
+
import * as Objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
5
5
|
import { toAction } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
6
6
|
import * as errors from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
7
7
|
import { createErrorWithActions } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
|
|
@@ -681,7 +681,7 @@ let RawDebugSession = class RawDebugSession {
|
|
|
681
681
|
}
|
|
682
682
|
mergeCapabilities(capabilities) {
|
|
683
683
|
if (capabilities) {
|
|
684
|
-
this._capabilities =
|
|
684
|
+
this._capabilities = Objects.mixin(this._capabilities, capabilities);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
fireSimulatedContinuedEvent(threadId, allThreadsContinued = false) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
2
2
|
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
3
|
import { launchSchemaId } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
|
|
4
|
-
import { inputsSchema } from '
|
|
4
|
+
import { inputsSchema } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolverSchema';
|
|
5
5
|
|
|
6
6
|
const debuggersExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
7
7
|
extensionPoint: 'debuggers',
|
|
@@ -4,7 +4,7 @@ import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
|
4
4
|
import { DebugConfigurationProviderTriggerKind, debuggerDisabledMessage, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
5
5
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
6
6
|
import { IConfigurationResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolver';
|
|
7
|
-
import { applyDeprecatedVariableMessage } from '
|
|
7
|
+
import { applyDeprecatedVariableMessage } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils';
|
|
8
8
|
import { ITextResourcePropertiesService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
9
9
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
10
10
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Queue } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
2
2
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
3
|
-
import * as
|
|
3
|
+
import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
|
|
4
4
|
import { isCodeEditor, isDiffEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
5
5
|
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
6
6
|
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
@@ -164,7 +164,7 @@ class BaseConfigurationResolverService extends AbstractVariableResolverService {
|
|
|
164
164
|
case 'command': {
|
|
165
165
|
const commandId = (variableToCommandMap ? variableToCommandMap[name] : undefined) || name;
|
|
166
166
|
result = await this.commandService.executeCommand(commandId, configuration);
|
|
167
|
-
if (typeof result !== 'string' && !
|
|
167
|
+
if (typeof result !== 'string' && !Types.isUndefinedOrNull(result)) {
|
|
168
168
|
throw new Error(nls.localizeWithPath('vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService', 'commandVariable.noStringType', "Cannot substitute command variable '{0}' because command did not return a result of type string.", commandId));
|
|
169
169
|
}
|
|
170
170
|
break;
|
|
@@ -228,7 +228,7 @@ class BaseConfigurationResolverService extends AbstractVariableResolverService {
|
|
|
228
228
|
};
|
|
229
229
|
switch (info.type) {
|
|
230
230
|
case 'promptString': {
|
|
231
|
-
if (!
|
|
231
|
+
if (!Types.isString(info.description)) {
|
|
232
232
|
missingAttribute('description');
|
|
233
233
|
}
|
|
234
234
|
const inputOptions = { prompt: info.description, ignoreFocusLost: true };
|
|
@@ -243,12 +243,12 @@ class BaseConfigurationResolverService extends AbstractVariableResolverService {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
case 'pickString': {
|
|
246
|
-
if (!
|
|
246
|
+
if (!Types.isString(info.description)) {
|
|
247
247
|
missingAttribute('description');
|
|
248
248
|
}
|
|
249
249
|
if (Array.isArray(info.options)) {
|
|
250
250
|
for (const pickOption of info.options) {
|
|
251
|
-
if (!
|
|
251
|
+
if (!Types.isString(pickOption) && !Types.isString(pickOption.value)) {
|
|
252
252
|
missingAttribute('value');
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -258,8 +258,8 @@ class BaseConfigurationResolverService extends AbstractVariableResolverService {
|
|
|
258
258
|
}
|
|
259
259
|
const picks = ( new Array());
|
|
260
260
|
for (const pickOption of info.options) {
|
|
261
|
-
const value =
|
|
262
|
-
const label =
|
|
261
|
+
const value = Types.isString(pickOption) ? pickOption : pickOption.value;
|
|
262
|
+
const label = Types.isString(pickOption) ? undefined : pickOption.label;
|
|
263
263
|
const item = {
|
|
264
264
|
label: label ? `${label}: ${value}` : value,
|
|
265
265
|
value: value
|
|
@@ -285,11 +285,11 @@ class BaseConfigurationResolverService extends AbstractVariableResolverService {
|
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
case 'command': {
|
|
288
|
-
if (!
|
|
288
|
+
if (!Types.isString(info.command)) {
|
|
289
289
|
missingAttribute('command');
|
|
290
290
|
}
|
|
291
291
|
return this.userInputAccessQueue.queue(() => this.commandService.executeCommand(info.command, info.args)).then(result => {
|
|
292
|
-
if (typeof result === 'string' ||
|
|
292
|
+
if (typeof result === 'string' || Types.isUndefinedOrNull(result)) {
|
|
293
293
|
return result;
|
|
294
294
|
}
|
|
295
295
|
throw new Error(nls.localizeWithPath('vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService', 'inputVariable.command.noStringType', "Cannot substitute input variable '{0}' because command '{1}' did not return a result of type string.", variable, info.command));
|
package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
-
|
|
3
|
-
const idDescription = ( nls.localizeWithPath(
|
|
4
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
5
|
-
'JsonSchema.input.id',
|
|
6
|
-
"The input's id is used to associate an input with a variable of the form ${input:id}."
|
|
7
|
-
));
|
|
8
|
-
const typeDescription = ( nls.localizeWithPath(
|
|
9
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
10
|
-
'JsonSchema.input.type',
|
|
11
|
-
"The type of user input prompt to use."
|
|
12
|
-
));
|
|
13
|
-
const descriptionDescription = ( nls.localizeWithPath(
|
|
14
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
15
|
-
'JsonSchema.input.description',
|
|
16
|
-
"The description is shown when the user is prompted for input."
|
|
17
|
-
));
|
|
18
|
-
const defaultDescription = ( nls.localizeWithPath(
|
|
19
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
20
|
-
'JsonSchema.input.default',
|
|
21
|
-
"The default value for the input."
|
|
22
|
-
));
|
|
23
|
-
const inputsSchema = {
|
|
24
|
-
definitions: {
|
|
25
|
-
inputs: {
|
|
26
|
-
type: 'array',
|
|
27
|
-
description: ( nls.localizeWithPath(
|
|
28
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
29
|
-
'JsonSchema.inputs',
|
|
30
|
-
'User inputs. Used for defining user input prompts, such as free string input or a choice from several options.'
|
|
31
|
-
)),
|
|
32
|
-
items: {
|
|
33
|
-
oneOf: [
|
|
34
|
-
{
|
|
35
|
-
type: 'object',
|
|
36
|
-
required: ['id', 'type', 'description'],
|
|
37
|
-
additionalProperties: false,
|
|
38
|
-
properties: {
|
|
39
|
-
id: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
description: idDescription
|
|
42
|
-
},
|
|
43
|
-
type: {
|
|
44
|
-
type: 'string',
|
|
45
|
-
description: typeDescription,
|
|
46
|
-
enum: ['promptString'],
|
|
47
|
-
enumDescriptions: [
|
|
48
|
-
( nls.localizeWithPath(
|
|
49
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
50
|
-
'JsonSchema.input.type.promptString',
|
|
51
|
-
"The 'promptString' type opens an input box to ask the user for input."
|
|
52
|
-
)),
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
description: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: descriptionDescription
|
|
58
|
-
},
|
|
59
|
-
default: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: defaultDescription
|
|
62
|
-
},
|
|
63
|
-
password: {
|
|
64
|
-
type: 'boolean',
|
|
65
|
-
description: ( nls.localizeWithPath(
|
|
66
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
67
|
-
'JsonSchema.input.password',
|
|
68
|
-
"Controls if a password input is shown. Password input hides the typed text."
|
|
69
|
-
)),
|
|
70
|
-
},
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
type: 'object',
|
|
75
|
-
required: ['id', 'type', 'description', 'options'],
|
|
76
|
-
additionalProperties: false,
|
|
77
|
-
properties: {
|
|
78
|
-
id: {
|
|
79
|
-
type: 'string',
|
|
80
|
-
description: idDescription
|
|
81
|
-
},
|
|
82
|
-
type: {
|
|
83
|
-
type: 'string',
|
|
84
|
-
description: typeDescription,
|
|
85
|
-
enum: ['pickString'],
|
|
86
|
-
enumDescriptions: [
|
|
87
|
-
( nls.localizeWithPath(
|
|
88
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
89
|
-
'JsonSchema.input.type.pickString',
|
|
90
|
-
"The 'pickString' type shows a selection list."
|
|
91
|
-
)),
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
description: {
|
|
95
|
-
type: 'string',
|
|
96
|
-
description: descriptionDescription
|
|
97
|
-
},
|
|
98
|
-
default: {
|
|
99
|
-
type: 'string',
|
|
100
|
-
description: defaultDescription
|
|
101
|
-
},
|
|
102
|
-
options: {
|
|
103
|
-
type: 'array',
|
|
104
|
-
description: ( nls.localizeWithPath(
|
|
105
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
106
|
-
'JsonSchema.input.options',
|
|
107
|
-
"An array of strings that defines the options for a quick pick."
|
|
108
|
-
)),
|
|
109
|
-
items: {
|
|
110
|
-
oneOf: [
|
|
111
|
-
{
|
|
112
|
-
type: 'string'
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
type: 'object',
|
|
116
|
-
required: ['value'],
|
|
117
|
-
additionalProperties: false,
|
|
118
|
-
properties: {
|
|
119
|
-
label: {
|
|
120
|
-
type: 'string',
|
|
121
|
-
description: ( nls.localizeWithPath(
|
|
122
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
123
|
-
'JsonSchema.input.pickString.optionLabel',
|
|
124
|
-
"Label for the option."
|
|
125
|
-
))
|
|
126
|
-
},
|
|
127
|
-
value: {
|
|
128
|
-
type: 'string',
|
|
129
|
-
description: ( nls.localizeWithPath(
|
|
130
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
131
|
-
'JsonSchema.input.pickString.optionValue',
|
|
132
|
-
"Value for the option."
|
|
133
|
-
))
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
type: 'object',
|
|
144
|
-
required: ['id', 'type', 'command'],
|
|
145
|
-
additionalProperties: false,
|
|
146
|
-
properties: {
|
|
147
|
-
id: {
|
|
148
|
-
type: 'string',
|
|
149
|
-
description: idDescription
|
|
150
|
-
},
|
|
151
|
-
type: {
|
|
152
|
-
type: 'string',
|
|
153
|
-
description: typeDescription,
|
|
154
|
-
enum: ['command'],
|
|
155
|
-
enumDescriptions: [
|
|
156
|
-
( nls.localizeWithPath(
|
|
157
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
158
|
-
'JsonSchema.input.type.command',
|
|
159
|
-
"The 'command' type executes a command."
|
|
160
|
-
)),
|
|
161
|
-
]
|
|
162
|
-
},
|
|
163
|
-
command: {
|
|
164
|
-
type: 'string',
|
|
165
|
-
description: ( nls.localizeWithPath(
|
|
166
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
167
|
-
'JsonSchema.input.command.command',
|
|
168
|
-
"The command to execute for this input variable."
|
|
169
|
-
))
|
|
170
|
-
},
|
|
171
|
-
args: {
|
|
172
|
-
oneOf: [
|
|
173
|
-
{
|
|
174
|
-
type: 'object',
|
|
175
|
-
description: ( nls.localizeWithPath(
|
|
176
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
177
|
-
'JsonSchema.input.command.args',
|
|
178
|
-
"Optional arguments passed to the command."
|
|
179
|
-
))
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
type: 'array',
|
|
183
|
-
description: ( nls.localizeWithPath(
|
|
184
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
185
|
-
'JsonSchema.input.command.args',
|
|
186
|
-
"Optional arguments passed to the command."
|
|
187
|
-
))
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
type: 'string',
|
|
191
|
-
description: ( nls.localizeWithPath(
|
|
192
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverSchema',
|
|
193
|
-
'JsonSchema.input.command.args',
|
|
194
|
-
"Optional arguments passed to the command."
|
|
195
|
-
))
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export { inputsSchema };
|
package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
-
|
|
3
|
-
function applyDeprecatedVariableMessage(schema) {
|
|
4
|
-
schema.pattern = schema.pattern || '^(?!.*\\$\\{(env|config|command)\\.)';
|
|
5
|
-
schema.patternErrorMessage = schema.patternErrorMessage ||
|
|
6
|
-
( nls.localizeWithPath(
|
|
7
|
-
'vs/workbench/services/configurationResolver/common/configurationResolverUtils',
|
|
8
|
-
'deprecatedVariables',
|
|
9
|
-
"'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead."
|
|
10
|
-
));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { applyDeprecatedVariableMessage };
|