@codingame/monaco-vscode-debug-service-override 7.0.10 → 7.0.11

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 CHANGED
@@ -3,8 +3,6 @@ import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/d
3
3
  import { DebugService } from './vscode/src/vs/workbench/contrib/debug/browser/debugService.js';
4
4
  import { LanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeaturesService';
5
5
  import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
6
- import { ConfigurationResolverService } from './vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js';
7
- import { IConfigurationResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service';
8
6
  import { IExtensionHostDebugService } from 'vscode/vscode/vs/platform/debug/common/extensionHostDebug.service';
9
7
  import { BrowserExtensionHostDebugService } from './vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js';
10
8
  import { IDebugVisualizerService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugVisualizers.service';
@@ -20,7 +18,6 @@ function getServiceOverride() {
20
18
  return {
21
19
  [( ILanguageFeaturesService.toString())]: new SyncDescriptor(LanguageFeaturesService, [], true),
22
20
  [( IDebugService.toString())]: new SyncDescriptor(DebugService, [], true),
23
- [( IConfigurationResolverService.toString())]: new SyncDescriptor(ConfigurationResolverService, [], true),
24
21
  [( IExtensionHostDebugService.toString())]: new SyncDescriptor(BrowserExtensionHostDebugService, [], true),
25
22
  [( IDebugVisualizerService.toString())]: new SyncDescriptor(DebugVisualizerService, [], true)
26
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-debug-service-override",
3
- "version": "7.0.10",
3
+ "version": "7.0.11",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@7.0.10"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@7.0.11"
30
30
  }
31
31
  }
@@ -1,333 +0,0 @@
1
- import { Queue } from 'vscode/vscode/vs/base/common/async';
2
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
- import { isUndefinedOrNull, isString } from 'vscode/vscode/vs/base/common/types';
4
- import { isCodeEditor, isDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
5
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
6
- import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
7
- import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
8
- import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
9
- import { AbstractVariableResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/variableResolver';
10
-
11
- const _moduleId = "vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService";
12
- class BaseConfigurationResolverService extends AbstractVariableResolverService {
13
- static { this.INPUT_OR_COMMAND_VARIABLES_PATTERN = /\${((input|command):(.*?))}/g; }
14
- constructor(context, envVariablesPromise, editorService, configurationService, commandService, workspaceContextService, quickInputService, labelService, pathService, extensionService) {
15
- super({
16
- getFolderUri: (folderName) => {
17
- const folder = workspaceContextService.getWorkspace().folders.filter(f => f.name === folderName).pop();
18
- return folder ? folder.uri : undefined;
19
- },
20
- getWorkspaceFolderCount: () => {
21
- return workspaceContextService.getWorkspace().folders.length;
22
- },
23
- getConfigurationValue: (folderUri, suffix) => {
24
- return configurationService.getValue(suffix, folderUri ? { resource: folderUri } : {});
25
- },
26
- getAppRoot: () => {
27
- return context.getAppRoot();
28
- },
29
- getExecPath: () => {
30
- return context.getExecPath();
31
- },
32
- getFilePath: () => {
33
- const fileResource = EditorResourceAccessor.getOriginalUri(editorService.activeEditor, {
34
- supportSideBySide: SideBySideEditor.PRIMARY,
35
- filterByScheme: [Schemas.file, Schemas.vscodeUserData, this.pathService.defaultUriScheme]
36
- });
37
- if (!fileResource) {
38
- return undefined;
39
- }
40
- return this.labelService.getUriLabel(fileResource, { noPrefix: true });
41
- },
42
- getWorkspaceFolderPathForFile: () => {
43
- const fileResource = EditorResourceAccessor.getOriginalUri(editorService.activeEditor, {
44
- supportSideBySide: SideBySideEditor.PRIMARY,
45
- filterByScheme: [Schemas.file, Schemas.vscodeUserData, this.pathService.defaultUriScheme]
46
- });
47
- if (!fileResource) {
48
- return undefined;
49
- }
50
- const wsFolder = workspaceContextService.getWorkspaceFolder(fileResource);
51
- if (!wsFolder) {
52
- return undefined;
53
- }
54
- return this.labelService.getUriLabel(wsFolder.uri, { noPrefix: true });
55
- },
56
- getSelectedText: () => {
57
- const activeTextEditorControl = editorService.activeTextEditorControl;
58
- let activeControl = null;
59
- if (isCodeEditor(activeTextEditorControl)) {
60
- activeControl = activeTextEditorControl;
61
- }
62
- else if (isDiffEditor(activeTextEditorControl)) {
63
- const original = activeTextEditorControl.getOriginalEditor();
64
- const modified = activeTextEditorControl.getModifiedEditor();
65
- activeControl = original.hasWidgetFocus() ? original : modified;
66
- }
67
- const activeModel = activeControl?.getModel();
68
- const activeSelection = activeControl?.getSelection();
69
- if (activeModel && activeSelection) {
70
- return activeModel.getValueInRange(activeSelection);
71
- }
72
- return undefined;
73
- },
74
- getLineNumber: () => {
75
- const activeTextEditorControl = editorService.activeTextEditorControl;
76
- if (isCodeEditor(activeTextEditorControl)) {
77
- const selection = activeTextEditorControl.getSelection();
78
- if (selection) {
79
- const lineNumber = selection.positionLineNumber;
80
- return String(lineNumber);
81
- }
82
- }
83
- return undefined;
84
- },
85
- getExtension: id => {
86
- return extensionService.getExtension(id);
87
- },
88
- }, labelService, pathService.userHome().then(home => home.path), envVariablesPromise);
89
- this.configurationService = configurationService;
90
- this.commandService = commandService;
91
- this.workspaceContextService = workspaceContextService;
92
- this.quickInputService = quickInputService;
93
- this.labelService = labelService;
94
- this.pathService = pathService;
95
- this.userInputAccessQueue = ( (new Queue()));
96
- }
97
- async resolveWithInteractionReplace(folder, config, section, variables, target) {
98
- config = await this.resolveAnyAsync(folder, config);
99
- return this.resolveWithInteraction(folder, config, section, variables, target).then(mapping => {
100
- if (!mapping) {
101
- return null;
102
- }
103
- else if (mapping.size > 0) {
104
- return this.resolveAnyAsync(folder, config, Object.fromEntries(mapping));
105
- }
106
- else {
107
- return config;
108
- }
109
- });
110
- }
111
- async resolveWithInteraction(folder, config, section, variables, target) {
112
- const resolved = await this.resolveAnyMap(folder, config);
113
- config = resolved.newConfig;
114
- const allVariableMapping = resolved.resolvedVariables;
115
- return this.resolveWithInputAndCommands(folder, config, variables, section, target).then(inputOrCommandMapping => {
116
- if (this.updateMapping(inputOrCommandMapping, allVariableMapping)) {
117
- return allVariableMapping;
118
- }
119
- return undefined;
120
- });
121
- }
122
- updateMapping(newMapping, fullMapping) {
123
- if (!newMapping) {
124
- return false;
125
- }
126
- for (const [key, value] of Object.entries(newMapping)) {
127
- fullMapping.set(key, value);
128
- }
129
- return true;
130
- }
131
- async resolveWithInputAndCommands(folder, configuration, variableToCommandMap, section, target) {
132
- if (!configuration) {
133
- return Promise.resolve(undefined);
134
- }
135
- let inputs = [];
136
- if (this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY && section) {
137
- const overrides = folder ? { resource: folder.uri } : {};
138
- const result = this.configurationService.inspect(section, overrides);
139
- if (result && (result.userValue || result.workspaceValue || result.workspaceFolderValue)) {
140
- switch (target) {
141
- case ConfigurationTarget.USER:
142
- inputs = result.userValue?.inputs;
143
- break;
144
- case ConfigurationTarget.WORKSPACE:
145
- inputs = result.workspaceValue?.inputs;
146
- break;
147
- default: inputs = result.workspaceFolderValue?.inputs;
148
- }
149
- }
150
- else {
151
- const valueResult = this.configurationService.getValue(section, overrides);
152
- if (valueResult) {
153
- inputs = valueResult.inputs;
154
- }
155
- }
156
- }
157
- const variables = [];
158
- this.findVariables(configuration, variables);
159
- const variableValues = Object.create(null);
160
- for (const variable of variables) {
161
- const [type, name] = variable.split(':', 2);
162
- let result;
163
- switch (type) {
164
- case 'input':
165
- result = await this.showUserInput(name, inputs);
166
- break;
167
- case 'command': {
168
- const commandId = (variableToCommandMap ? variableToCommandMap[name] : undefined) || name;
169
- result = await this.commandService.executeCommand(commandId, configuration);
170
- if (typeof result !== 'string' && !isUndefinedOrNull(result)) {
171
- throw ( (new Error(localizeWithPath(
172
- _moduleId,
173
- 0,
174
- "Cannot substitute command variable '{0}' because command did not return a result of type string.",
175
- commandId
176
- ))));
177
- }
178
- break;
179
- }
180
- default:
181
- if (( (this._contributedVariables.has(variable)))) {
182
- result = await this._contributedVariables.get(variable)();
183
- }
184
- }
185
- if (typeof result === 'string') {
186
- variableValues[variable] = result;
187
- }
188
- else {
189
- return undefined;
190
- }
191
- }
192
- return variableValues;
193
- }
194
- findVariables(object, variables) {
195
- if (typeof object === 'string') {
196
- let matches;
197
- while ((matches = BaseConfigurationResolverService.INPUT_OR_COMMAND_VARIABLES_PATTERN.exec(object)) !== null) {
198
- if (matches.length === 4) {
199
- const command = matches[1];
200
- if (variables.indexOf(command) < 0) {
201
- variables.push(command);
202
- }
203
- }
204
- }
205
- for (const contributed of ( (this._contributedVariables.keys()))) {
206
- if ((variables.indexOf(contributed) < 0) && (object.indexOf('${' + contributed + '}') >= 0)) {
207
- variables.push(contributed);
208
- }
209
- }
210
- }
211
- else if (Array.isArray(object)) {
212
- for (const value of object) {
213
- this.findVariables(value, variables);
214
- }
215
- }
216
- else if (object) {
217
- for (const value of ( (Object.values(object)))) {
218
- this.findVariables(value, variables);
219
- }
220
- }
221
- }
222
- showUserInput(variable, inputInfos) {
223
- if (!inputInfos) {
224
- return Promise.reject(( (new Error(( localizeWithPath(
225
- _moduleId,
226
- 1,
227
- "Variable '{0}' must be defined in an '{1}' section of the debug or task configuration.",
228
- variable,
229
- 'inputs'
230
- ))))));
231
- }
232
- const info = inputInfos.filter(item => item.id === variable).pop();
233
- if (info) {
234
- const missingAttribute = (attrName) => {
235
- throw ( (new Error(localizeWithPath(
236
- _moduleId,
237
- 2,
238
- "Input variable '{0}' is of type '{1}' and must include '{2}'.",
239
- variable,
240
- info.type,
241
- attrName
242
- ))));
243
- };
244
- switch (info.type) {
245
- case 'promptString': {
246
- if (!isString(info.description)) {
247
- missingAttribute('description');
248
- }
249
- const inputOptions = { prompt: info.description, ignoreFocusLost: true };
250
- if (info.default) {
251
- inputOptions.value = info.default;
252
- }
253
- if (info.password) {
254
- inputOptions.password = info.password;
255
- }
256
- return this.userInputAccessQueue.queue(() => this.quickInputService.input(inputOptions)).then(resolvedInput => {
257
- return resolvedInput;
258
- });
259
- }
260
- case 'pickString': {
261
- if (!isString(info.description)) {
262
- missingAttribute('description');
263
- }
264
- if (Array.isArray(info.options)) {
265
- for (const pickOption of info.options) {
266
- if (!isString(pickOption) && !isString(pickOption.value)) {
267
- missingAttribute('value');
268
- }
269
- }
270
- }
271
- else {
272
- missingAttribute('options');
273
- }
274
- const picks = ( (new Array()));
275
- for (const pickOption of info.options) {
276
- const value = isString(pickOption) ? pickOption : pickOption.value;
277
- const label = isString(pickOption) ? undefined : pickOption.label;
278
- const item = {
279
- label: label ? `${label}: ${value}` : value,
280
- value: value
281
- };
282
- if (value === info.default) {
283
- item.description = ( localizeWithPath(_moduleId, 3, "(Default)"));
284
- picks.unshift(item);
285
- }
286
- else {
287
- picks.push(item);
288
- }
289
- }
290
- const pickOptions = { placeHolder: info.description, matchOnDetail: true, ignoreFocusLost: true };
291
- return this.userInputAccessQueue.queue(() => this.quickInputService.pick(picks, pickOptions, undefined)).then(resolvedInput => {
292
- if (resolvedInput) {
293
- return resolvedInput.value;
294
- }
295
- return undefined;
296
- });
297
- }
298
- case 'command': {
299
- if (!isString(info.command)) {
300
- missingAttribute('command');
301
- }
302
- return this.userInputAccessQueue.queue(() => this.commandService.executeCommand(info.command, info.args)).then(result => {
303
- if (typeof result === 'string' || isUndefinedOrNull(result)) {
304
- return result;
305
- }
306
- throw ( (new Error(localizeWithPath(
307
- _moduleId,
308
- 4,
309
- "Cannot substitute input variable '{0}' because command '{1}' did not return a result of type string.",
310
- variable,
311
- info.command
312
- ))));
313
- });
314
- }
315
- default:
316
- throw ( (new Error(localizeWithPath(
317
- _moduleId,
318
- 5,
319
- "Input variable '{0}' can only be of type 'promptString', 'pickString', or 'command'.",
320
- variable
321
- ))));
322
- }
323
- }
324
- return Promise.reject(( (new Error(( localizeWithPath(
325
- _moduleId,
326
- 6,
327
- "Undefined input variable '{0}' encountered. Remove or define '{0}' to continue.",
328
- variable
329
- ))))));
330
- }
331
- }
332
-
333
- export { BaseConfigurationResolverService };
@@ -1,30 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
3
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
4
- import 'vscode/vscode/vs/platform/instantiation/common/extensions';
5
- import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
6
- import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
7
- import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
8
- import { BaseConfigurationResolverService } from './baseConfigurationResolverService.js';
9
- import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
10
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
11
- import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
12
- import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
13
-
14
- let ConfigurationResolverService = class ConfigurationResolverService extends BaseConfigurationResolverService {
15
- constructor(editorService, configurationService, commandService, workspaceContextService, quickInputService, labelService, pathService, extensionService) {
16
- super({ getAppRoot: () => undefined, getExecPath: () => undefined }, Promise.resolve(Object.create(null)), editorService, configurationService, commandService, workspaceContextService, quickInputService, labelService, pathService, extensionService);
17
- }
18
- };
19
- ConfigurationResolverService = ( __decorate([
20
- ( __param(0, IEditorService)),
21
- ( __param(1, IConfigurationService)),
22
- ( __param(2, ICommandService)),
23
- ( __param(3, IWorkspaceContextService)),
24
- ( __param(4, IQuickInputService)),
25
- ( __param(5, ILabelService)),
26
- ( __param(6, IPathService)),
27
- ( __param(7, IExtensionService))
28
- ], ConfigurationResolverService));
29
-
30
- export { ConfigurationResolverService };