@theia/editor 1.45.0 → 1.46.0-next.72
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/README.md +30 -30
- package/lib/browser/decorations/editor-decoration-style.d.ts +8 -8
- package/lib/browser/decorations/editor-decoration-style.js +36 -36
- package/lib/browser/decorations/editor-decoration.d.ts +106 -106
- package/lib/browser/decorations/editor-decoration.js +37 -37
- package/lib/browser/decorations/editor-decorator.d.ts +6 -6
- package/lib/browser/decorations/editor-decorator.js +43 -43
- package/lib/browser/decorations/index.d.ts +3 -3
- package/lib/browser/decorations/index.js +30 -30
- package/lib/browser/diff-navigator.d.ts +9 -10
- package/lib/browser/diff-navigator.d.ts.map +1 -1
- package/lib/browser/diff-navigator.js +19 -19
- package/lib/browser/diff-navigator.js.map +1 -1
- package/lib/browser/editor-command.d.ts +102 -102
- package/lib/browser/editor-command.js +426 -426
- package/lib/browser/editor-contribution.d.ts +26 -26
- package/lib/browser/editor-contribution.js +198 -198
- package/lib/browser/editor-frontend-module.d.ts +5 -5
- package/lib/browser/editor-frontend-module.js +74 -74
- package/lib/browser/editor-generated-preference-schema.d.ts +282 -249
- package/lib/browser/editor-generated-preference-schema.d.ts.map +1 -1
- package/lib/browser/editor-generated-preference-schema.js +2451 -2316
- package/lib/browser/editor-generated-preference-schema.js.map +1 -1
- package/lib/browser/editor-keybinding.d.ts +5 -5
- package/lib/browser/editor-keybinding.js +55 -55
- package/lib/browser/editor-linenumber-contribution.d.ts +15 -15
- package/lib/browser/editor-linenumber-contribution.d.ts.map +1 -1
- package/lib/browser/editor-linenumber-contribution.js +95 -96
- package/lib/browser/editor-linenumber-contribution.js.map +1 -1
- package/lib/browser/editor-manager.d.ts +115 -115
- package/lib/browser/editor-manager.js +428 -428
- package/lib/browser/editor-menu.d.ts +48 -48
- package/lib/browser/editor-menu.js +210 -210
- package/lib/browser/editor-navigation-contribution.d.ts +67 -67
- package/lib/browser/editor-navigation-contribution.js +343 -343
- package/lib/browser/editor-preferences.d.ts +41 -41
- package/lib/browser/editor-preferences.js +176 -176
- package/lib/browser/editor-variable-contribution.d.ts +8 -8
- package/lib/browser/editor-variable-contribution.js +64 -64
- package/lib/browser/editor-widget-factory.d.ts +17 -17
- package/lib/browser/editor-widget-factory.js +91 -91
- package/lib/browser/editor-widget.d.ts +24 -24
- package/lib/browser/editor-widget.d.ts.map +1 -1
- package/lib/browser/editor-widget.js +122 -114
- package/lib/browser/editor-widget.js.map +1 -1
- package/lib/browser/editor.d.ts +295 -293
- package/lib/browser/editor.d.ts.map +1 -1
- package/lib/browser/editor.js +103 -103
- package/lib/browser/editor.js.map +1 -1
- package/lib/browser/index.d.ts +10 -10
- package/lib/browser/index.js +37 -37
- package/lib/browser/language-status/editor-language-status-service.d.ts +77 -77
- package/lib/browser/language-status/editor-language-status-service.js +251 -251
- package/lib/browser/navigation/navigation-location-service.d.ts +103 -103
- package/lib/browser/navigation/navigation-location-service.js +281 -281
- package/lib/browser/navigation/navigation-location-service.spec.d.ts +1 -1
- package/lib/browser/navigation/navigation-location-service.spec.js +184 -184
- package/lib/browser/navigation/navigation-location-similarity.d.ts +15 -15
- package/lib/browser/navigation/navigation-location-similarity.js +62 -62
- package/lib/browser/navigation/navigation-location-similarity.spec.d.ts +1 -1
- package/lib/browser/navigation/navigation-location-similarity.spec.js +32 -32
- package/lib/browser/navigation/navigation-location-updater.d.ts +35 -35
- package/lib/browser/navigation/navigation-location-updater.js +210 -210
- package/lib/browser/navigation/navigation-location-updater.spec.d.ts +1 -1
- package/lib/browser/navigation/navigation-location-updater.spec.js +177 -177
- package/lib/browser/navigation/navigation-location.d.ts +191 -191
- package/lib/browser/navigation/navigation-location.js +300 -300
- package/lib/browser/navigation/test/mock-navigation-location-updater.d.ts +15 -15
- package/lib/browser/navigation/test/mock-navigation-location-updater.js +38 -38
- package/lib/browser/quick-editor-service.d.ts +16 -16
- package/lib/browser/quick-editor-service.js +109 -109
- package/lib/browser/undo-redo-service.d.ts +23 -23
- package/lib/browser/undo-redo-service.js +110 -110
- package/lib/common/language-selector.d.ts +13 -13
- package/lib/common/language-selector.js +90 -90
- package/lib/package.spec.js +25 -25
- package/package.json +5 -5
- package/src/browser/decorations/editor-decoration-style.ts +41 -41
- package/src/browser/decorations/editor-decoration.ts +127 -127
- package/src/browser/decorations/editor-decorator.ts +36 -36
- package/src/browser/decorations/index.ts +19 -19
- package/src/browser/diff-navigator.ts +27 -28
- package/src/browser/editor-command.ts +414 -414
- package/src/browser/editor-contribution.ts +185 -185
- package/src/browser/editor-frontend-module.ts +87 -87
- package/src/browser/editor-generated-preference-schema.ts +2707 -2539
- package/src/browser/editor-keybinding.ts +55 -55
- package/src/browser/editor-linenumber-contribution.ts +88 -89
- package/src/browser/editor-manager.ts +442 -442
- package/src/browser/editor-menu.ts +224 -224
- package/src/browser/editor-navigation-contribution.ts +343 -343
- package/src/browser/editor-preferences.ts +226 -226
- package/src/browser/editor-variable-contribution.ts +54 -54
- package/src/browser/editor-widget-factory.ts +82 -82
- package/src/browser/editor-widget.ts +137 -130
- package/src/browser/editor.ts +360 -358
- package/src/browser/index.ts +26 -26
- package/src/browser/language-status/editor-language-status-service.ts +271 -271
- package/src/browser/language-status/editor-language-status.css +101 -101
- package/src/browser/navigation/navigation-location-service.spec.ts +245 -245
- package/src/browser/navigation/navigation-location-service.ts +284 -284
- package/src/browser/navigation/navigation-location-similarity.spec.ts +46 -46
- package/src/browser/navigation/navigation-location-similarity.ts +58 -58
- package/src/browser/navigation/navigation-location-updater.spec.ts +197 -197
- package/src/browser/navigation/navigation-location-updater.ts +220 -220
- package/src/browser/navigation/navigation-location.ts +418 -418
- package/src/browser/navigation/test/mock-navigation-location-updater.ts +41 -41
- package/src/browser/quick-editor-service.ts +94 -94
- package/src/browser/style/index.css +19 -19
- package/src/browser/undo-redo-service.ts +120 -120
- package/src/common/language-selector.ts +104 -104
- package/src/package.spec.ts +28 -28
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.NoopNavigationLocationUpdater = exports.MockNavigationLocationUpdater = void 0;
|
|
19
|
-
const navigation_location_updater_1 = require("../navigation-location-updater");
|
|
20
|
-
/**
|
|
21
|
-
* Navigation location updater with increased method visibility for testing.
|
|
22
|
-
*/
|
|
23
|
-
class MockNavigationLocationUpdater extends navigation_location_updater_1.NavigationLocationUpdater {
|
|
24
|
-
contained(subRange, range) {
|
|
25
|
-
return super.contained(subRange, range);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.MockNavigationLocationUpdater = MockNavigationLocationUpdater;
|
|
29
|
-
/**
|
|
30
|
-
* NOOP navigation location updater for testing. Use this, if you want to avoid any
|
|
31
|
-
* location updates during the tests.
|
|
32
|
-
*/
|
|
33
|
-
class NoopNavigationLocationUpdater extends navigation_location_updater_1.NavigationLocationUpdater {
|
|
34
|
-
affects() {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.NoopNavigationLocationUpdater = NoopNavigationLocationUpdater;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.NoopNavigationLocationUpdater = exports.MockNavigationLocationUpdater = void 0;
|
|
19
|
+
const navigation_location_updater_1 = require("../navigation-location-updater");
|
|
20
|
+
/**
|
|
21
|
+
* Navigation location updater with increased method visibility for testing.
|
|
22
|
+
*/
|
|
23
|
+
class MockNavigationLocationUpdater extends navigation_location_updater_1.NavigationLocationUpdater {
|
|
24
|
+
contained(subRange, range) {
|
|
25
|
+
return super.contained(subRange, range);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.MockNavigationLocationUpdater = MockNavigationLocationUpdater;
|
|
29
|
+
/**
|
|
30
|
+
* NOOP navigation location updater for testing. Use this, if you want to avoid any
|
|
31
|
+
* location updates during the tests.
|
|
32
|
+
*/
|
|
33
|
+
class NoopNavigationLocationUpdater extends navigation_location_updater_1.NavigationLocationUpdater {
|
|
34
|
+
affects() {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.NoopNavigationLocationUpdater = NoopNavigationLocationUpdater;
|
|
39
39
|
//# sourceMappingURL=mock-navigation-location-updater.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { CancellationToken } from '@theia/core/lib/common';
|
|
2
|
-
import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
|
3
|
-
import { QuickAccessProvider, QuickAccessRegistry, QuickAccessContribution } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
4
|
-
import { QuickPickItem, QuickPickSeparator } from '@theia/core/lib/browser/quick-input/quick-input-service';
|
|
5
|
-
import { ApplicationShell, NavigatableWidget } from '@theia/core/lib/browser';
|
|
6
|
-
export declare class QuickEditorService implements QuickAccessContribution, QuickAccessProvider {
|
|
7
|
-
static PREFIX: string;
|
|
8
|
-
protected readonly labelProvider: LabelProvider;
|
|
9
|
-
protected readonly quickAccessRegistry: QuickAccessRegistry;
|
|
10
|
-
protected readonly shell: ApplicationShell;
|
|
11
|
-
protected groupLocalizations: string[];
|
|
12
|
-
registerQuickAccessProvider(): void;
|
|
13
|
-
getPicks(filter: string, token: CancellationToken): (QuickPickItem | QuickPickSeparator)[];
|
|
14
|
-
protected getGroupLocalization(index: number): string;
|
|
15
|
-
protected toItem(widget: NavigatableWidget): QuickPickItem;
|
|
16
|
-
}
|
|
1
|
+
import { CancellationToken } from '@theia/core/lib/common';
|
|
2
|
+
import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
|
3
|
+
import { QuickAccessProvider, QuickAccessRegistry, QuickAccessContribution } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
4
|
+
import { QuickPickItem, QuickPickSeparator } from '@theia/core/lib/browser/quick-input/quick-input-service';
|
|
5
|
+
import { ApplicationShell, NavigatableWidget } from '@theia/core/lib/browser';
|
|
6
|
+
export declare class QuickEditorService implements QuickAccessContribution, QuickAccessProvider {
|
|
7
|
+
static PREFIX: string;
|
|
8
|
+
protected readonly labelProvider: LabelProvider;
|
|
9
|
+
protected readonly quickAccessRegistry: QuickAccessRegistry;
|
|
10
|
+
protected readonly shell: ApplicationShell;
|
|
11
|
+
protected groupLocalizations: string[];
|
|
12
|
+
registerQuickAccessProvider(): void;
|
|
13
|
+
getPicks(filter: string, token: CancellationToken): (QuickPickItem | QuickPickSeparator)[];
|
|
14
|
+
protected getGroupLocalization(index: number): string;
|
|
15
|
+
protected toItem(widget: NavigatableWidget): QuickPickItem;
|
|
16
|
+
}
|
|
17
17
|
//# sourceMappingURL=quick-editor-service.d.ts.map
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var QuickEditorService_1;
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.QuickEditorService = void 0;
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const common_1 = require("@theia/core/lib/common");
|
|
31
|
-
const label_provider_1 = require("@theia/core/lib/browser/label-provider");
|
|
32
|
-
const quick_access_1 = require("@theia/core/lib/browser/quick-input/quick-access");
|
|
33
|
-
const quick_input_service_1 = require("@theia/core/lib/browser/quick-input/quick-input-service");
|
|
34
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
35
|
-
let QuickEditorService = QuickEditorService_1 = class QuickEditorService {
|
|
36
|
-
constructor() {
|
|
37
|
-
this.groupLocalizations = [];
|
|
38
|
-
}
|
|
39
|
-
registerQuickAccessProvider() {
|
|
40
|
-
this.quickAccessRegistry.registerQuickAccessProvider({
|
|
41
|
-
getInstance: () => this,
|
|
42
|
-
prefix: QuickEditorService_1.PREFIX,
|
|
43
|
-
placeholder: '',
|
|
44
|
-
helpEntries: [{ description: 'Show All Opened Editors', needsEditor: false }]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
getPicks(filter, token) {
|
|
48
|
-
const editorItems = [];
|
|
49
|
-
const hasUri = (widget) => Boolean(browser_1.NavigatableWidget.getUri(widget));
|
|
50
|
-
const handleWidgets = (widgets, label) => {
|
|
51
|
-
if (widgets.length) {
|
|
52
|
-
editorItems.push({ type: 'separator', label });
|
|
53
|
-
}
|
|
54
|
-
editorItems.push(...widgets.map(widget => this.toItem(widget)));
|
|
55
|
-
};
|
|
56
|
-
const handleSplittableArea = (tabbars, labelPrefix) => {
|
|
57
|
-
tabbars.forEach((tabbar, index) => {
|
|
58
|
-
const editorsOnTabbar = tabbar.titles.reduce((widgets, title) => {
|
|
59
|
-
if (hasUri(title.owner)) {
|
|
60
|
-
widgets.push(title.owner);
|
|
61
|
-
}
|
|
62
|
-
return widgets;
|
|
63
|
-
}, []);
|
|
64
|
-
const label = tabbars.length > 1 ? `${labelPrefix} ${this.getGroupLocalization(index)}` : labelPrefix;
|
|
65
|
-
handleWidgets(editorsOnTabbar, label);
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
handleSplittableArea(this.shell.mainAreaTabBars, browser_1.ApplicationShell.areaLabels.main);
|
|
69
|
-
handleSplittableArea(this.shell.bottomAreaTabBars, browser_1.ApplicationShell.areaLabels.bottom);
|
|
70
|
-
for (const area of ['left', 'right']) {
|
|
71
|
-
const editorsInArea = this.shell.getWidgets(area).filter(hasUri);
|
|
72
|
-
handleWidgets(editorsInArea, browser_1.ApplicationShell.areaLabels[area]);
|
|
73
|
-
}
|
|
74
|
-
return (0, quick_input_service_1.filterItems)(editorItems.slice(), filter);
|
|
75
|
-
}
|
|
76
|
-
getGroupLocalization(index) {
|
|
77
|
-
return this.groupLocalizations[index] || common_1.nls.localizeByDefault('Group {0}', index + 1);
|
|
78
|
-
}
|
|
79
|
-
toItem(widget) {
|
|
80
|
-
const uri = browser_1.NavigatableWidget.getUri(widget);
|
|
81
|
-
const icon = this.labelProvider.getIcon(uri);
|
|
82
|
-
const iconClasses = icon === '' ? undefined : [icon + ' file-icon'];
|
|
83
|
-
return {
|
|
84
|
-
label: this.labelProvider.getName(uri),
|
|
85
|
-
description: this.labelProvider.getDetails(uri),
|
|
86
|
-
iconClasses,
|
|
87
|
-
ariaLabel: uri.path.fsPath(),
|
|
88
|
-
alwaysShow: true,
|
|
89
|
-
execute: () => this.shell.activateWidget(widget.id),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
QuickEditorService.PREFIX = 'edt ';
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, inversify_1.inject)(label_provider_1.LabelProvider),
|
|
96
|
-
__metadata("design:type", label_provider_1.LabelProvider)
|
|
97
|
-
], QuickEditorService.prototype, "labelProvider", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
(0, inversify_1.inject)(quick_access_1.QuickAccessRegistry),
|
|
100
|
-
__metadata("design:type", Object)
|
|
101
|
-
], QuickEditorService.prototype, "quickAccessRegistry", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
104
|
-
__metadata("design:type", browser_1.ApplicationShell)
|
|
105
|
-
], QuickEditorService.prototype, "shell", void 0);
|
|
106
|
-
QuickEditorService = QuickEditorService_1 = __decorate([
|
|
107
|
-
(0, inversify_1.injectable)()
|
|
108
|
-
], QuickEditorService);
|
|
109
|
-
exports.QuickEditorService = QuickEditorService;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var QuickEditorService_1;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.QuickEditorService = void 0;
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const common_1 = require("@theia/core/lib/common");
|
|
31
|
+
const label_provider_1 = require("@theia/core/lib/browser/label-provider");
|
|
32
|
+
const quick_access_1 = require("@theia/core/lib/browser/quick-input/quick-access");
|
|
33
|
+
const quick_input_service_1 = require("@theia/core/lib/browser/quick-input/quick-input-service");
|
|
34
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
35
|
+
let QuickEditorService = QuickEditorService_1 = class QuickEditorService {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.groupLocalizations = [];
|
|
38
|
+
}
|
|
39
|
+
registerQuickAccessProvider() {
|
|
40
|
+
this.quickAccessRegistry.registerQuickAccessProvider({
|
|
41
|
+
getInstance: () => this,
|
|
42
|
+
prefix: QuickEditorService_1.PREFIX,
|
|
43
|
+
placeholder: '',
|
|
44
|
+
helpEntries: [{ description: 'Show All Opened Editors', needsEditor: false }]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getPicks(filter, token) {
|
|
48
|
+
const editorItems = [];
|
|
49
|
+
const hasUri = (widget) => Boolean(browser_1.NavigatableWidget.getUri(widget));
|
|
50
|
+
const handleWidgets = (widgets, label) => {
|
|
51
|
+
if (widgets.length) {
|
|
52
|
+
editorItems.push({ type: 'separator', label });
|
|
53
|
+
}
|
|
54
|
+
editorItems.push(...widgets.map(widget => this.toItem(widget)));
|
|
55
|
+
};
|
|
56
|
+
const handleSplittableArea = (tabbars, labelPrefix) => {
|
|
57
|
+
tabbars.forEach((tabbar, index) => {
|
|
58
|
+
const editorsOnTabbar = tabbar.titles.reduce((widgets, title) => {
|
|
59
|
+
if (hasUri(title.owner)) {
|
|
60
|
+
widgets.push(title.owner);
|
|
61
|
+
}
|
|
62
|
+
return widgets;
|
|
63
|
+
}, []);
|
|
64
|
+
const label = tabbars.length > 1 ? `${labelPrefix} ${this.getGroupLocalization(index)}` : labelPrefix;
|
|
65
|
+
handleWidgets(editorsOnTabbar, label);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
handleSplittableArea(this.shell.mainAreaTabBars, browser_1.ApplicationShell.areaLabels.main);
|
|
69
|
+
handleSplittableArea(this.shell.bottomAreaTabBars, browser_1.ApplicationShell.areaLabels.bottom);
|
|
70
|
+
for (const area of ['left', 'right']) {
|
|
71
|
+
const editorsInArea = this.shell.getWidgets(area).filter(hasUri);
|
|
72
|
+
handleWidgets(editorsInArea, browser_1.ApplicationShell.areaLabels[area]);
|
|
73
|
+
}
|
|
74
|
+
return (0, quick_input_service_1.filterItems)(editorItems.slice(), filter);
|
|
75
|
+
}
|
|
76
|
+
getGroupLocalization(index) {
|
|
77
|
+
return this.groupLocalizations[index] || common_1.nls.localizeByDefault('Group {0}', index + 1);
|
|
78
|
+
}
|
|
79
|
+
toItem(widget) {
|
|
80
|
+
const uri = browser_1.NavigatableWidget.getUri(widget);
|
|
81
|
+
const icon = this.labelProvider.getIcon(uri);
|
|
82
|
+
const iconClasses = icon === '' ? undefined : [icon + ' file-icon'];
|
|
83
|
+
return {
|
|
84
|
+
label: this.labelProvider.getName(uri),
|
|
85
|
+
description: this.labelProvider.getDetails(uri),
|
|
86
|
+
iconClasses,
|
|
87
|
+
ariaLabel: uri.path.fsPath(),
|
|
88
|
+
alwaysShow: true,
|
|
89
|
+
execute: () => this.shell.activateWidget(widget.id),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
QuickEditorService.PREFIX = 'edt ';
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, inversify_1.inject)(label_provider_1.LabelProvider),
|
|
96
|
+
__metadata("design:type", label_provider_1.LabelProvider)
|
|
97
|
+
], QuickEditorService.prototype, "labelProvider", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, inversify_1.inject)(quick_access_1.QuickAccessRegistry),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], QuickEditorService.prototype, "quickAccessRegistry", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
104
|
+
__metadata("design:type", browser_1.ApplicationShell)
|
|
105
|
+
], QuickEditorService.prototype, "shell", void 0);
|
|
106
|
+
QuickEditorService = QuickEditorService_1 = __decorate([
|
|
107
|
+
(0, inversify_1.injectable)()
|
|
108
|
+
], QuickEditorService);
|
|
109
|
+
exports.QuickEditorService = QuickEditorService;
|
|
110
110
|
//# sourceMappingURL=quick-editor-service.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
export declare class UndoRedoService {
|
|
3
|
-
private readonly editStacks;
|
|
4
|
-
pushElement(resource: URI, undo: () => Promise<void>, redo: () => Promise<void>): void;
|
|
5
|
-
removeElements(resource: URI): void;
|
|
6
|
-
undo(resource: URI): void;
|
|
7
|
-
redo(resource: URI): void;
|
|
8
|
-
}
|
|
9
|
-
interface StackElement {
|
|
10
|
-
undo(): Promise<void> | void;
|
|
11
|
-
redo(): Promise<void> | void;
|
|
12
|
-
}
|
|
13
|
-
export declare class ResourceEditStack {
|
|
14
|
-
private past;
|
|
15
|
-
private future;
|
|
16
|
-
constructor();
|
|
17
|
-
pushElement(element: StackElement): void;
|
|
18
|
-
getClosestPastElement(): StackElement | undefined;
|
|
19
|
-
getClosestFutureElement(): StackElement | undefined;
|
|
20
|
-
moveBackward(element: StackElement): void;
|
|
21
|
-
moveForward(element: StackElement): void;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
1
|
+
import URI from '@theia/core/lib/common/uri';
|
|
2
|
+
export declare class UndoRedoService {
|
|
3
|
+
private readonly editStacks;
|
|
4
|
+
pushElement(resource: URI, undo: () => Promise<void>, redo: () => Promise<void>): void;
|
|
5
|
+
removeElements(resource: URI): void;
|
|
6
|
+
undo(resource: URI): void;
|
|
7
|
+
redo(resource: URI): void;
|
|
8
|
+
}
|
|
9
|
+
interface StackElement {
|
|
10
|
+
undo(): Promise<void> | void;
|
|
11
|
+
redo(): Promise<void> | void;
|
|
12
|
+
}
|
|
13
|
+
export declare class ResourceEditStack {
|
|
14
|
+
private past;
|
|
15
|
+
private future;
|
|
16
|
+
constructor();
|
|
17
|
+
pushElement(element: StackElement): void;
|
|
18
|
+
getClosestPastElement(): StackElement | undefined;
|
|
19
|
+
getClosestFutureElement(): StackElement | undefined;
|
|
20
|
+
moveBackward(element: StackElement): void;
|
|
21
|
+
moveForward(element: StackElement): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
24
|
//# sourceMappingURL=undo-redo-service.d.ts.map
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
/*---------------------------------------------------------------------------------------------
|
|
18
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
-
*--------------------------------------------------------------------------------------------*/
|
|
21
|
-
// copied and modified from https://github.com/microsoft/vscode/blob/53eac52308c4611000a171cc7bf1214293473c78/src/vs/platform/undoRedo/common/undoRedoService.ts#
|
|
22
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
23
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ResourceEditStack = exports.UndoRedoService = void 0;
|
|
30
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
31
|
-
let UndoRedoService = class UndoRedoService {
|
|
32
|
-
constructor() {
|
|
33
|
-
this.editStacks = new Map();
|
|
34
|
-
}
|
|
35
|
-
pushElement(resource, undo, redo) {
|
|
36
|
-
let editStack;
|
|
37
|
-
if (this.editStacks.has(resource.toString())) {
|
|
38
|
-
editStack = this.editStacks.get(resource.toString());
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
editStack = new ResourceEditStack();
|
|
42
|
-
this.editStacks.set(resource.toString(), editStack);
|
|
43
|
-
}
|
|
44
|
-
editStack.pushElement({ undo, redo });
|
|
45
|
-
}
|
|
46
|
-
removeElements(resource) {
|
|
47
|
-
if (this.editStacks.has(resource.toString())) {
|
|
48
|
-
this.editStacks.delete(resource.toString());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
undo(resource) {
|
|
52
|
-
if (!this.editStacks.has(resource.toString())) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const editStack = this.editStacks.get(resource.toString());
|
|
56
|
-
const element = editStack.getClosestPastElement();
|
|
57
|
-
if (!element) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
editStack.moveBackward(element);
|
|
61
|
-
element.undo();
|
|
62
|
-
}
|
|
63
|
-
redo(resource) {
|
|
64
|
-
if (!this.editStacks.has(resource.toString())) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const editStack = this.editStacks.get(resource.toString());
|
|
68
|
-
const element = editStack.getClosestFutureElement();
|
|
69
|
-
if (!element) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
editStack.moveForward(element);
|
|
73
|
-
element.redo();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
UndoRedoService = __decorate([
|
|
77
|
-
(0, inversify_1.injectable)()
|
|
78
|
-
], UndoRedoService);
|
|
79
|
-
exports.UndoRedoService = UndoRedoService;
|
|
80
|
-
class ResourceEditStack {
|
|
81
|
-
constructor() {
|
|
82
|
-
this.past = [];
|
|
83
|
-
this.future = [];
|
|
84
|
-
}
|
|
85
|
-
pushElement(element) {
|
|
86
|
-
this.future = [];
|
|
87
|
-
this.past.push(element);
|
|
88
|
-
}
|
|
89
|
-
getClosestPastElement() {
|
|
90
|
-
if (this.past.length === 0) {
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
return this.past[this.past.length - 1];
|
|
94
|
-
}
|
|
95
|
-
getClosestFutureElement() {
|
|
96
|
-
if (this.future.length === 0) {
|
|
97
|
-
return undefined;
|
|
98
|
-
}
|
|
99
|
-
return this.future[this.future.length - 1];
|
|
100
|
-
}
|
|
101
|
-
moveBackward(element) {
|
|
102
|
-
this.past.pop();
|
|
103
|
-
this.future.push(element);
|
|
104
|
-
}
|
|
105
|
-
moveForward(element) {
|
|
106
|
-
this.future.pop();
|
|
107
|
-
this.past.push(element);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.ResourceEditStack = ResourceEditStack;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// copied and modified from https://github.com/microsoft/vscode/blob/53eac52308c4611000a171cc7bf1214293473c78/src/vs/platform/undoRedo/common/undoRedoService.ts#
|
|
22
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
23
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ResourceEditStack = exports.UndoRedoService = void 0;
|
|
30
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
31
|
+
let UndoRedoService = class UndoRedoService {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.editStacks = new Map();
|
|
34
|
+
}
|
|
35
|
+
pushElement(resource, undo, redo) {
|
|
36
|
+
let editStack;
|
|
37
|
+
if (this.editStacks.has(resource.toString())) {
|
|
38
|
+
editStack = this.editStacks.get(resource.toString());
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
editStack = new ResourceEditStack();
|
|
42
|
+
this.editStacks.set(resource.toString(), editStack);
|
|
43
|
+
}
|
|
44
|
+
editStack.pushElement({ undo, redo });
|
|
45
|
+
}
|
|
46
|
+
removeElements(resource) {
|
|
47
|
+
if (this.editStacks.has(resource.toString())) {
|
|
48
|
+
this.editStacks.delete(resource.toString());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
undo(resource) {
|
|
52
|
+
if (!this.editStacks.has(resource.toString())) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const editStack = this.editStacks.get(resource.toString());
|
|
56
|
+
const element = editStack.getClosestPastElement();
|
|
57
|
+
if (!element) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
editStack.moveBackward(element);
|
|
61
|
+
element.undo();
|
|
62
|
+
}
|
|
63
|
+
redo(resource) {
|
|
64
|
+
if (!this.editStacks.has(resource.toString())) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const editStack = this.editStacks.get(resource.toString());
|
|
68
|
+
const element = editStack.getClosestFutureElement();
|
|
69
|
+
if (!element) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
editStack.moveForward(element);
|
|
73
|
+
element.redo();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
UndoRedoService = __decorate([
|
|
77
|
+
(0, inversify_1.injectable)()
|
|
78
|
+
], UndoRedoService);
|
|
79
|
+
exports.UndoRedoService = UndoRedoService;
|
|
80
|
+
class ResourceEditStack {
|
|
81
|
+
constructor() {
|
|
82
|
+
this.past = [];
|
|
83
|
+
this.future = [];
|
|
84
|
+
}
|
|
85
|
+
pushElement(element) {
|
|
86
|
+
this.future = [];
|
|
87
|
+
this.past.push(element);
|
|
88
|
+
}
|
|
89
|
+
getClosestPastElement() {
|
|
90
|
+
if (this.past.length === 0) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
return this.past[this.past.length - 1];
|
|
94
|
+
}
|
|
95
|
+
getClosestFutureElement() {
|
|
96
|
+
if (this.future.length === 0) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
return this.future[this.future.length - 1];
|
|
100
|
+
}
|
|
101
|
+
moveBackward(element) {
|
|
102
|
+
this.past.pop();
|
|
103
|
+
this.future.push(element);
|
|
104
|
+
}
|
|
105
|
+
moveForward(element) {
|
|
106
|
+
this.future.pop();
|
|
107
|
+
this.past.push(element);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.ResourceEditStack = ResourceEditStack;
|
|
111
111
|
//# sourceMappingURL=undo-redo-service.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export interface RelativePattern {
|
|
2
|
-
base: string;
|
|
3
|
-
pattern: string;
|
|
4
|
-
pathToRelative(from: string, to: string): string;
|
|
5
|
-
}
|
|
6
|
-
export interface LanguageFilter {
|
|
7
|
-
language?: string;
|
|
8
|
-
scheme?: string;
|
|
9
|
-
pattern?: string | RelativePattern;
|
|
10
|
-
hasAccessToAllModels?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare type LanguageSelector = string | LanguageFilter | (string | LanguageFilter)[];
|
|
13
|
-
export declare function score(selector: LanguageSelector | undefined, uriScheme: string, path: string, candidateLanguage: string, candidateIsSynchronized: boolean): number;
|
|
1
|
+
export interface RelativePattern {
|
|
2
|
+
base: string;
|
|
3
|
+
pattern: string;
|
|
4
|
+
pathToRelative(from: string, to: string): string;
|
|
5
|
+
}
|
|
6
|
+
export interface LanguageFilter {
|
|
7
|
+
language?: string;
|
|
8
|
+
scheme?: string;
|
|
9
|
+
pattern?: string | RelativePattern;
|
|
10
|
+
hasAccessToAllModels?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare type LanguageSelector = string | LanguageFilter | (string | LanguageFilter)[];
|
|
13
|
+
export declare function score(selector: LanguageSelector | undefined, uriScheme: string, path: string, candidateLanguage: string, candidateIsSynchronized: boolean): number;
|
|
14
14
|
//# sourceMappingURL=language-selector.d.ts.map
|