@theia/plugin-ext-vscode 1.77.0-next.99 → 1.77.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/lib/browser/plugin-vscode-commands-contribution.js +209 -236
- package/lib/browser/plugin-vscode-commands-contribution.js.map +1 -1
- package/lib/browser/plugin-vscode-commands-contribution.spec.js +61 -64
- package/lib/browser/plugin-vscode-commands-contribution.spec.js.map +1 -1
- package/lib/browser/plugin-vscode-contribution.js +11 -14
- package/lib/browser/plugin-vscode-contribution.js.map +1 -1
- package/lib/browser/plugin-vscode-frontend-module.js +12 -14
- package/lib/browser/plugin-vscode-frontend-module.js.map +1 -1
- package/lib/common/plugin-vscode-environment.js +12 -16
- package/lib/common/plugin-vscode-environment.js.map +1 -1
- package/lib/common/plugin-vscode-types.d.ts +1 -1
- package/lib/common/plugin-vscode-types.js +3 -6
- package/lib/common/plugin-vscode-types.js.map +1 -1
- package/lib/common/plugin-vscode-uri.js +5 -9
- package/lib/common/plugin-vscode-uri.js.map +1 -1
- package/lib/node/context/plugin-vscode-init-fe.d.ts +1 -2
- package/lib/node/context/plugin-vscode-init-fe.d.ts.map +1 -1
- package/lib/node/context/plugin-vscode-init-fe.js +3 -2
- package/lib/node/context/plugin-vscode-init-fe.js.map +1 -1
- package/lib/node/local-vsix-file-plugin-deployer-resolver.d.ts +3 -1
- package/lib/node/local-vsix-file-plugin-deployer-resolver.d.ts.map +1 -1
- package/lib/node/local-vsix-file-plugin-deployer-resolver.js +31 -32
- package/lib/node/local-vsix-file-plugin-deployer-resolver.js.map +1 -1
- package/lib/node/package.spec.d.ts +1 -0
- package/lib/node/package.spec.js +1 -1
- package/lib/node/package.spec.js.map +1 -1
- package/lib/node/plugin-vscode-backend-module.js +22 -24
- package/lib/node/plugin-vscode-backend-module.js.map +1 -1
- package/lib/node/plugin-vscode-cli-contribution.js +10 -13
- package/lib/node/plugin-vscode-cli-contribution.js.map +1 -1
- package/lib/node/plugin-vscode-deployer-participant.d.ts +1 -1
- package/lib/node/plugin-vscode-deployer-participant.d.ts.map +1 -1
- package/lib/node/plugin-vscode-deployer-participant.js +17 -22
- package/lib/node/plugin-vscode-deployer-participant.js.map +1 -1
- package/lib/node/plugin-vscode-directory-handler.js +23 -28
- package/lib/node/plugin-vscode-directory-handler.js.map +1 -1
- package/lib/node/plugin-vscode-file-handler.d.ts +3 -1
- package/lib/node/plugin-vscode-file-handler.d.ts.map +1 -1
- package/lib/node/plugin-vscode-file-handler.js +26 -28
- package/lib/node/plugin-vscode-file-handler.js.map +1 -1
- package/lib/node/plugin-vscode-init.d.ts.map +1 -1
- package/lib/node/plugin-vscode-init.js +12 -16
- package/lib/node/plugin-vscode-init.js.map +1 -1
- package/lib/node/plugin-vscode-init.spec.js +8 -11
- package/lib/node/plugin-vscode-init.spec.js.map +1 -1
- package/lib/node/plugin-vscode-utils.d.ts +6 -4
- package/lib/node/plugin-vscode-utils.d.ts.map +1 -1
- package/lib/node/plugin-vscode-utils.js +24 -32
- package/lib/node/plugin-vscode-utils.js.map +1 -1
- package/lib/node/plugin-vscode-utils.spec.d.ts +2 -0
- package/lib/node/plugin-vscode-utils.spec.d.ts.map +1 -0
- package/lib/node/plugin-vscode-utils.spec.js +151 -0
- package/lib/node/plugin-vscode-utils.spec.js.map +1 -0
- package/lib/node/scanner-vscode.js +19 -22
- package/lib/node/scanner-vscode.js.map +1 -1
- package/lib/node/scanner-vscode.spec.js +12 -15
- package/lib/node/scanner-vscode.spec.js.map +1 -1
- package/package.json +26 -19
- package/src/browser/plugin-vscode-commands-contribution.spec.ts +2 -2
- package/src/browser/plugin-vscode-commands-contribution.ts +1 -1
- package/src/browser/plugin-vscode-frontend-module.ts +3 -3
- package/src/node/context/plugin-vscode-init-fe.ts +2 -1
- package/src/node/local-vsix-file-plugin-deployer-resolver.ts +10 -6
- package/src/node/plugin-vscode-backend-module.ts +7 -7
- package/src/node/plugin-vscode-cli-contribution.ts +1 -1
- package/src/node/plugin-vscode-deployer-participant.ts +2 -2
- package/src/node/plugin-vscode-directory-handler.ts +1 -1
- package/src/node/plugin-vscode-file-handler.ts +7 -3
- package/src/node/plugin-vscode-init.spec.ts +1 -1
- package/src/node/plugin-vscode-init.ts +4 -3
- package/src/node/plugin-vscode-utils.spec.ts +170 -0
- package/src/node/plugin-vscode-utils.ts +26 -11
- package/src/node/scanner-vscode.spec.ts +1 -1
- package/src/node/scanner-vscode.ts +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
4
3
|
//
|
|
@@ -14,57 +13,55 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const merge_editor_1 = require("@theia/scm/lib/browser/merge-editor/merge-editor");
|
|
57
|
-
const multi_diff_editor_1 = require("@theia/scm/lib/browser/multi-diff-editor/multi-diff-editor");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { environment, isOSX, CancellationTokenSource, MessageService, isArray, ILogger, MEMORY_TEXT_READONLY } from '@theia/core';
|
|
18
|
+
import { ApplicationShell, CommonCommands, NavigatableWidget, open, OpenerService, QuickInputService, Saveable } from '@theia/core/lib/browser';
|
|
19
|
+
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
20
|
+
import { ApplicationShellMouseTracker } from '@theia/core/lib/browser/shell/application-shell-mouse-tracker';
|
|
21
|
+
import { CommandService } from '@theia/core/lib/common/command';
|
|
22
|
+
import TheiaURI from '@theia/core/lib/common/uri';
|
|
23
|
+
import { EditorManager, EditorCommands } from '@theia/editor/lib/browser';
|
|
24
|
+
import { DocumentsMainImpl } from '@theia/plugin-ext/lib/main/browser/documents-main';
|
|
25
|
+
import { isUriComponents, toMergedSymbol, toPosition } from '@theia/plugin-ext/lib/plugin/type-converters';
|
|
26
|
+
import { WorkspaceCommands } from '@theia/workspace/lib/browser';
|
|
27
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
28
|
+
import { DiffService } from '@theia/workspace/lib/browser/diff-service';
|
|
29
|
+
import { inject, injectable, optional, named } from '@theia/core/shared/inversify';
|
|
30
|
+
import { URI } from '@theia/core/shared/vscode-uri';
|
|
31
|
+
import { DuplicateExtensionError, PluginIdentifiers, PluginServer } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
32
|
+
import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
|
33
|
+
import { QuickOpenWorkspace } from '@theia/workspace/lib/browser/quick-open-workspace';
|
|
34
|
+
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
35
|
+
import { FileNavigatorCommands, FILE_NAVIGATOR_TOGGLE_COMMAND_ID } from '@theia/navigator/lib/browser/navigator-contribution';
|
|
36
|
+
import { FILE_NAVIGATOR_ID, FileNavigatorWidget } from '@theia/navigator/lib/browser';
|
|
37
|
+
import { SelectableTreeNode } from '@theia/core/lib/browser/tree/tree-selection';
|
|
38
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
39
|
+
import { CallHierarchyServiceProvider } from '@theia/callhierarchy/lib/browser';
|
|
40
|
+
import { TypeHierarchyServiceProvider } from '@theia/typehierarchy/lib/browser';
|
|
41
|
+
import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
|
|
42
|
+
import { fromCallHierarchyCalleeToModelCallHierarchyOutgoingCall, fromCallHierarchyCallerToModelCallHierarchyIncomingCall, fromItemHierarchyDefinition, toItemHierarchyDefinition } from '@theia/plugin-ext/lib/main/browser/hierarchy/hierarchy-types-converters';
|
|
43
|
+
import { CustomEditorOpener } from '@theia/plugin-ext/lib/main/browser/custom-editors/custom-editor-opener';
|
|
44
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
45
|
+
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
|
46
|
+
import * as monaco from '@theia/monaco-editor-core';
|
|
47
|
+
import { VSCodeExtensionUri } from '../common/plugin-vscode-uri.js';
|
|
48
|
+
import { CodeEditorWidgetUtil } from '@theia/plugin-ext/lib/main/browser/menus/vscode-theia-menu-mappings';
|
|
49
|
+
import { OutlineViewContribution } from '@theia/outline-view/lib/browser/outline-view-contribution';
|
|
50
|
+
import { MonacoLanguages } from '@theia/monaco/lib/browser/monaco-languages';
|
|
51
|
+
import { ScmContribution } from '@theia/scm/lib/browser/scm-contribution';
|
|
52
|
+
import { ScmService } from '@theia/scm/lib/browser/scm-service';
|
|
53
|
+
import { MergeEditorUri } from '@theia/scm/lib/browser/merge-editor/merge-editor';
|
|
54
|
+
import { MultiDiffEditorUri } from '@theia/scm/lib/browser/multi-diff-editor/multi-diff-editor';
|
|
58
55
|
function toTheiaUri(value) {
|
|
59
56
|
if (value === undefined) {
|
|
60
57
|
return undefined;
|
|
61
58
|
}
|
|
62
59
|
if (typeof value === 'string') {
|
|
63
|
-
return new
|
|
60
|
+
return new TheiaURI(value);
|
|
64
61
|
}
|
|
65
|
-
return
|
|
62
|
+
return TheiaURI.fromComponents(value);
|
|
66
63
|
}
|
|
67
|
-
var VscodeCommands;
|
|
64
|
+
export var VscodeCommands;
|
|
68
65
|
(function (VscodeCommands) {
|
|
69
66
|
VscodeCommands.GET_CODE_EXCHANGE_ENDPOINTS = {
|
|
70
67
|
id: 'workbench.getCodeExchangeProxyEndpoints' // this command is used in the github auth built-in
|
|
@@ -92,7 +89,7 @@ var VscodeCommands;
|
|
|
92
89
|
VscodeCommands.INSTALL_EXTENSION_FROM_VSIX_COMMAND = {
|
|
93
90
|
id: 'workbench.extensions.command.installFromVSIX'
|
|
94
91
|
};
|
|
95
|
-
})(VscodeCommands || (
|
|
92
|
+
})(VscodeCommands || (VscodeCommands = {}));
|
|
96
93
|
function isInDirection(source, candidate, direction) {
|
|
97
94
|
const sourceCenter = rectCenter(source);
|
|
98
95
|
const candidateCenter = rectCenter(candidate);
|
|
@@ -155,7 +152,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
155
152
|
if (!resource) {
|
|
156
153
|
throw new Error(`${commandId} command requires at least URI argument.`);
|
|
157
154
|
}
|
|
158
|
-
if (!
|
|
155
|
+
if (!URI.isUri(resource)) {
|
|
159
156
|
throw new Error(`Invalid argument for ${commandId} command with URI argument. Found ${resource}`);
|
|
160
157
|
}
|
|
161
158
|
let options;
|
|
@@ -169,8 +166,8 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
169
166
|
...columnOrOptions
|
|
170
167
|
};
|
|
171
168
|
}
|
|
172
|
-
const uri = new
|
|
173
|
-
const editorOptions =
|
|
169
|
+
const uri = new TheiaURI(resource);
|
|
170
|
+
const editorOptions = DocumentsMainImpl.toEditorOpenerOptions(this.shell, options);
|
|
174
171
|
let openHandler;
|
|
175
172
|
if (typeof openerId === 'string') {
|
|
176
173
|
const lowerViewType = openerId.toLowerCase();
|
|
@@ -292,14 +289,14 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
292
289
|
isVisible: () => false,
|
|
293
290
|
execute: async (resource, columnOrOptions) => {
|
|
294
291
|
if (typeof resource === 'string') {
|
|
295
|
-
resource =
|
|
292
|
+
resource = URI.parse(resource);
|
|
296
293
|
}
|
|
297
294
|
try {
|
|
298
295
|
await this.openWith(VscodeCommands.OPEN.id, resource, columnOrOptions);
|
|
299
296
|
}
|
|
300
297
|
catch (error) {
|
|
301
|
-
const message =
|
|
302
|
-
const reason =
|
|
298
|
+
const message = nls.localizeByDefault("Unable to open '{0}'", resource.path);
|
|
299
|
+
const reason = nls.localizeByDefault('Error: {0}', error.message);
|
|
303
300
|
this.messageService.error(`${message}\n${reason}`);
|
|
304
301
|
this.logger.warn(error);
|
|
305
302
|
}
|
|
@@ -316,7 +313,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
316
313
|
}
|
|
317
314
|
let result = await this.openWith(VscodeCommands.OPEN_WITH.id, resource, columnOrOptions, viewType);
|
|
318
315
|
if (!result) {
|
|
319
|
-
result = await this.openWith(VscodeCommands.OPEN_WITH.id, resource, columnOrOptions,
|
|
316
|
+
result = await this.openWith(VscodeCommands.OPEN_WITH.id, resource, columnOrOptions, CustomEditorOpener.toCustomEditorId(viewType));
|
|
320
317
|
}
|
|
321
318
|
if (!result) {
|
|
322
319
|
throw new Error(`Could not find an editor for '${viewType}'`);
|
|
@@ -327,9 +324,9 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
327
324
|
isVisible: () => false,
|
|
328
325
|
execute: async (resource, arg = {}) => {
|
|
329
326
|
if (!resource) {
|
|
330
|
-
return commands.executeCommand(
|
|
327
|
+
return commands.executeCommand(WorkspaceCommands.OPEN_WORKSPACE.id);
|
|
331
328
|
}
|
|
332
|
-
if (!
|
|
329
|
+
if (!URI.isUri(resource)) {
|
|
333
330
|
throw new Error(`Invalid argument for ${VscodeCommands.OPEN_FOLDER.id} command with URI argument. Found ${resource}`);
|
|
334
331
|
}
|
|
335
332
|
let options;
|
|
@@ -339,7 +336,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
339
336
|
else {
|
|
340
337
|
options = { preserveWindow: !arg.forceNewWindow };
|
|
341
338
|
}
|
|
342
|
-
this.workspaceService.open(new
|
|
339
|
+
this.workspaceService.open(new TheiaURI(resource), options);
|
|
343
340
|
}
|
|
344
341
|
});
|
|
345
342
|
commands.registerCommand(VscodeCommands.DIFF, {
|
|
@@ -349,15 +346,15 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
349
346
|
if (!left || !right) {
|
|
350
347
|
throw new Error(`${VscodeCommands.DIFF} command requires at least two URI arguments. Found left=${left}, right=${right} as arguments`);
|
|
351
348
|
}
|
|
352
|
-
if (!
|
|
349
|
+
if (!URI.isUri(left)) {
|
|
353
350
|
throw new Error(`Invalid argument for ${VscodeCommands.DIFF.id} command with left argument. Expecting URI left type but found ${left}`);
|
|
354
351
|
}
|
|
355
|
-
if (!
|
|
352
|
+
if (!URI.isUri(right)) {
|
|
356
353
|
throw new Error(`Invalid argument for ${VscodeCommands.DIFF.id} command with right argument. Expecting URI right type but found ${right}`);
|
|
357
354
|
}
|
|
358
|
-
const leftURI = new
|
|
359
|
-
const editorOptions =
|
|
360
|
-
await this.diffService.openDiffEditor(leftURI, new
|
|
355
|
+
const leftURI = new TheiaURI(left);
|
|
356
|
+
const editorOptions = DocumentsMainImpl.toEditorOpenerOptions(this.shell, options);
|
|
357
|
+
await this.diffService.openDiffEditor(leftURI, new TheiaURI(right), label, editorOptions);
|
|
361
358
|
}
|
|
362
359
|
});
|
|
363
360
|
// https://code.visualstudio.com/docs/getstarted/keybindings#_navigation
|
|
@@ -369,47 +366,47 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
369
366
|
* because of it we filter out editors from views based on `NavigatableWidget.is`
|
|
370
367
|
* and apply actions only to them
|
|
371
368
|
*/
|
|
372
|
-
if (!
|
|
369
|
+
if (!environment.electron.is() || isOSX) {
|
|
373
370
|
commands.registerCommand({ id: 'workbench.action.files.openFileFolder' }, {
|
|
374
|
-
execute: () => commands.executeCommand(
|
|
371
|
+
execute: () => commands.executeCommand(WorkspaceCommands.OPEN.id)
|
|
375
372
|
});
|
|
376
|
-
commands.registerAlias('workbench.action.files.openFileFolder',
|
|
373
|
+
commands.registerAlias('workbench.action.files.openFileFolder', WorkspaceCommands.OPEN.id);
|
|
377
374
|
}
|
|
378
375
|
commands.registerCommand({ id: 'workbench.action.files.openFile' }, {
|
|
379
|
-
execute: () => commands.executeCommand(
|
|
376
|
+
execute: () => commands.executeCommand(WorkspaceCommands.OPEN_FILE.id)
|
|
380
377
|
});
|
|
381
|
-
commands.registerAlias('workbench.action.files.openFile',
|
|
378
|
+
commands.registerAlias('workbench.action.files.openFile', WorkspaceCommands.OPEN_FILE.id);
|
|
382
379
|
commands.registerCommand({ id: 'workbench.action.files.openFolder' }, {
|
|
383
|
-
execute: () => commands.executeCommand(
|
|
380
|
+
execute: () => commands.executeCommand(WorkspaceCommands.OPEN_FOLDER.id)
|
|
384
381
|
});
|
|
385
|
-
commands.registerAlias('workbench.action.files.openFolder',
|
|
382
|
+
commands.registerAlias('workbench.action.files.openFolder', WorkspaceCommands.OPEN_FOLDER.id);
|
|
386
383
|
commands.registerCommand({ id: 'workbench.action.addRootFolder' }, {
|
|
387
|
-
execute: () => commands.executeCommand(
|
|
384
|
+
execute: () => commands.executeCommand(WorkspaceCommands.ADD_FOLDER.id)
|
|
388
385
|
});
|
|
389
|
-
commands.registerAlias('workbench.action.addRootFolder',
|
|
386
|
+
commands.registerAlias('workbench.action.addRootFolder', WorkspaceCommands.ADD_FOLDER.id);
|
|
390
387
|
commands.registerCommand({ id: 'workbench.action.saveWorkspaceAs' }, {
|
|
391
|
-
execute: () => commands.executeCommand(
|
|
388
|
+
execute: () => commands.executeCommand(WorkspaceCommands.SAVE_WORKSPACE_AS.id)
|
|
392
389
|
});
|
|
393
|
-
commands.registerAlias('workbench.action.saveWorkspaceAs',
|
|
390
|
+
commands.registerAlias('workbench.action.saveWorkspaceAs', WorkspaceCommands.SAVE_WORKSPACE_AS.id);
|
|
394
391
|
commands.registerCommand({ id: 'workbench.action.gotoLine' }, {
|
|
395
|
-
execute: () => commands.executeCommand(
|
|
392
|
+
execute: () => commands.executeCommand(EditorCommands.GOTO_LINE_COLUMN.id)
|
|
396
393
|
});
|
|
397
|
-
commands.registerAlias('workbench.action.gotoLine',
|
|
394
|
+
commands.registerAlias('workbench.action.gotoLine', EditorCommands.GOTO_LINE_COLUMN.id);
|
|
398
395
|
commands.registerCommand({ id: 'workbench.action.quickOpen' }, {
|
|
399
396
|
execute: (prefix) => this.quickInput.open(typeof prefix === 'string' ? prefix : '')
|
|
400
397
|
});
|
|
401
398
|
commands.registerCommand({ id: 'workbench.action.openSettings' }, {
|
|
402
|
-
execute: (query) => commands.executeCommand(
|
|
399
|
+
execute: (query) => commands.executeCommand(CommonCommands.OPEN_PREFERENCES.id, query)
|
|
403
400
|
});
|
|
404
|
-
commands.registerAlias('workbench.action.openSettings',
|
|
401
|
+
commands.registerAlias('workbench.action.openSettings', CommonCommands.OPEN_PREFERENCES.id);
|
|
405
402
|
commands.registerCommand({ id: 'workbench.action.openWorkspaceConfigFile' }, {
|
|
406
|
-
execute: () => commands.executeCommand(
|
|
403
|
+
execute: () => commands.executeCommand(WorkspaceCommands.OPEN_WORKSPACE_FILE.id)
|
|
407
404
|
});
|
|
408
|
-
commands.registerAlias('workbench.action.openWorkspaceConfigFile',
|
|
405
|
+
commands.registerAlias('workbench.action.openWorkspaceConfigFile', WorkspaceCommands.OPEN_WORKSPACE_FILE.id);
|
|
409
406
|
commands.registerCommand({ id: 'workbench.files.action.refreshFilesExplorer' }, {
|
|
410
|
-
execute: () => commands.executeCommand(
|
|
407
|
+
execute: () => commands.executeCommand(FileNavigatorCommands.REFRESH_NAVIGATOR.id)
|
|
411
408
|
});
|
|
412
|
-
commands.registerAlias('workbench.files.action.refreshFilesExplorer',
|
|
409
|
+
commands.registerAlias('workbench.files.action.refreshFilesExplorer', FileNavigatorCommands.REFRESH_NAVIGATOR.id);
|
|
413
410
|
commands.registerCommand(VscodeCommands.INSTALL_EXTENSION_FROM_ID_OR_URI, {
|
|
414
411
|
execute: async (vsixUriOrExtensionId) => {
|
|
415
412
|
if (typeof vsixUriOrExtensionId === 'string') {
|
|
@@ -422,7 +419,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
422
419
|
});
|
|
423
420
|
commands.registerCommand(VscodeCommands.INSTALL_EXTENSION_FROM_VSIX_COMMAND, {
|
|
424
421
|
execute: async (uris) => {
|
|
425
|
-
if (
|
|
422
|
+
if (isArray(uris)) {
|
|
426
423
|
await Promise.all(uris.map(async (vsix) => {
|
|
427
424
|
await this.deployPlugin(vsix);
|
|
428
425
|
}));
|
|
@@ -435,13 +432,13 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
435
432
|
commands.registerCommand(VscodeCommands.UNINSTALL_EXTENSION, {
|
|
436
433
|
execute: async (id) => {
|
|
437
434
|
if (!id) {
|
|
438
|
-
throw new Error(
|
|
435
|
+
throw new Error(nls.localizeByDefault('Extension id required.'));
|
|
439
436
|
}
|
|
440
|
-
const idAndVersion =
|
|
437
|
+
const idAndVersion = PluginIdentifiers.idAndVersionFromVersionedId(id);
|
|
441
438
|
if (!idAndVersion) {
|
|
442
439
|
throw new Error(`Invalid extension id: ${id}\nExpected format: <publisher>.<name>@<version>.`);
|
|
443
440
|
}
|
|
444
|
-
await this.pluginServer.uninstall(
|
|
441
|
+
await this.pluginServer.uninstall(PluginIdentifiers.idAndVersionToVersionedId(idAndVersion));
|
|
445
442
|
}
|
|
446
443
|
});
|
|
447
444
|
commands.registerCommand({ id: 'workbench.action.files.save', }, {
|
|
@@ -449,11 +446,11 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
449
446
|
if (uri) {
|
|
450
447
|
const uriString = uri.toString();
|
|
451
448
|
const widget = this.shell.widgets.find(w => {
|
|
452
|
-
const resourceUri =
|
|
449
|
+
const resourceUri = Saveable.is(w) && NavigatableWidget.is(w) && w.getResourceUri();
|
|
453
450
|
return (resourceUri && resourceUri.toString()) === uriString;
|
|
454
451
|
});
|
|
455
|
-
if (
|
|
456
|
-
|
|
452
|
+
if (Saveable.is(widget)) {
|
|
453
|
+
Saveable.save(widget);
|
|
457
454
|
}
|
|
458
455
|
}
|
|
459
456
|
else {
|
|
@@ -465,9 +462,9 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
465
462
|
execute: () => this.shell.saveAll()
|
|
466
463
|
});
|
|
467
464
|
commands.registerCommand({ id: 'workbench.action.closeActiveEditor' }, {
|
|
468
|
-
execute: () => commands.executeCommand(
|
|
465
|
+
execute: () => commands.executeCommand(CommonCommands.CLOSE_MAIN_TAB.id)
|
|
469
466
|
});
|
|
470
|
-
commands.registerAlias('workbench.action.closeActiveEditor',
|
|
467
|
+
commands.registerAlias('workbench.action.closeActiveEditor', CommonCommands.CLOSE_MAIN_TAB.id);
|
|
471
468
|
commands.registerCommand({ id: 'workbench.action.closeOtherEditors' }, {
|
|
472
469
|
execute: async (uri) => {
|
|
473
470
|
let editor = this.editorManager.currentEditor || this.shell.currentWidget;
|
|
@@ -478,7 +475,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
478
475
|
return (resourceUri && resourceUri.toString()) === uriString;
|
|
479
476
|
});
|
|
480
477
|
}
|
|
481
|
-
const toClose = this.shell.widgets.filter(widget => widget !== editor &&
|
|
478
|
+
const toClose = this.shell.widgets.filter(widget => widget !== editor && CodeEditorWidgetUtil.is(widget) && widget.title.closable);
|
|
482
479
|
await this.shell.closeMany(toClose);
|
|
483
480
|
}
|
|
484
481
|
});
|
|
@@ -494,19 +491,19 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
494
491
|
if (editor) {
|
|
495
492
|
const tabBar = this.shell.getTabBarFor(editor);
|
|
496
493
|
if (tabBar) {
|
|
497
|
-
cb(tabBar, ({ owner }) =>
|
|
494
|
+
cb(tabBar, ({ owner }) => CodeEditorWidgetUtil.is(owner));
|
|
498
495
|
}
|
|
499
496
|
}
|
|
500
497
|
};
|
|
501
498
|
commands.registerCommand({
|
|
502
499
|
id: 'workbench.action.closeEditorsInGroup',
|
|
503
|
-
label:
|
|
500
|
+
label: nls.localizeByDefault('Close All Editors in Group')
|
|
504
501
|
}, {
|
|
505
502
|
execute: (uri) => performActionOnGroup((tabBar, filter) => this.shell.closeTabs(tabBar, (title, index) => title.closable && filter(title, index)), uri)
|
|
506
503
|
});
|
|
507
504
|
commands.registerCommand({
|
|
508
505
|
id: 'workbench.files.saveAllInGroup',
|
|
509
|
-
label:
|
|
506
|
+
label: nls.localizeByDefault('Save All in Group')
|
|
510
507
|
}, {
|
|
511
508
|
execute: (uri) => performActionOnGroup((tabBar, filter) => this.shell.saveTabs(tabBar, filter), uri)
|
|
512
509
|
});
|
|
@@ -517,7 +514,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
517
514
|
const editorTabBar = this.shell.getTabBarFor(editor);
|
|
518
515
|
for (const tabBar of this.shell.allTabBars) {
|
|
519
516
|
if (tabBar !== editorTabBar) {
|
|
520
|
-
this.shell.closeTabs(tabBar, ({ owner, closable }) => closable &&
|
|
517
|
+
this.shell.closeTabs(tabBar, ({ owner, closable }) => closable && CodeEditorWidgetUtil.is(owner));
|
|
521
518
|
}
|
|
522
519
|
}
|
|
523
520
|
}
|
|
@@ -535,7 +532,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
535
532
|
left = false;
|
|
536
533
|
return false;
|
|
537
534
|
}
|
|
538
|
-
return left && closable &&
|
|
535
|
+
return left && closable && CodeEditorWidgetUtil.is(owner);
|
|
539
536
|
});
|
|
540
537
|
}
|
|
541
538
|
}
|
|
@@ -553,7 +550,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
553
550
|
left = false;
|
|
554
551
|
return false;
|
|
555
552
|
}
|
|
556
|
-
return !left && closable &&
|
|
553
|
+
return !left && closable && CodeEditorWidgetUtil.is(owner);
|
|
557
554
|
});
|
|
558
555
|
}
|
|
559
556
|
}
|
|
@@ -561,7 +558,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
561
558
|
});
|
|
562
559
|
commands.registerCommand({ id: 'workbench.action.closeAllEditors' }, {
|
|
563
560
|
execute: async () => {
|
|
564
|
-
const toClose = this.shell.widgets.filter(widget =>
|
|
561
|
+
const toClose = this.shell.widgets.filter(widget => CodeEditorWidgetUtil.is(widget) && widget.title.closable);
|
|
565
562
|
await this.shell.closeMany(toClose);
|
|
566
563
|
}
|
|
567
564
|
});
|
|
@@ -573,53 +570,53 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
573
570
|
});
|
|
574
571
|
commands.registerCommand({
|
|
575
572
|
id: 'workbench.action.navigateLeft',
|
|
576
|
-
label:
|
|
577
|
-
category:
|
|
573
|
+
label: nls.localizeByDefault('Navigate to the View on the Left'),
|
|
574
|
+
category: nls.localizeByDefault('View')
|
|
578
575
|
}, {
|
|
579
576
|
execute: () => this.navigateEditorGroup('left')
|
|
580
577
|
});
|
|
581
578
|
commands.registerCommand({
|
|
582
579
|
id: 'workbench.action.navigateRight',
|
|
583
|
-
label:
|
|
584
|
-
category:
|
|
580
|
+
label: nls.localizeByDefault('Navigate to the View on the Right'),
|
|
581
|
+
category: nls.localizeByDefault('View')
|
|
585
582
|
}, {
|
|
586
583
|
execute: () => this.navigateEditorGroup('right')
|
|
587
584
|
});
|
|
588
585
|
commands.registerCommand({
|
|
589
586
|
id: 'workbench.action.navigateUp',
|
|
590
|
-
label:
|
|
591
|
-
category:
|
|
587
|
+
label: nls.localizeByDefault('Navigate to the View Above'),
|
|
588
|
+
category: nls.localizeByDefault('View')
|
|
592
589
|
}, {
|
|
593
590
|
execute: () => this.navigateEditorGroup('up')
|
|
594
591
|
});
|
|
595
592
|
commands.registerCommand({
|
|
596
593
|
id: 'workbench.action.navigateDown',
|
|
597
|
-
label:
|
|
598
|
-
category:
|
|
594
|
+
label: nls.localizeByDefault('Navigate to the View Below'),
|
|
595
|
+
category: nls.localizeByDefault('View')
|
|
599
596
|
}, {
|
|
600
597
|
execute: () => this.navigateEditorGroup('down')
|
|
601
598
|
});
|
|
602
599
|
commands.registerCommand({
|
|
603
600
|
id: 'workbench.action.navigateEditorGroups',
|
|
604
|
-
label:
|
|
605
|
-
category:
|
|
601
|
+
label: nls.localizeByDefault('Navigate Between Editor Groups'),
|
|
602
|
+
category: nls.localizeByDefault('View')
|
|
606
603
|
}, {
|
|
607
604
|
execute: () => this.navigateEditorGroups()
|
|
608
605
|
});
|
|
609
606
|
commands.registerCommand({ id: 'workbench.action.navigateBack' }, {
|
|
610
|
-
execute: () => commands.executeCommand(
|
|
607
|
+
execute: () => commands.executeCommand(EditorCommands.GO_BACK.id)
|
|
611
608
|
});
|
|
612
|
-
commands.registerAlias('workbench.action.navigateBack',
|
|
609
|
+
commands.registerAlias('workbench.action.navigateBack', EditorCommands.GO_BACK.id);
|
|
613
610
|
commands.registerCommand({ id: 'workbench.action.navigateForward' }, {
|
|
614
|
-
execute: () => commands.executeCommand(
|
|
611
|
+
execute: () => commands.executeCommand(EditorCommands.GO_FORWARD.id)
|
|
615
612
|
});
|
|
616
|
-
commands.registerAlias('workbench.action.navigateForward',
|
|
613
|
+
commands.registerAlias('workbench.action.navigateForward', EditorCommands.GO_FORWARD.id);
|
|
617
614
|
commands.registerCommand({ id: 'workbench.action.navigateToLastEditLocation' }, {
|
|
618
|
-
execute: () => commands.executeCommand(
|
|
615
|
+
execute: () => commands.executeCommand(EditorCommands.GO_LAST_EDIT.id)
|
|
619
616
|
});
|
|
620
|
-
commands.registerAlias('workbench.action.navigateToLastEditLocation',
|
|
617
|
+
commands.registerAlias('workbench.action.navigateToLastEditLocation', EditorCommands.GO_LAST_EDIT.id);
|
|
621
618
|
commands.registerCommand({ id: 'openInTerminal' }, {
|
|
622
|
-
execute: (resource) => this.terminalContribution.openInTerminal(new
|
|
619
|
+
execute: (resource) => this.terminalContribution.openInTerminal(new TheiaURI(resource.toString()))
|
|
623
620
|
});
|
|
624
621
|
commands.registerCommand({ id: 'workbench.action.reloadWindow' }, {
|
|
625
622
|
execute: () => {
|
|
@@ -682,7 +679,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
682
679
|
if (!Array.isArray(value) || value === undefined) {
|
|
683
680
|
return undefined;
|
|
684
681
|
}
|
|
685
|
-
return value.map(loc =>
|
|
682
|
+
return value.map(loc => toMergedSymbol(resource, loc));
|
|
686
683
|
})
|
|
687
684
|
});
|
|
688
685
|
commands.registerCommand({
|
|
@@ -719,7 +716,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
719
716
|
id: 'vscode.executeWorkspaceSymbolProvider'
|
|
720
717
|
}, {
|
|
721
718
|
execute: async (queryString) => (await Promise.all(this.monacoLanguages.workspaceSymbolProviders
|
|
722
|
-
.map(async (provider) => provider.provideWorkspaceSymbols({ query: queryString }, new
|
|
719
|
+
.map(async (provider) => provider.provideWorkspaceSymbols({ query: queryString }, new CancellationTokenSource().token))))
|
|
723
720
|
.flatMap(symbols => symbols)
|
|
724
721
|
.filter(symbols => !!symbols)
|
|
725
722
|
});
|
|
@@ -728,9 +725,9 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
728
725
|
}, {
|
|
729
726
|
execute: async (resource, position) => {
|
|
730
727
|
const provider = await this.getCallHierarchyServiceForUri(resource);
|
|
731
|
-
const definition = await provider?.getRootDefinition(resource.path,
|
|
728
|
+
const definition = await provider?.getRootDefinition(resource.path, toPosition(position), new CancellationTokenSource().token);
|
|
732
729
|
if (definition) {
|
|
733
|
-
return definition.items.map(item =>
|
|
730
|
+
return definition.items.map(item => fromItemHierarchyDefinition(item));
|
|
734
731
|
}
|
|
735
732
|
;
|
|
736
733
|
return [];
|
|
@@ -740,11 +737,11 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
740
737
|
id: 'vscode.provideIncomingCalls'
|
|
741
738
|
}, {
|
|
742
739
|
execute: async (item) => {
|
|
743
|
-
const resource =
|
|
740
|
+
const resource = URI.from(item.uri);
|
|
744
741
|
const provider = await this.getCallHierarchyServiceForUri(resource);
|
|
745
|
-
const incomingCalls = await provider?.getCallers(
|
|
742
|
+
const incomingCalls = await provider?.getCallers(toItemHierarchyDefinition(item), new CancellationTokenSource().token);
|
|
746
743
|
if (incomingCalls) {
|
|
747
|
-
return incomingCalls.map(
|
|
744
|
+
return incomingCalls.map(fromCallHierarchyCallerToModelCallHierarchyIncomingCall);
|
|
748
745
|
}
|
|
749
746
|
return [];
|
|
750
747
|
},
|
|
@@ -753,11 +750,11 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
753
750
|
id: 'vscode.provideOutgoingCalls'
|
|
754
751
|
}, {
|
|
755
752
|
execute: async (item) => {
|
|
756
|
-
const resource =
|
|
753
|
+
const resource = URI.from(item.uri);
|
|
757
754
|
const provider = await this.getCallHierarchyServiceForUri(resource);
|
|
758
|
-
const outgoingCalls = await provider?.getCallees?.(
|
|
755
|
+
const outgoingCalls = await provider?.getCallees?.(toItemHierarchyDefinition(item), new CancellationTokenSource().token);
|
|
759
756
|
if (outgoingCalls) {
|
|
760
|
-
return outgoingCalls.map(
|
|
757
|
+
return outgoingCalls.map(fromCallHierarchyCalleeToModelCallHierarchyOutgoingCall);
|
|
761
758
|
}
|
|
762
759
|
return [];
|
|
763
760
|
}
|
|
@@ -767,8 +764,8 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
767
764
|
}, {
|
|
768
765
|
execute: async (resource, position) => {
|
|
769
766
|
const provider = await this.getTypeHierarchyServiceForUri(resource);
|
|
770
|
-
const session = await provider?.prepareSession(resource.path,
|
|
771
|
-
return session ? session.items.map(item =>
|
|
767
|
+
const session = await provider?.prepareSession(resource.path, toPosition(position), new CancellationTokenSource().token);
|
|
768
|
+
return session ? session.items.map(item => fromItemHierarchyDefinition(item)) : [];
|
|
772
769
|
}
|
|
773
770
|
});
|
|
774
771
|
commands.registerCommand({
|
|
@@ -778,10 +775,10 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
778
775
|
if (!item._sessionId || !item._itemId) {
|
|
779
776
|
return [];
|
|
780
777
|
}
|
|
781
|
-
const resource =
|
|
778
|
+
const resource = URI.from(item.uri);
|
|
782
779
|
const provider = await this.getTypeHierarchyServiceForUri(resource);
|
|
783
|
-
const items = await provider?.provideSuperTypes(item._sessionId, item._itemId, new
|
|
784
|
-
return (items ? items : []).map(typeItem =>
|
|
780
|
+
const items = await provider?.provideSuperTypes(item._sessionId, item._itemId, new CancellationTokenSource().token);
|
|
781
|
+
return (items ? items : []).map(typeItem => fromItemHierarchyDefinition(typeItem));
|
|
785
782
|
}
|
|
786
783
|
});
|
|
787
784
|
commands.registerCommand({
|
|
@@ -791,10 +788,10 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
791
788
|
if (!item._sessionId || !item._itemId) {
|
|
792
789
|
return [];
|
|
793
790
|
}
|
|
794
|
-
const resource =
|
|
791
|
+
const resource = URI.from(item.uri);
|
|
795
792
|
const provider = await this.getTypeHierarchyServiceForUri(resource);
|
|
796
|
-
const items = await provider?.provideSubTypes(item._sessionId, item._itemId, new
|
|
797
|
-
return (items ? items : []).map(typeItem =>
|
|
793
|
+
const items = await provider?.provideSubTypes(item._sessionId, item._itemId, new CancellationTokenSource().token);
|
|
794
|
+
return (items ? items : []).map(typeItem => fromItemHierarchyDefinition(typeItem));
|
|
798
795
|
}
|
|
799
796
|
});
|
|
800
797
|
commands.registerCommand({
|
|
@@ -805,9 +802,9 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
805
802
|
commands.registerCommand({
|
|
806
803
|
id: 'explorer.newFolder'
|
|
807
804
|
}, {
|
|
808
|
-
execute: () => commands.executeCommand(
|
|
805
|
+
execute: () => commands.executeCommand(WorkspaceCommands.NEW_FOLDER.id)
|
|
809
806
|
});
|
|
810
|
-
commands.registerAlias('explorer.newFolder',
|
|
807
|
+
commands.registerAlias('explorer.newFolder', WorkspaceCommands.NEW_FOLDER.id);
|
|
811
808
|
commands.registerCommand({
|
|
812
809
|
id: 'workbench.action.terminal.sendSequence'
|
|
813
810
|
}, {
|
|
@@ -836,37 +833,37 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
836
833
|
commands.registerCommand({
|
|
837
834
|
id: 'workbench.view.explorer'
|
|
838
835
|
}, {
|
|
839
|
-
execute: () => commands.executeCommand(
|
|
836
|
+
execute: () => commands.executeCommand(FileNavigatorCommands.FOCUS.id)
|
|
840
837
|
});
|
|
841
|
-
commands.registerAlias('workbench.view.explorer',
|
|
838
|
+
commands.registerAlias('workbench.view.explorer', FileNavigatorCommands.FOCUS.id);
|
|
842
839
|
commands.registerCommand({
|
|
843
840
|
id: 'copyFilePath'
|
|
844
841
|
}, {
|
|
845
|
-
execute: () => commands.executeCommand(
|
|
842
|
+
execute: () => commands.executeCommand(CommonCommands.COPY_PATH.id)
|
|
846
843
|
});
|
|
847
|
-
commands.registerAlias('copyFilePath',
|
|
844
|
+
commands.registerAlias('copyFilePath', CommonCommands.COPY_PATH.id);
|
|
848
845
|
commands.registerCommand({
|
|
849
846
|
id: 'copyRelativeFilePath'
|
|
850
847
|
}, {
|
|
851
|
-
execute: () => commands.executeCommand(
|
|
848
|
+
execute: () => commands.executeCommand(WorkspaceCommands.COPY_RELATIVE_FILE_PATH.id)
|
|
852
849
|
});
|
|
853
|
-
commands.registerAlias('copyRelativeFilePath',
|
|
850
|
+
commands.registerAlias('copyRelativeFilePath', WorkspaceCommands.COPY_RELATIVE_FILE_PATH.id);
|
|
854
851
|
commands.registerCommand({
|
|
855
852
|
id: 'revealInExplorer'
|
|
856
853
|
}, {
|
|
857
854
|
execute: async (resource) => {
|
|
858
|
-
if (!
|
|
855
|
+
if (!URI.isUri(resource)) {
|
|
859
856
|
return;
|
|
860
857
|
}
|
|
861
|
-
let navigator = await this.shell.revealWidget(
|
|
858
|
+
let navigator = await this.shell.revealWidget(FILE_NAVIGATOR_ID);
|
|
862
859
|
if (!navigator) {
|
|
863
|
-
await this.commandService.executeCommand(
|
|
864
|
-
navigator = await this.shell.revealWidget(
|
|
860
|
+
await this.commandService.executeCommand(FILE_NAVIGATOR_TOGGLE_COMMAND_ID);
|
|
861
|
+
navigator = await this.shell.revealWidget(FILE_NAVIGATOR_ID);
|
|
865
862
|
}
|
|
866
|
-
if (navigator instanceof
|
|
863
|
+
if (navigator instanceof FileNavigatorWidget) {
|
|
867
864
|
const model = navigator.model;
|
|
868
|
-
const node = await model.revealFile(new
|
|
869
|
-
if (
|
|
865
|
+
const node = await model.revealFile(new TheiaURI(resource));
|
|
866
|
+
if (SelectableTreeNode.is(node)) {
|
|
870
867
|
model.selectNode(node);
|
|
871
868
|
}
|
|
872
869
|
}
|
|
@@ -959,7 +956,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
959
956
|
const resultUri = toTheiaUri(arg.output);
|
|
960
957
|
const side1Uri = typeof arg.input1 === 'string' ? toTheiaUri(arg.input1) : toTheiaUri(arg.input1.uri);
|
|
961
958
|
const side2Uri = typeof arg.input2 === 'string' ? toTheiaUri(arg.input2) : toTheiaUri(arg.input2.uri);
|
|
962
|
-
const uri =
|
|
959
|
+
const uri = MergeEditorUri.encode({ baseUri, side1Uri, side2Uri, resultUri });
|
|
963
960
|
let side1State = undefined;
|
|
964
961
|
if (typeof arg.input1 !== 'string') {
|
|
965
962
|
const { title, description, detail } = arg.input1;
|
|
@@ -971,7 +968,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
971
968
|
side2State = { title, description, detail };
|
|
972
969
|
}
|
|
973
970
|
const options = { widgetState: { side1State, side2State } };
|
|
974
|
-
await
|
|
971
|
+
await open(this.openerService, uri, options);
|
|
975
972
|
}
|
|
976
973
|
});
|
|
977
974
|
commands.registerCommand({ id: '_workbench.openScmMultiDiffEditor' }, {
|
|
@@ -980,7 +977,7 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
980
977
|
if (!repositoryUri) {
|
|
981
978
|
return;
|
|
982
979
|
}
|
|
983
|
-
const repository = this.scmService.repositories.find(repo => new
|
|
980
|
+
const repository = this.scmService.repositories.find(repo => new TheiaURI(repo.provider.rootUri).isEqual(repositoryUri));
|
|
984
981
|
const group = repository?.provider.groups.find(candidate => candidate.id === options.resourceGroupId);
|
|
985
982
|
if (!group) {
|
|
986
983
|
return;
|
|
@@ -1007,17 +1004,17 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
1007
1004
|
if (!resourceUri) {
|
|
1008
1005
|
return undefined;
|
|
1009
1006
|
}
|
|
1010
|
-
const emptyUri = new
|
|
1007
|
+
const emptyUri = new TheiaURI().withScheme(MEMORY_TEXT_READONLY).withPath(resourceUri.path);
|
|
1011
1008
|
return { originalUri: originalUri ?? emptyUri, modifiedUri: modifiedUri ?? emptyUri };
|
|
1012
1009
|
})
|
|
1013
1010
|
.filter((r) => r !== undefined);
|
|
1014
1011
|
if (!resources.length) {
|
|
1015
1012
|
return;
|
|
1016
1013
|
}
|
|
1017
|
-
const uri =
|
|
1014
|
+
const uri = MultiDiffEditorUri.encode({ title: options.title, resources });
|
|
1018
1015
|
const reveal = toTheiaUri(options.reveal?.modifiedUri);
|
|
1019
1016
|
const openerOptions = { reveal };
|
|
1020
|
-
await
|
|
1017
|
+
await open(this.openerService, uri, openerOptions);
|
|
1021
1018
|
},
|
|
1022
1019
|
});
|
|
1023
1020
|
}
|
|
@@ -1027,22 +1024,22 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
1027
1024
|
async installExtensionFromId(extensionIdOrVersionedId) {
|
|
1028
1025
|
let extensionId = extensionIdOrVersionedId;
|
|
1029
1026
|
let opts;
|
|
1030
|
-
const versionedId =
|
|
1027
|
+
const versionedId = PluginIdentifiers.idAndVersionFromVersionedId(extensionIdOrVersionedId);
|
|
1031
1028
|
if (versionedId) {
|
|
1032
1029
|
extensionId = versionedId.id;
|
|
1033
1030
|
opts = { version: versionedId.version, ignoreOtherVersions: true };
|
|
1034
1031
|
}
|
|
1035
1032
|
try {
|
|
1036
|
-
await this.pluginServer.install(
|
|
1033
|
+
await this.pluginServer.install(VSCodeExtensionUri.fromId(extensionId).toString(), undefined, opts);
|
|
1037
1034
|
}
|
|
1038
1035
|
catch (e) {
|
|
1039
|
-
if (!
|
|
1036
|
+
if (!DuplicateExtensionError.is(e)) {
|
|
1040
1037
|
throw e;
|
|
1041
1038
|
}
|
|
1042
1039
|
}
|
|
1043
1040
|
}
|
|
1044
1041
|
async deployPlugin(uri) {
|
|
1045
|
-
const uriPath =
|
|
1042
|
+
const uriPath = isUriComponents(uri) ? URI.revive(uri).fsPath : await this.fileService.fsPath(uri);
|
|
1046
1043
|
return this.pluginServer.install(`local-file:${uriPath}`);
|
|
1047
1044
|
}
|
|
1048
1045
|
async resolveLanguageId(resource) {
|
|
@@ -1053,113 +1050,89 @@ let PluginVscodeCommandsContribution = class PluginVscodeCommandsContribution {
|
|
|
1053
1050
|
}
|
|
1054
1051
|
async getCallHierarchyServiceForUri(resource) {
|
|
1055
1052
|
const languageId = await this.resolveLanguageId(resource);
|
|
1056
|
-
return this.callHierarchyProvider.get(languageId, new
|
|
1053
|
+
return this.callHierarchyProvider.get(languageId, new TheiaURI(resource));
|
|
1057
1054
|
}
|
|
1058
1055
|
async getTypeHierarchyServiceForUri(resource) {
|
|
1059
1056
|
const languageId = await this.resolveLanguageId(resource);
|
|
1060
|
-
return this.typeHierarchyProvider.get(languageId, new
|
|
1057
|
+
return this.typeHierarchyProvider.get(languageId, new TheiaURI(resource));
|
|
1061
1058
|
}
|
|
1062
1059
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
(0, inversify_1.inject)(command_1.CommandService),
|
|
1066
|
-
tslib_1.__metadata("design:type", Object)
|
|
1060
|
+
__decorate([
|
|
1061
|
+
inject(CommandService)
|
|
1067
1062
|
], PluginVscodeCommandsContribution.prototype, "commandService", void 0);
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
tslib_1.__metadata("design:type", Object)
|
|
1063
|
+
__decorate([
|
|
1064
|
+
inject(ContextKeyService)
|
|
1071
1065
|
], PluginVscodeCommandsContribution.prototype, "contextKeyService", void 0);
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
tslib_1.__metadata("design:type", browser_2.EditorManager)
|
|
1066
|
+
__decorate([
|
|
1067
|
+
inject(EditorManager)
|
|
1075
1068
|
], PluginVscodeCommandsContribution.prototype, "editorManager", void 0);
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
tslib_1.__metadata("design:type", browser_1.ApplicationShell)
|
|
1069
|
+
__decorate([
|
|
1070
|
+
inject(ApplicationShell)
|
|
1079
1071
|
], PluginVscodeCommandsContribution.prototype, "shell", void 0);
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
tslib_1.__metadata("design:type", diff_service_1.DiffService)
|
|
1072
|
+
__decorate([
|
|
1073
|
+
inject(DiffService)
|
|
1083
1074
|
], PluginVscodeCommandsContribution.prototype, "diffService", void 0);
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
tslib_1.__metadata("design:type", Object)
|
|
1075
|
+
__decorate([
|
|
1076
|
+
inject(OpenerService)
|
|
1087
1077
|
], PluginVscodeCommandsContribution.prototype, "openerService", void 0);
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
tslib_1.__metadata("design:type", application_shell_mouse_tracker_1.ApplicationShellMouseTracker)
|
|
1078
|
+
__decorate([
|
|
1079
|
+
inject(ApplicationShellMouseTracker)
|
|
1091
1080
|
], PluginVscodeCommandsContribution.prototype, "mouseTracker", void 0);
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
tslib_1.__metadata("design:type", Object)
|
|
1081
|
+
__decorate([
|
|
1082
|
+
inject(QuickInputService),
|
|
1083
|
+
optional()
|
|
1096
1084
|
], PluginVscodeCommandsContribution.prototype, "quickInput", void 0);
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
1085
|
+
__decorate([
|
|
1086
|
+
inject(WorkspaceService)
|
|
1100
1087
|
], PluginVscodeCommandsContribution.prototype, "workspaceService", void 0);
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
tslib_1.__metadata("design:type", terminal_frontend_contribution_1.TerminalFrontendContribution)
|
|
1088
|
+
__decorate([
|
|
1089
|
+
inject(TerminalFrontendContribution)
|
|
1104
1090
|
], PluginVscodeCommandsContribution.prototype, "terminalContribution", void 0);
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
tslib_1.__metadata("design:type", quick_open_workspace_1.QuickOpenWorkspace)
|
|
1091
|
+
__decorate([
|
|
1092
|
+
inject(QuickOpenWorkspace)
|
|
1108
1093
|
], PluginVscodeCommandsContribution.prototype, "quickOpenWorkspace", void 0);
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
tslib_1.__metadata("design:type", Object)
|
|
1094
|
+
__decorate([
|
|
1095
|
+
inject(TerminalService)
|
|
1112
1096
|
], PluginVscodeCommandsContribution.prototype, "terminalService", void 0);
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
tslib_1.__metadata("design:type", Object)
|
|
1097
|
+
__decorate([
|
|
1098
|
+
inject(PluginServer)
|
|
1116
1099
|
], PluginVscodeCommandsContribution.prototype, "pluginServer", void 0);
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
tslib_1.__metadata("design:type", file_service_1.FileService)
|
|
1100
|
+
__decorate([
|
|
1101
|
+
inject(FileService)
|
|
1120
1102
|
], PluginVscodeCommandsContribution.prototype, "fileService", void 0);
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
tslib_1.__metadata("design:type", browser_5.CallHierarchyServiceProvider)
|
|
1103
|
+
__decorate([
|
|
1104
|
+
inject(CallHierarchyServiceProvider)
|
|
1124
1105
|
], PluginVscodeCommandsContribution.prototype, "callHierarchyProvider", void 0);
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
tslib_1.__metadata("design:type", browser_6.TypeHierarchyServiceProvider)
|
|
1106
|
+
__decorate([
|
|
1107
|
+
inject(TypeHierarchyServiceProvider)
|
|
1128
1108
|
], PluginVscodeCommandsContribution.prototype, "typeHierarchyProvider", void 0);
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
tslib_1.__metadata("design:type", monaco_text_model_service_1.MonacoTextModelService)
|
|
1109
|
+
__decorate([
|
|
1110
|
+
inject(MonacoTextModelService)
|
|
1132
1111
|
], PluginVscodeCommandsContribution.prototype, "textModelService", void 0);
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
tslib_1.__metadata("design:type", Object)
|
|
1112
|
+
__decorate([
|
|
1113
|
+
inject(WindowService)
|
|
1136
1114
|
], PluginVscodeCommandsContribution.prototype, "windowService", void 0);
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
tslib_1.__metadata("design:type", core_1.MessageService)
|
|
1115
|
+
__decorate([
|
|
1116
|
+
inject(MessageService)
|
|
1140
1117
|
], PluginVscodeCommandsContribution.prototype, "messageService", void 0);
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
tslib_1.__metadata("design:type", outline_view_contribution_1.OutlineViewContribution)
|
|
1118
|
+
__decorate([
|
|
1119
|
+
inject(OutlineViewContribution)
|
|
1144
1120
|
], PluginVscodeCommandsContribution.prototype, "outlineViewContribution", void 0);
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
tslib_1.__metadata("design:type", monaco_languages_1.MonacoLanguages)
|
|
1121
|
+
__decorate([
|
|
1122
|
+
inject(MonacoLanguages)
|
|
1148
1123
|
], PluginVscodeCommandsContribution.prototype, "monacoLanguages", void 0);
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
tslib_1.__metadata("design:type", scm_contribution_1.ScmContribution)
|
|
1124
|
+
__decorate([
|
|
1125
|
+
inject(ScmContribution)
|
|
1152
1126
|
], PluginVscodeCommandsContribution.prototype, "scmContribution", void 0);
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
tslib_1.__metadata("design:type", scm_service_1.ScmService)
|
|
1127
|
+
__decorate([
|
|
1128
|
+
inject(ScmService)
|
|
1156
1129
|
], PluginVscodeCommandsContribution.prototype, "scmService", void 0);
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
tslib_1.__metadata("design:type", Object)
|
|
1130
|
+
__decorate([
|
|
1131
|
+
inject(ILogger),
|
|
1132
|
+
named('plugin-ext-vscode:PluginVscodeCommandsContribution')
|
|
1161
1133
|
], PluginVscodeCommandsContribution.prototype, "logger", void 0);
|
|
1162
|
-
|
|
1163
|
-
|
|
1134
|
+
PluginVscodeCommandsContribution = __decorate([
|
|
1135
|
+
injectable()
|
|
1164
1136
|
], PluginVscodeCommandsContribution);
|
|
1137
|
+
export { PluginVscodeCommandsContribution };
|
|
1165
1138
|
//# sourceMappingURL=plugin-vscode-commands-contribution.js.map
|