@codingame/monaco-vscode-api 1.83.0-next.0 → 1.83.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/monaco-editor-treemending.patch +919 -919
- package/package.json +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.js +15 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +49 -51
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +58 -69
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +23 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +16 -16
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +59 -65
- package/vscode/src/vs/workbench/api/common/extHostConsoleForwarder.js +8 -8
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +151 -215
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +54 -58
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +53 -55
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +28 -28
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +265 -277
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +17 -19
- package/vscode/src/vs/workbench/api/worker/extHostExtensionService.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +26 -32
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +20 -26
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +58 -74
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +19 -19
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +32 -36
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +19 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +73 -126
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +66 -74
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +82 -92
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +27 -29
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +122 -124
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +35 -39
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +25 -25
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +30 -32
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +82 -92
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +31 -31
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +16 -16
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +32 -42
|
@@ -20,16 +20,16 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
20
20
|
this._contextService = _contextService;
|
|
21
21
|
this._logService = _logService;
|
|
22
22
|
this._configurationService = _configurationService;
|
|
23
|
-
this._fileProvider = (
|
|
24
|
-
this._disposables = (
|
|
25
|
-
this._watches = (
|
|
26
|
-
this._proxy = (
|
|
27
|
-
const infoProxy = (
|
|
23
|
+
this._fileProvider = ( new DisposableMap());
|
|
24
|
+
this._disposables = ( new DisposableStore());
|
|
25
|
+
this._watches = ( new DisposableMap());
|
|
26
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystem));
|
|
27
|
+
const infoProxy = ( extHostContext.getProxy(ExtHostContext.ExtHostFileSystemInfo));
|
|
28
28
|
for (const entry of _fileService.listCapabilities()) {
|
|
29
|
-
infoProxy.$acceptProviderInfos((
|
|
29
|
+
infoProxy.$acceptProviderInfos(( URI.from({ scheme: entry.scheme, path: '/dummy' })), entry.capabilities);
|
|
30
30
|
}
|
|
31
|
-
this._disposables.add(_fileService.onDidChangeFileSystemProviderRegistrations(e => infoProxy.$acceptProviderInfos((
|
|
32
|
-
this._disposables.add(_fileService.onDidChangeFileSystemProviderCapabilities(e => infoProxy.$acceptProviderInfos((
|
|
31
|
+
this._disposables.add(_fileService.onDidChangeFileSystemProviderRegistrations(e => infoProxy.$acceptProviderInfos(( URI.from({ scheme: e.scheme, path: '/dummy' })), e.provider?.capabilities ?? null)));
|
|
32
|
+
this._disposables.add(_fileService.onDidChangeFileSystemProviderCapabilities(e => infoProxy.$acceptProviderInfos(( URI.from({ scheme: e.scheme, path: '/dummy' })), e.provider.capabilities)));
|
|
33
33
|
}
|
|
34
34
|
dispose() {
|
|
35
35
|
this._disposables.dispose();
|
|
@@ -37,14 +37,14 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
37
37
|
this._watches.dispose();
|
|
38
38
|
}
|
|
39
39
|
async $registerFileSystemProvider(handle, scheme, capabilities, readonlyMessage) {
|
|
40
|
-
this._fileProvider.set(handle, (
|
|
40
|
+
this._fileProvider.set(handle, ( new RemoteFileSystemProvider(
|
|
41
41
|
this._fileService,
|
|
42
42
|
scheme,
|
|
43
43
|
capabilities,
|
|
44
44
|
readonlyMessage,
|
|
45
45
|
handle,
|
|
46
46
|
this._proxy
|
|
47
|
-
)))
|
|
47
|
+
)));
|
|
48
48
|
}
|
|
49
49
|
$unregisterProvider(handle) {
|
|
50
50
|
this._fileProvider.deleteAndDispose(handle);
|
|
@@ -70,11 +70,11 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
70
70
|
$readdir(uri) {
|
|
71
71
|
return this._fileService.resolve(URI.revive(uri), { resolveMetadata: false }).then(stat => {
|
|
72
72
|
if (!stat.isDirectory) {
|
|
73
|
-
const err = (
|
|
73
|
+
const err = ( new Error(stat.name));
|
|
74
74
|
err.name = FileSystemProviderErrorCode.FileNotADirectory;
|
|
75
75
|
throw err;
|
|
76
76
|
}
|
|
77
|
-
return !stat.children ? [] : (
|
|
77
|
+
return !stat.children ? [] : ( stat.children.map(child => [child.name, MainThreadFileSystem_1._asFileType(child)]));
|
|
78
78
|
}).catch(MainThreadFileSystem_1._handleError);
|
|
79
79
|
}
|
|
80
80
|
static _asFileType(stat) {
|
|
@@ -152,14 +152,14 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
catch (error) {
|
|
155
|
-
this._logService.error(`MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: ${extensionId}, path: ${(
|
|
155
|
+
this._logService.error(`MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session}): ${error}`);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
if (workspaceFolder && opts.recursive) {
|
|
159
|
-
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace (extension: ${extensionId}, path: ${(
|
|
159
|
+
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
this._logService.trace(`MainThreadFileSystem#$watch(): request to start watching (extension: ${extensionId}, path: ${(
|
|
162
|
+
this._logService.trace(`MainThreadFileSystem#$watch(): request to start watching (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
163
163
|
if (opts.recursive) {
|
|
164
164
|
const config = this._configurationService.getValue();
|
|
165
165
|
if (config.files?.watcherExclude) {
|
|
@@ -184,7 +184,7 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
if (!opts.includes || opts.includes.length === 0) {
|
|
187
|
-
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${extensionId}, path: ${(
|
|
187
|
+
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${extensionId}, path: ${( uri.toString(true))}, recursive: ${opts.recursive}, session: ${session})`);
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -192,7 +192,7 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
192
192
|
this._watches.set(session, subscription);
|
|
193
193
|
}
|
|
194
194
|
$unwatch(session) {
|
|
195
|
-
if ((
|
|
195
|
+
if (( this._watches.has(session))) {
|
|
196
196
|
this._logService.trace(`MainThreadFileSystem#$unwatch(): request to stop watching (session: ${session})`);
|
|
197
197
|
this._watches.deleteAndDispose(session);
|
|
198
198
|
}
|
|
@@ -200,17 +200,17 @@ let MainThreadFileSystem = MainThreadFileSystem_1 = class MainThreadFileSystem {
|
|
|
200
200
|
};
|
|
201
201
|
MainThreadFileSystem = MainThreadFileSystem_1 = __decorate([
|
|
202
202
|
extHostNamedCustomer(MainContext.MainThreadFileSystem),
|
|
203
|
-
(
|
|
204
|
-
(
|
|
205
|
-
(
|
|
206
|
-
(
|
|
203
|
+
( __param(1, IWorkbenchFileService)),
|
|
204
|
+
( __param(2, IWorkspaceContextService)),
|
|
205
|
+
( __param(3, ILogService)),
|
|
206
|
+
( __param(4, IConfigurationService))
|
|
207
207
|
], MainThreadFileSystem);
|
|
208
208
|
class RemoteFileSystemProvider {
|
|
209
209
|
constructor(fileService, scheme, capabilities, readOnlyMessage, _handle, _proxy) {
|
|
210
210
|
this.readOnlyMessage = readOnlyMessage;
|
|
211
211
|
this._handle = _handle;
|
|
212
212
|
this._proxy = _proxy;
|
|
213
|
-
this._onDidChange = (
|
|
213
|
+
this._onDidChange = ( new Emitter());
|
|
214
214
|
this.onDidChangeFile = this._onDidChange.event;
|
|
215
215
|
this.onDidChangeCapabilities = Event.None;
|
|
216
216
|
this.capabilities = capabilities;
|
|
@@ -228,7 +228,7 @@ class RemoteFileSystemProvider {
|
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
$onFileSystemChange(changes) {
|
|
231
|
-
this._onDidChange.fire((
|
|
231
|
+
this._onDidChange.fire(( changes.map(RemoteFileSystemProvider._createFileChange)));
|
|
232
232
|
}
|
|
233
233
|
static _createFileChange(dto) {
|
|
234
234
|
return { resource: URI.revive(dto.resource), type: dto.type };
|
|
@@ -13,22 +13,22 @@ import { SerializableObjectWithBuffers } from '../../services/extensions/common/
|
|
|
13
13
|
var MainThreadWebviews_1;
|
|
14
14
|
let MainThreadWebviews = class MainThreadWebviews extends Disposable {
|
|
15
15
|
static { MainThreadWebviews_1 = this; }
|
|
16
|
-
static { this.standardSupportedLinkSchemes = (
|
|
16
|
+
static { this.standardSupportedLinkSchemes = ( new Set([
|
|
17
17
|
Schemas.http,
|
|
18
18
|
Schemas.https,
|
|
19
19
|
Schemas.mailto,
|
|
20
20
|
Schemas.vscode,
|
|
21
21
|
'vscode-insider',
|
|
22
|
-
]))
|
|
22
|
+
])); }
|
|
23
23
|
constructor(context, _openerService, _productService) {
|
|
24
24
|
super();
|
|
25
25
|
this._openerService = _openerService;
|
|
26
26
|
this._productService = _productService;
|
|
27
|
-
this._webviews = (
|
|
28
|
-
this._proxy = (
|
|
27
|
+
this._webviews = ( new Map());
|
|
28
|
+
this._proxy = ( context.getProxy(ExtHostContext.ExtHostWebviews));
|
|
29
29
|
}
|
|
30
30
|
addWebview(handle, webview, options) {
|
|
31
|
-
if ((
|
|
31
|
+
if (( this._webviews.has(handle))) {
|
|
32
32
|
throw new Error('Webview already registered');
|
|
33
33
|
}
|
|
34
34
|
this._webviews.set(handle, webview);
|
|
@@ -52,11 +52,11 @@ let MainThreadWebviews = class MainThreadWebviews extends Disposable {
|
|
|
52
52
|
return webview.postMessage(message, arrayBuffers);
|
|
53
53
|
}
|
|
54
54
|
hookupWebviewEventDelegate(handle, webview, options) {
|
|
55
|
-
const disposables = (
|
|
55
|
+
const disposables = ( new DisposableStore());
|
|
56
56
|
disposables.add(webview.onDidClickLink((uri) => this.onDidClickLink(handle, uri)));
|
|
57
57
|
disposables.add(webview.onMessage((message) => {
|
|
58
58
|
const serialized = serializeWebviewMessage(message.message, options);
|
|
59
|
-
this._proxy.$onMessage(handle, serialized.message, (
|
|
59
|
+
this._proxy.$onMessage(handle, serialized.message, ( new SerializableObjectWithBuffers(serialized.buffers)));
|
|
60
60
|
}));
|
|
61
61
|
disposables.add(webview.onMissingCsp((extension) => this._proxy.$onMissingCsp(handle, extension.value)));
|
|
62
62
|
disposables.add(webview.onDidDispose(() => {
|
|
@@ -66,12 +66,12 @@ let MainThreadWebviews = class MainThreadWebviews extends Disposable {
|
|
|
66
66
|
}
|
|
67
67
|
onDidClickLink(handle, link) {
|
|
68
68
|
const webview = this.getWebview(handle);
|
|
69
|
-
if (this.isSupportedLink(webview, (
|
|
69
|
+
if (this.isSupportedLink(webview, ( URI.parse(link)))) {
|
|
70
70
|
this._openerService.open(link, { fromUserGesture: true, allowContributedOpeners: true, allowCommands: Array.isArray(webview.contentOptions.enableCommandUris) || webview.contentOptions.enableCommandUris === true, fromWorkspace: true });
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
isSupportedLink(webview, link) {
|
|
74
|
-
if ((
|
|
74
|
+
if (( MainThreadWebviews_1.standardSupportedLinkSchemes.has(link.scheme))) {
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
77
|
if (!isWeb && this._productService.urlProtocol === link.scheme) {
|
|
@@ -102,18 +102,18 @@ let MainThreadWebviews = class MainThreadWebviews extends Disposable {
|
|
|
102
102
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
103
103
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none';">
|
|
104
104
|
</head>
|
|
105
|
-
<body>${(
|
|
105
|
+
<body>${( localize(
|
|
106
106
|
'errorMessage',
|
|
107
107
|
"An error occurred while loading view: {0}",
|
|
108
108
|
escape(viewType)
|
|
109
|
-
))
|
|
109
|
+
))}</body>
|
|
110
110
|
</html>`;
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
MainThreadWebviews = MainThreadWebviews_1 = (
|
|
114
|
-
(
|
|
115
|
-
(
|
|
116
|
-
], MainThreadWebviews))
|
|
113
|
+
MainThreadWebviews = MainThreadWebviews_1 = ( __decorate([
|
|
114
|
+
( __param(1, IOpenerService)),
|
|
115
|
+
( __param(2, IProductService))
|
|
116
|
+
], MainThreadWebviews));
|
|
117
117
|
function reviveWebviewExtension(extensionData) {
|
|
118
118
|
return {
|
|
119
119
|
id: extensionData.id,
|
|
@@ -125,7 +125,7 @@ function reviveWebviewContentOptions(webviewOptions) {
|
|
|
125
125
|
allowScripts: webviewOptions.enableScripts,
|
|
126
126
|
allowForms: webviewOptions.enableForms,
|
|
127
127
|
enableCommandUris: webviewOptions.enableCommandUris,
|
|
128
|
-
localResourceRoots: Array.isArray(webviewOptions.localResourceRoots) ? (
|
|
128
|
+
localResourceRoots: Array.isArray(webviewOptions.localResourceRoots) ? ( webviewOptions.localResourceRoots.map(r => URI.revive(r))) : undefined,
|
|
129
129
|
portMapping: webviewOptions.portMapping,
|
|
130
130
|
};
|
|
131
131
|
}
|
|
@@ -25,17 +25,17 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
25
25
|
#telemetry;
|
|
26
26
|
#extHostTelemetry;
|
|
27
27
|
constructor(extHostRpc, logService, extHostTelemetry) {
|
|
28
|
-
this._commands = (
|
|
29
|
-
this._apiCommands = (
|
|
30
|
-
this.#proxy = (
|
|
28
|
+
this._commands = ( new Map());
|
|
29
|
+
this._apiCommands = ( new Map());
|
|
30
|
+
this.#proxy = ( extHostRpc.getProxy(MainContext.MainThreadCommands));
|
|
31
31
|
this._logService = logService;
|
|
32
32
|
this.#extHostTelemetry = extHostTelemetry;
|
|
33
|
-
this.#telemetry = (
|
|
34
|
-
this.converter = (
|
|
33
|
+
this.#telemetry = ( extHostRpc.getProxy(MainContext.MainThreadTelemetry));
|
|
34
|
+
this.converter = ( new CommandsConverter(this, id => {
|
|
35
35
|
const candidate = this._apiCommands.get(id);
|
|
36
36
|
return candidate?.result === ApiCommandResult.Void
|
|
37
37
|
? candidate : undefined;
|
|
38
|
-
}, logService))
|
|
38
|
+
}, logService));
|
|
39
39
|
this._argumentProcessors = [
|
|
40
40
|
{
|
|
41
41
|
processArgument(a) {
|
|
@@ -70,12 +70,12 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
70
70
|
}
|
|
71
71
|
registerApiCommand(apiCommand) {
|
|
72
72
|
const registration = this.registerCommand(false, apiCommand.id, async (...apiArgs) => {
|
|
73
|
-
const internalArgs = (
|
|
73
|
+
const internalArgs = ( apiCommand.args.map((arg, i) => {
|
|
74
74
|
if (!arg.validate(apiArgs[i])) {
|
|
75
75
|
throw new Error(`Invalid argument '${arg.name}' when running '${apiCommand.id}', received: ${typeof apiArgs[i] === 'object' ? JSON.stringify(apiArgs[i], null, '\t') : apiArgs[i]} `);
|
|
76
76
|
}
|
|
77
77
|
return arg.convert(apiArgs[i]);
|
|
78
|
-
}))
|
|
78
|
+
}));
|
|
79
79
|
const internalResult = await this.executeCommand(apiCommand.internalId, ...internalArgs);
|
|
80
80
|
return apiCommand.result.convert(internalResult, apiArgs, this.converter);
|
|
81
81
|
}, undefined, {
|
|
@@ -94,7 +94,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
94
94
|
if (!id.trim().length) {
|
|
95
95
|
throw new Error('invalid id');
|
|
96
96
|
}
|
|
97
|
-
if ((
|
|
97
|
+
if (( this._commands.has(id))) {
|
|
98
98
|
throw new Error(`command '${id}' already exists`);
|
|
99
99
|
}
|
|
100
100
|
this._commands.set(id, { callback, thisArg, description, extension });
|
|
@@ -114,7 +114,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
114
114
|
return this._doExecuteCommand(id, args, true);
|
|
115
115
|
}
|
|
116
116
|
async _doExecuteCommand(id, args, retry) {
|
|
117
|
-
if ((
|
|
117
|
+
if (( this._commands.has(id))) {
|
|
118
118
|
this.#proxy.$fireCommandActivationEvent(id);
|
|
119
119
|
return this._executeContributedCommand(id, args, false);
|
|
120
120
|
}
|
|
@@ -135,7 +135,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
135
135
|
}
|
|
136
136
|
else if (value instanceof ArrayBuffer) {
|
|
137
137
|
hasBuffers = true;
|
|
138
|
-
return VSBuffer.wrap((
|
|
138
|
+
return VSBuffer.wrap(( new Uint8Array(value)));
|
|
139
139
|
}
|
|
140
140
|
else if (value instanceof Uint8Array) {
|
|
141
141
|
hasBuffers = true;
|
|
@@ -150,7 +150,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
try {
|
|
153
|
-
const result = await this.#proxy.$executeCommand(id, hasBuffers ? (
|
|
153
|
+
const result = await this.#proxy.$executeCommand(id, hasBuffers ? ( new SerializableObjectWithBuffers(toArgs)) : toArgs, retry);
|
|
154
154
|
return revive(result);
|
|
155
155
|
}
|
|
156
156
|
catch (e) {
|
|
@@ -216,7 +216,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
216
216
|
}
|
|
217
217
|
this.#telemetry.$publicLog2('Extension:ActionExecuted', {
|
|
218
218
|
extensionId: command.extension.identifier.value,
|
|
219
|
-
id: (
|
|
219
|
+
id: ( new TelemetryTrustedValue(id)),
|
|
220
220
|
duration: duration,
|
|
221
221
|
});
|
|
222
222
|
}
|
|
@@ -224,12 +224,12 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
224
224
|
this._logService.trace('ExtHostCommands#$executeContributedCommand', id);
|
|
225
225
|
const cmdHandler = this._commands.get(id);
|
|
226
226
|
if (!cmdHandler) {
|
|
227
|
-
return Promise.reject((
|
|
227
|
+
return Promise.reject(( new Error(`Contributed command '${id}' does not exist.`)));
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
|
-
args = (
|
|
230
|
+
args = ( args.map(
|
|
231
231
|
arg => this._argumentProcessors.reduce((r, p) => p.processArgument(r, cmdHandler.extension?.identifier), arg)
|
|
232
|
-
))
|
|
232
|
+
));
|
|
233
233
|
return this._executeContributedCommand(id, args, true);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -253,19 +253,19 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
253
253
|
return Promise.resolve(result);
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
|
-
ExtHostCommands = (
|
|
257
|
-
(
|
|
258
|
-
(
|
|
259
|
-
(
|
|
260
|
-
], ExtHostCommands))
|
|
261
|
-
const IExtHostCommands = (
|
|
256
|
+
ExtHostCommands = ( __decorate([
|
|
257
|
+
( __param(0, IExtHostRpcService)),
|
|
258
|
+
( __param(1, ILogService)),
|
|
259
|
+
( __param(2, IExtHostTelemetry))
|
|
260
|
+
], ExtHostCommands));
|
|
261
|
+
const IExtHostCommands = ( createDecorator('IExtHostCommands'));
|
|
262
262
|
class CommandsConverter {
|
|
263
263
|
constructor(_commands, _lookupApiCommand, _logService) {
|
|
264
264
|
this._commands = _commands;
|
|
265
265
|
this._lookupApiCommand = _lookupApiCommand;
|
|
266
266
|
this._logService = _logService;
|
|
267
|
-
this.delegatingCommandId = `__vsc${(
|
|
268
|
-
this._cache = (
|
|
267
|
+
this.delegatingCommandId = `__vsc${( Date.now().toString(36))} `;
|
|
268
|
+
this._cache = ( new Map());
|
|
269
269
|
this._cachIdPool = 0;
|
|
270
270
|
this._commands.registerCommand(true, this.delegatingCommandId, this._executeConvertedCommand, this);
|
|
271
271
|
}
|
|
@@ -285,7 +285,7 @@ class CommandsConverter {
|
|
|
285
285
|
const apiCommand = this._lookupApiCommand(command.command);
|
|
286
286
|
if (apiCommand) {
|
|
287
287
|
result.id = apiCommand.internalId;
|
|
288
|
-
result.arguments = (
|
|
288
|
+
result.arguments = ( apiCommand.args.map((arg, i) => arg.convert(command.arguments && command.arguments[i])));
|
|
289
289
|
}
|
|
290
290
|
else if (isNonEmptyArray(command.arguments)) {
|
|
291
291
|
const id = `${command.command} /${++this._cachIdPool}`;
|
|
@@ -326,56 +326,54 @@ class CommandsConverter {
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
class ApiCommandArgument {
|
|
329
|
-
static { this.Uri = (
|
|
330
|
-
static { this.Position = (
|
|
329
|
+
static { this.Uri = ( new ApiCommandArgument('uri', 'Uri of a text document', v => URI.isUri(v), v => v)); }
|
|
330
|
+
static { this.Position = ( new ApiCommandArgument(
|
|
331
331
|
'position',
|
|
332
332
|
'A position in a text document',
|
|
333
333
|
v => Position.isPosition(v),
|
|
334
334
|
Position$1.from
|
|
335
|
-
))
|
|
336
|
-
static { this.Range = (
|
|
335
|
+
)); }
|
|
336
|
+
static { this.Range = ( new ApiCommandArgument(
|
|
337
337
|
'range',
|
|
338
338
|
'A range in a text document',
|
|
339
339
|
v => Range.isRange(v),
|
|
340
340
|
Range$1.from
|
|
341
|
-
))
|
|
342
|
-
static { this.Selection = (
|
|
341
|
+
)); }
|
|
342
|
+
static { this.Selection = ( new ApiCommandArgument(
|
|
343
343
|
'selection',
|
|
344
344
|
'A selection in a text document',
|
|
345
345
|
v => Selection.isSelection(v),
|
|
346
346
|
Selection$1.from
|
|
347
|
-
))
|
|
348
|
-
static { this.Number = (
|
|
349
|
-
static { this.String = (
|
|
347
|
+
)); }
|
|
348
|
+
static { this.Number = ( new ApiCommandArgument('number', '', v => typeof v === 'number', v => v)); }
|
|
349
|
+
static { this.String = ( new ApiCommandArgument('string', '', v => typeof v === 'string', v => v)); }
|
|
350
350
|
static { this.StringArray = ApiCommandArgument.Arr(ApiCommandArgument.String); }
|
|
351
351
|
static Arr(element) {
|
|
352
|
-
return (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
))
|
|
359
|
-
);
|
|
352
|
+
return ( new ApiCommandArgument(
|
|
353
|
+
`${element.name}_array`,
|
|
354
|
+
`Array of ${element.name}, ${element.description}`,
|
|
355
|
+
(v) => Array.isArray(v) && v.every(e => element.validate(e)),
|
|
356
|
+
(v) => ( v.map(e => element.convert(e)))
|
|
357
|
+
));
|
|
360
358
|
}
|
|
361
|
-
static { this.CallHierarchyItem = (
|
|
359
|
+
static { this.CallHierarchyItem = ( new ApiCommandArgument(
|
|
362
360
|
'item',
|
|
363
361
|
'A call hierarchy item',
|
|
364
362
|
v => v instanceof CallHierarchyItem,
|
|
365
363
|
CallHierarchyItem$1.from
|
|
366
|
-
))
|
|
367
|
-
static { this.TypeHierarchyItem = (
|
|
364
|
+
)); }
|
|
365
|
+
static { this.TypeHierarchyItem = ( new ApiCommandArgument(
|
|
368
366
|
'item',
|
|
369
367
|
'A type hierarchy item',
|
|
370
368
|
v => v instanceof TypeHierarchyItem,
|
|
371
369
|
TypeHierarchyItem$1.from
|
|
372
|
-
))
|
|
373
|
-
static { this.TestItem = (
|
|
370
|
+
)); }
|
|
371
|
+
static { this.TestItem = ( new ApiCommandArgument(
|
|
374
372
|
'testItem',
|
|
375
373
|
'A VS Code TestItem',
|
|
376
374
|
v => v instanceof TestItemImpl,
|
|
377
375
|
TestItem.from
|
|
378
|
-
))
|
|
376
|
+
)); }
|
|
379
377
|
constructor(name, description, validate, convert) {
|
|
380
378
|
this.name = name;
|
|
381
379
|
this.description = description;
|
|
@@ -383,28 +381,24 @@ class ApiCommandArgument {
|
|
|
383
381
|
this.convert = convert;
|
|
384
382
|
}
|
|
385
383
|
optional() {
|
|
386
|
-
return (
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
))
|
|
393
|
-
);
|
|
384
|
+
return ( new ApiCommandArgument(
|
|
385
|
+
this.name,
|
|
386
|
+
`(optional) ${this.description}`,
|
|
387
|
+
value => value === undefined || value === null || this.validate(value),
|
|
388
|
+
value => value === undefined ? undefined : value === null ? null : this.convert(value)
|
|
389
|
+
));
|
|
394
390
|
}
|
|
395
391
|
with(name, description) {
|
|
396
|
-
return (
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
))
|
|
403
|
-
);
|
|
392
|
+
return ( new ApiCommandArgument(
|
|
393
|
+
name ?? this.name,
|
|
394
|
+
description ?? this.description,
|
|
395
|
+
this.validate,
|
|
396
|
+
this.convert
|
|
397
|
+
));
|
|
404
398
|
}
|
|
405
399
|
}
|
|
406
400
|
class ApiCommandResult {
|
|
407
|
-
static { this.Void = (
|
|
401
|
+
static { this.Void = ( new ApiCommandResult('no result', v => v)); }
|
|
408
402
|
constructor(description, convert) {
|
|
409
403
|
this.description = description;
|
|
410
404
|
this.convert = convert;
|
|
@@ -5,7 +5,7 @@ import { IExtHostInitDataService } from './extHostInitDataService.js';
|
|
|
5
5
|
import { IExtHostRpcService } from './extHostRpcService.js';
|
|
6
6
|
let AbstractExtHostConsoleForwarder = class AbstractExtHostConsoleForwarder {
|
|
7
7
|
constructor(extHostRpc, initData) {
|
|
8
|
-
this._mainThreadConsole = (
|
|
8
|
+
this._mainThreadConsole = ( extHostRpc.getProxy(MainContext.MainThreadConsole));
|
|
9
9
|
this._includeStack = initData.consoleForward.includeStack;
|
|
10
10
|
this._logNative = initData.consoleForward.logNative;
|
|
11
11
|
this._wrapConsoleMethod('info', 'log');
|
|
@@ -34,10 +34,10 @@ let AbstractExtHostConsoleForwarder = class AbstractExtHostConsoleForwarder {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
AbstractExtHostConsoleForwarder = (
|
|
38
|
-
(
|
|
39
|
-
(
|
|
40
|
-
], AbstractExtHostConsoleForwarder))
|
|
37
|
+
AbstractExtHostConsoleForwarder = ( __decorate([
|
|
38
|
+
( __param(0, IExtHostRpcService)),
|
|
39
|
+
( __param(1, IExtHostInitDataService))
|
|
40
|
+
], AbstractExtHostConsoleForwarder));
|
|
41
41
|
const MAX_LENGTH = 100000;
|
|
42
42
|
function safeStringifyArgumentsToArray(args, includeStack) {
|
|
43
43
|
const argsArray = [];
|
|
@@ -53,14 +53,14 @@ function safeStringifyArgumentsToArray(args, includeStack) {
|
|
|
53
53
|
arg = errorObj.stack;
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
arg = (
|
|
56
|
+
arg = ( errorObj.toString());
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
argsArray.push(arg);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
if (includeStack) {
|
|
63
|
-
const stack = (
|
|
63
|
+
const stack = ( new Error()).stack;
|
|
64
64
|
if (stack) {
|
|
65
65
|
argsArray.push({ __$stack: stack.split('\n').slice(3).join('\n') });
|
|
66
66
|
}
|
|
@@ -73,7 +73,7 @@ function safeStringifyArgumentsToArray(args, includeStack) {
|
|
|
73
73
|
return res;
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
76
|
-
return `Output omitted for an object that cannot be inspected ('${(
|
|
76
|
+
return `Output omitted for an object that cannot be inspected ('${( error.toString())}')`;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
export { AbstractExtHostConsoleForwarder };
|