@theia/editor 1.34.2 → 1.34.3
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/LICENSE +641 -641
- 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 +10 -10
- package/lib/browser/diff-navigator.js +19 -19
- 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 +249 -249
- package/lib/browser/editor-generated-preference-schema.js +2316 -2316
- package/lib/browser/editor-keybinding-contexts.d.ts +35 -35
- package/lib/browser/editor-keybinding-contexts.js +98 -98
- package/lib/browser/editor-keybinding.d.ts +5 -5
- package/lib/browser/editor-keybinding.js +55 -55
- package/lib/browser/editor-manager.d.ts +113 -113
- package/lib/browser/editor-manager.js +412 -412
- 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 +331 -331
- package/lib/browser/editor-preferences.d.ts +40 -40
- package/lib/browser/editor-preferences.js +165 -165
- 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 +20 -20
- package/lib/browser/editor-widget.js +87 -87
- package/lib/browser/editor.d.ts +293 -293
- package/lib/browser/editor.js +103 -103
- 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/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 +28 -28
- package/src/browser/editor-command.ts +414 -414
- package/src/browser/editor-contribution.ts +185 -185
- package/src/browser/editor-frontend-module.ts +85 -85
- package/src/browser/editor-generated-preference-schema.ts +2539 -2539
- package/src/browser/editor-keybinding-contexts.ts +87 -87
- package/src/browser/editor-keybinding.ts +55 -55
- package/src/browser/editor-manager.ts +429 -429
- package/src/browser/editor-menu.ts +224 -224
- package/src/browser/editor-navigation-contribution.ts +331 -331
- package/src/browser/editor-preferences.ts +220 -220
- package/src/browser/editor-variable-contribution.ts +54 -54
- package/src/browser/editor-widget-factory.ts +82 -82
- package/src/browser/editor-widget.ts +98 -98
- package/src/browser/editor.ts +358 -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 +98 -98
- 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/common/language-selector.ts +104 -104
- package/src/package.spec.ts +28 -28
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { KeybindingContext } from '@theia/core/lib/browser/keybinding';
|
|
2
|
-
import { EditorManager } from './editor-manager';
|
|
3
|
-
import { EditorWidget } from './editor-widget';
|
|
4
|
-
export declare namespace EditorKeybindingContexts {
|
|
5
|
-
/**
|
|
6
|
-
* ID of a keybinding context that is enabled when the active text editor has the focus.
|
|
7
|
-
*/
|
|
8
|
-
const editorTextFocus = "editorTextFocus";
|
|
9
|
-
/**
|
|
10
|
-
* ID of a keybinding context that is enabled when the active diff editor has the focus.
|
|
11
|
-
*/
|
|
12
|
-
const diffEditorTextFocus = "diffEditorTextFocus";
|
|
13
|
-
/**
|
|
14
|
-
* Unique identifier of a keybinding context that is enabled if the active editor has the focus but it does not have any overlaying widgets, such as the content assist widget.
|
|
15
|
-
*/
|
|
16
|
-
const strictEditorTextFocus = "strictEditorTextFocus";
|
|
17
|
-
}
|
|
18
|
-
export declare class EditorTextFocusContext implements KeybindingContext {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
protected readonly editorManager: EditorManager;
|
|
21
|
-
isEnabled(): boolean;
|
|
22
|
-
protected getEditor(): EditorWidget | undefined;
|
|
23
|
-
protected canHandle(widget: EditorWidget): boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare class DiffEditorTextFocusContext extends EditorTextFocusContext {
|
|
26
|
-
readonly id: string;
|
|
27
|
-
protected canHandle(widget: EditorWidget): boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Keybinding context that is enabled when the active text editor has the focus **AND** it does not
|
|
31
|
-
* have any widgets (for example, the content assist widget) overlaying the active editor.
|
|
32
|
-
*/
|
|
33
|
-
export declare class StrictEditorTextFocusContext extends EditorTextFocusContext {
|
|
34
|
-
readonly id: string;
|
|
35
|
-
}
|
|
1
|
+
import { KeybindingContext } from '@theia/core/lib/browser/keybinding';
|
|
2
|
+
import { EditorManager } from './editor-manager';
|
|
3
|
+
import { EditorWidget } from './editor-widget';
|
|
4
|
+
export declare namespace EditorKeybindingContexts {
|
|
5
|
+
/**
|
|
6
|
+
* ID of a keybinding context that is enabled when the active text editor has the focus.
|
|
7
|
+
*/
|
|
8
|
+
const editorTextFocus = "editorTextFocus";
|
|
9
|
+
/**
|
|
10
|
+
* ID of a keybinding context that is enabled when the active diff editor has the focus.
|
|
11
|
+
*/
|
|
12
|
+
const diffEditorTextFocus = "diffEditorTextFocus";
|
|
13
|
+
/**
|
|
14
|
+
* Unique identifier of a keybinding context that is enabled if the active editor has the focus but it does not have any overlaying widgets, such as the content assist widget.
|
|
15
|
+
*/
|
|
16
|
+
const strictEditorTextFocus = "strictEditorTextFocus";
|
|
17
|
+
}
|
|
18
|
+
export declare class EditorTextFocusContext implements KeybindingContext {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
protected readonly editorManager: EditorManager;
|
|
21
|
+
isEnabled(): boolean;
|
|
22
|
+
protected getEditor(): EditorWidget | undefined;
|
|
23
|
+
protected canHandle(widget: EditorWidget): boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class DiffEditorTextFocusContext extends EditorTextFocusContext {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
protected canHandle(widget: EditorWidget): boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Keybinding context that is enabled when the active text editor has the focus **AND** it does not
|
|
31
|
+
* have any widgets (for example, the content assist widget) overlaying the active editor.
|
|
32
|
+
*/
|
|
33
|
+
export declare class StrictEditorTextFocusContext extends EditorTextFocusContext {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
}
|
|
36
36
|
//# sourceMappingURL=editor-keybinding-contexts.d.ts.map
|
|
@@ -1,99 +1,99 @@
|
|
|
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 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.StrictEditorTextFocusContext = exports.DiffEditorTextFocusContext = exports.EditorTextFocusContext = exports.EditorKeybindingContexts = void 0;
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const editor_manager_1 = require("./editor-manager");
|
|
30
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
-
var EditorKeybindingContexts;
|
|
32
|
-
(function (EditorKeybindingContexts) {
|
|
33
|
-
/**
|
|
34
|
-
* ID of a keybinding context that is enabled when the active text editor has the focus.
|
|
35
|
-
*/
|
|
36
|
-
EditorKeybindingContexts.editorTextFocus = 'editorTextFocus';
|
|
37
|
-
/**
|
|
38
|
-
* ID of a keybinding context that is enabled when the active diff editor has the focus.
|
|
39
|
-
*/
|
|
40
|
-
EditorKeybindingContexts.diffEditorTextFocus = 'diffEditorTextFocus';
|
|
41
|
-
/**
|
|
42
|
-
* Unique identifier of a keybinding context that is enabled if the active editor has the focus but it does not have any overlaying widgets, such as the content assist widget.
|
|
43
|
-
*/
|
|
44
|
-
EditorKeybindingContexts.strictEditorTextFocus = 'strictEditorTextFocus';
|
|
45
|
-
})(EditorKeybindingContexts = exports.EditorKeybindingContexts || (exports.EditorKeybindingContexts = {}));
|
|
46
|
-
let EditorTextFocusContext = class EditorTextFocusContext {
|
|
47
|
-
constructor() {
|
|
48
|
-
this.id = EditorKeybindingContexts.editorTextFocus;
|
|
49
|
-
}
|
|
50
|
-
isEnabled() {
|
|
51
|
-
return !!this.getEditor();
|
|
52
|
-
}
|
|
53
|
-
getEditor() {
|
|
54
|
-
const widget = this.editorManager.activeEditor;
|
|
55
|
-
if (widget && this.canHandle(widget)) {
|
|
56
|
-
return widget;
|
|
57
|
-
}
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
canHandle(widget) {
|
|
61
|
-
return widget.editor.isFocused();
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, inversify_1.inject)(editor_manager_1.EditorManager),
|
|
66
|
-
__metadata("design:type", editor_manager_1.EditorManager)
|
|
67
|
-
], EditorTextFocusContext.prototype, "editorManager", void 0);
|
|
68
|
-
EditorTextFocusContext = __decorate([
|
|
69
|
-
(0, inversify_1.injectable)()
|
|
70
|
-
], EditorTextFocusContext);
|
|
71
|
-
exports.EditorTextFocusContext = EditorTextFocusContext;
|
|
72
|
-
let DiffEditorTextFocusContext = class DiffEditorTextFocusContext extends EditorTextFocusContext {
|
|
73
|
-
constructor() {
|
|
74
|
-
super(...arguments);
|
|
75
|
-
this.id = EditorKeybindingContexts.diffEditorTextFocus;
|
|
76
|
-
}
|
|
77
|
-
canHandle(widget) {
|
|
78
|
-
return super.canHandle(widget) && browser_1.DiffUris.isDiffUri(widget.editor.uri);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
DiffEditorTextFocusContext = __decorate([
|
|
82
|
-
(0, inversify_1.injectable)()
|
|
83
|
-
], DiffEditorTextFocusContext);
|
|
84
|
-
exports.DiffEditorTextFocusContext = DiffEditorTextFocusContext;
|
|
85
|
-
/**
|
|
86
|
-
* Keybinding context that is enabled when the active text editor has the focus **AND** it does not
|
|
87
|
-
* have any widgets (for example, the content assist widget) overlaying the active editor.
|
|
88
|
-
*/
|
|
89
|
-
let StrictEditorTextFocusContext = class StrictEditorTextFocusContext extends EditorTextFocusContext {
|
|
90
|
-
constructor() {
|
|
91
|
-
super(...arguments);
|
|
92
|
-
this.id = EditorKeybindingContexts.strictEditorTextFocus;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
StrictEditorTextFocusContext = __decorate([
|
|
96
|
-
(0, inversify_1.injectable)()
|
|
97
|
-
], StrictEditorTextFocusContext);
|
|
98
|
-
exports.StrictEditorTextFocusContext = StrictEditorTextFocusContext;
|
|
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 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.StrictEditorTextFocusContext = exports.DiffEditorTextFocusContext = exports.EditorTextFocusContext = exports.EditorKeybindingContexts = void 0;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const editor_manager_1 = require("./editor-manager");
|
|
30
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
+
var EditorKeybindingContexts;
|
|
32
|
+
(function (EditorKeybindingContexts) {
|
|
33
|
+
/**
|
|
34
|
+
* ID of a keybinding context that is enabled when the active text editor has the focus.
|
|
35
|
+
*/
|
|
36
|
+
EditorKeybindingContexts.editorTextFocus = 'editorTextFocus';
|
|
37
|
+
/**
|
|
38
|
+
* ID of a keybinding context that is enabled when the active diff editor has the focus.
|
|
39
|
+
*/
|
|
40
|
+
EditorKeybindingContexts.diffEditorTextFocus = 'diffEditorTextFocus';
|
|
41
|
+
/**
|
|
42
|
+
* Unique identifier of a keybinding context that is enabled if the active editor has the focus but it does not have any overlaying widgets, such as the content assist widget.
|
|
43
|
+
*/
|
|
44
|
+
EditorKeybindingContexts.strictEditorTextFocus = 'strictEditorTextFocus';
|
|
45
|
+
})(EditorKeybindingContexts = exports.EditorKeybindingContexts || (exports.EditorKeybindingContexts = {}));
|
|
46
|
+
let EditorTextFocusContext = class EditorTextFocusContext {
|
|
47
|
+
constructor() {
|
|
48
|
+
this.id = EditorKeybindingContexts.editorTextFocus;
|
|
49
|
+
}
|
|
50
|
+
isEnabled() {
|
|
51
|
+
return !!this.getEditor();
|
|
52
|
+
}
|
|
53
|
+
getEditor() {
|
|
54
|
+
const widget = this.editorManager.activeEditor;
|
|
55
|
+
if (widget && this.canHandle(widget)) {
|
|
56
|
+
return widget;
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
canHandle(widget) {
|
|
61
|
+
return widget.editor.isFocused();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, inversify_1.inject)(editor_manager_1.EditorManager),
|
|
66
|
+
__metadata("design:type", editor_manager_1.EditorManager)
|
|
67
|
+
], EditorTextFocusContext.prototype, "editorManager", void 0);
|
|
68
|
+
EditorTextFocusContext = __decorate([
|
|
69
|
+
(0, inversify_1.injectable)()
|
|
70
|
+
], EditorTextFocusContext);
|
|
71
|
+
exports.EditorTextFocusContext = EditorTextFocusContext;
|
|
72
|
+
let DiffEditorTextFocusContext = class DiffEditorTextFocusContext extends EditorTextFocusContext {
|
|
73
|
+
constructor() {
|
|
74
|
+
super(...arguments);
|
|
75
|
+
this.id = EditorKeybindingContexts.diffEditorTextFocus;
|
|
76
|
+
}
|
|
77
|
+
canHandle(widget) {
|
|
78
|
+
return super.canHandle(widget) && browser_1.DiffUris.isDiffUri(widget.editor.uri);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
DiffEditorTextFocusContext = __decorate([
|
|
82
|
+
(0, inversify_1.injectable)()
|
|
83
|
+
], DiffEditorTextFocusContext);
|
|
84
|
+
exports.DiffEditorTextFocusContext = DiffEditorTextFocusContext;
|
|
85
|
+
/**
|
|
86
|
+
* Keybinding context that is enabled when the active text editor has the focus **AND** it does not
|
|
87
|
+
* have any widgets (for example, the content assist widget) overlaying the active editor.
|
|
88
|
+
*/
|
|
89
|
+
let StrictEditorTextFocusContext = class StrictEditorTextFocusContext extends EditorTextFocusContext {
|
|
90
|
+
constructor() {
|
|
91
|
+
super(...arguments);
|
|
92
|
+
this.id = EditorKeybindingContexts.strictEditorTextFocus;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
StrictEditorTextFocusContext = __decorate([
|
|
96
|
+
(0, inversify_1.injectable)()
|
|
97
|
+
], StrictEditorTextFocusContext);
|
|
98
|
+
exports.StrictEditorTextFocusContext = StrictEditorTextFocusContext;
|
|
99
99
|
//# sourceMappingURL=editor-keybinding-contexts.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
|
|
2
|
-
export declare class EditorKeybindingContribution implements KeybindingContribution {
|
|
3
|
-
registerKeybindings(registry: KeybindingRegistry): void;
|
|
4
|
-
private isElectron;
|
|
5
|
-
}
|
|
1
|
+
import { KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
|
|
2
|
+
export declare class EditorKeybindingContribution implements KeybindingContribution {
|
|
3
|
+
registerKeybindings(registry: KeybindingRegistry): void;
|
|
4
|
+
private isElectron;
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=editor-keybinding.d.ts.map
|
|
@@ -1,56 +1,56 @@
|
|
|
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 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.EditorKeybindingContribution = void 0;
|
|
25
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
-
const environment_1 = require("@theia/core/shared/@theia/application-package/lib/environment");
|
|
27
|
-
const os_1 = require("@theia/core/lib/common/os");
|
|
28
|
-
const editor_command_1 = require("./editor-command");
|
|
29
|
-
let EditorKeybindingContribution = class EditorKeybindingContribution {
|
|
30
|
-
registerKeybindings(registry) {
|
|
31
|
-
registry.registerKeybindings({
|
|
32
|
-
command: editor_command_1.EditorCommands.GO_BACK.id,
|
|
33
|
-
keybinding: os_1.isOSX ? 'ctrl+-' : os_1.isWindows ? 'alt+left' : /* isLinux */ 'ctrl+alt+-'
|
|
34
|
-
}, {
|
|
35
|
-
command: editor_command_1.EditorCommands.GO_FORWARD.id,
|
|
36
|
-
keybinding: os_1.isOSX ? 'ctrl+shift+-' : os_1.isWindows ? 'alt+right' : /* isLinux */ 'ctrl+shift+-'
|
|
37
|
-
}, {
|
|
38
|
-
command: editor_command_1.EditorCommands.GO_LAST_EDIT.id,
|
|
39
|
-
keybinding: 'ctrl+alt+q'
|
|
40
|
-
}, {
|
|
41
|
-
command: editor_command_1.EditorCommands.TOGGLE_WORD_WRAP.id,
|
|
42
|
-
keybinding: 'alt+z'
|
|
43
|
-
}, {
|
|
44
|
-
command: editor_command_1.EditorCommands.REOPEN_CLOSED_EDITOR.id,
|
|
45
|
-
keybinding: this.isElectron() ? 'ctrlcmd+shift+t' : 'alt+shift+t'
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
isElectron() {
|
|
49
|
-
return environment_1.environment.electron.is();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
EditorKeybindingContribution = __decorate([
|
|
53
|
-
(0, inversify_1.injectable)()
|
|
54
|
-
], EditorKeybindingContribution);
|
|
55
|
-
exports.EditorKeybindingContribution = EditorKeybindingContribution;
|
|
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 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.EditorKeybindingContribution = void 0;
|
|
25
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
+
const environment_1 = require("@theia/core/shared/@theia/application-package/lib/environment");
|
|
27
|
+
const os_1 = require("@theia/core/lib/common/os");
|
|
28
|
+
const editor_command_1 = require("./editor-command");
|
|
29
|
+
let EditorKeybindingContribution = class EditorKeybindingContribution {
|
|
30
|
+
registerKeybindings(registry) {
|
|
31
|
+
registry.registerKeybindings({
|
|
32
|
+
command: editor_command_1.EditorCommands.GO_BACK.id,
|
|
33
|
+
keybinding: os_1.isOSX ? 'ctrl+-' : os_1.isWindows ? 'alt+left' : /* isLinux */ 'ctrl+alt+-'
|
|
34
|
+
}, {
|
|
35
|
+
command: editor_command_1.EditorCommands.GO_FORWARD.id,
|
|
36
|
+
keybinding: os_1.isOSX ? 'ctrl+shift+-' : os_1.isWindows ? 'alt+right' : /* isLinux */ 'ctrl+shift+-'
|
|
37
|
+
}, {
|
|
38
|
+
command: editor_command_1.EditorCommands.GO_LAST_EDIT.id,
|
|
39
|
+
keybinding: 'ctrl+alt+q'
|
|
40
|
+
}, {
|
|
41
|
+
command: editor_command_1.EditorCommands.TOGGLE_WORD_WRAP.id,
|
|
42
|
+
keybinding: 'alt+z'
|
|
43
|
+
}, {
|
|
44
|
+
command: editor_command_1.EditorCommands.REOPEN_CLOSED_EDITOR.id,
|
|
45
|
+
keybinding: this.isElectron() ? 'ctrlcmd+shift+t' : 'alt+shift+t'
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
isElectron() {
|
|
49
|
+
return environment_1.environment.electron.is();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
EditorKeybindingContribution = __decorate([
|
|
53
|
+
(0, inversify_1.injectable)()
|
|
54
|
+
], EditorKeybindingContribution);
|
|
55
|
+
exports.EditorKeybindingContribution = EditorKeybindingContribution;
|
|
56
56
|
//# sourceMappingURL=editor-keybinding.js.map
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { RecursivePartial, Emitter, Event, MaybePromise } from '@theia/core/lib/common';
|
|
3
|
-
import { WidgetOpenerOptions, NavigatableWidgetOpenHandler, NavigatableWidgetOptions } from '@theia/core/lib/browser';
|
|
4
|
-
import { EditorWidget } from './editor-widget';
|
|
5
|
-
import { Range, Position, Location, TextEditor } from './editor';
|
|
6
|
-
export interface WidgetId {
|
|
7
|
-
id: number;
|
|
8
|
-
uri: string;
|
|
9
|
-
}
|
|
10
|
-
export interface EditorOpenerOptions extends WidgetOpenerOptions {
|
|
11
|
-
selection?: RecursivePartial<Range>;
|
|
12
|
-
preview?: boolean;
|
|
13
|
-
counter?: number;
|
|
14
|
-
}
|
|
15
|
-
export declare class EditorManager extends NavigatableWidgetOpenHandler<EditorWidget> {
|
|
16
|
-
readonly id: string;
|
|
17
|
-
readonly label = "Code Editor";
|
|
18
|
-
protected readonly editorCounters: Map<string, number>;
|
|
19
|
-
protected readonly onActiveEditorChangedEmitter: Emitter<EditorWidget | undefined>;
|
|
20
|
-
/**
|
|
21
|
-
* Emit when the active editor is changed.
|
|
22
|
-
*/
|
|
23
|
-
readonly onActiveEditorChanged: Event<EditorWidget | undefined>;
|
|
24
|
-
protected readonly onCurrentEditorChangedEmitter: Emitter<EditorWidget | undefined>;
|
|
25
|
-
/**
|
|
26
|
-
* Emit when the current editor is changed.
|
|
27
|
-
*/
|
|
28
|
-
readonly onCurrentEditorChanged: Event<EditorWidget | undefined>;
|
|
29
|
-
protected init(): void;
|
|
30
|
-
getByUri(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget | undefined>;
|
|
31
|
-
getOrCreateByUri(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
32
|
-
protected tryGetPendingWidget(uri: URI, options?: EditorOpenerOptions): MaybePromise<EditorWidget> | undefined;
|
|
33
|
-
protected getWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget | undefined>;
|
|
34
|
-
protected getOrCreateWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
35
|
-
protected readonly recentlyVisibleIds: string[];
|
|
36
|
-
protected get recentlyVisible(): EditorWidget | undefined;
|
|
37
|
-
protected addRecentlyVisible(widget: EditorWidget): void;
|
|
38
|
-
protected removeRecentlyVisible(widget: EditorWidget): void;
|
|
39
|
-
protected _activeEditor: EditorWidget | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* The active editor.
|
|
42
|
-
* If there is an active editor (one that has focus), active and current are the same.
|
|
43
|
-
*/
|
|
44
|
-
get activeEditor(): EditorWidget | undefined;
|
|
45
|
-
protected setActiveEditor(active: EditorWidget | undefined): void;
|
|
46
|
-
protected updateActiveEditor(): void;
|
|
47
|
-
protected _currentEditor: EditorWidget | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* The most recently activated editor (which might not have the focus anymore, hence it is not active).
|
|
50
|
-
* If no editor has focus, e.g. when a context menu is shown, the active editor is `undefined`, but current might be the editor that was active before the menu popped up.
|
|
51
|
-
*/
|
|
52
|
-
get currentEditor(): EditorWidget | undefined;
|
|
53
|
-
protected setCurrentEditor(current: EditorWidget | undefined): void;
|
|
54
|
-
protected updateCurrentEditor(): void;
|
|
55
|
-
canHandle(uri: URI, options?: WidgetOpenerOptions): number;
|
|
56
|
-
open(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
57
|
-
/**
|
|
58
|
-
* Opens an editor to the side of the current editor. Defaults to opening to the right.
|
|
59
|
-
* To modify direction, pass options with `{widgetOptions: {mode: ...}}`
|
|
60
|
-
*/
|
|
61
|
-
openToSide(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
62
|
-
protected revealSelection(widget: EditorWidget, input?: EditorOpenerOptions, uri?: URI): void;
|
|
63
|
-
protected getSelection(widget: EditorWidget, selection: RecursivePartial<Range>): Range | Position | undefined;
|
|
64
|
-
protected removeFromCounter(widget: EditorWidget): void;
|
|
65
|
-
protected extractIdFromWidget(widget: EditorWidget): WidgetId;
|
|
66
|
-
protected checkCounterForWidget(widget: EditorWidget): void;
|
|
67
|
-
protected createCounterForUri(uri: URI): number;
|
|
68
|
-
protected getCounterForUri(uri: URI): number | undefined;
|
|
69
|
-
protected getOrCreateCounterForUri(uri: URI): number;
|
|
70
|
-
protected createWidgetOptions(uri: URI, options?: EditorOpenerOptions): NavigatableWidgetOptions;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Provides direct access to the underlying text editor.
|
|
74
|
-
*/
|
|
75
|
-
export declare abstract class EditorAccess {
|
|
76
|
-
protected readonly editorManager: EditorManager;
|
|
77
|
-
/**
|
|
78
|
-
* The URI of the underlying document from the editor.
|
|
79
|
-
*/
|
|
80
|
-
get uri(): string | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* The selection location from the text editor.
|
|
83
|
-
*/
|
|
84
|
-
get selection(): Location | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* The unique identifier of the language the current editor belongs to.
|
|
87
|
-
*/
|
|
88
|
-
get languageId(): string | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* The text editor.
|
|
91
|
-
*/
|
|
92
|
-
get editor(): TextEditor | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* The editor widget, or `undefined` if not applicable.
|
|
95
|
-
*/
|
|
96
|
-
protected abstract editorWidget(): EditorWidget | undefined;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Provides direct access to the currently active text editor.
|
|
100
|
-
*/
|
|
101
|
-
export declare class CurrentEditorAccess extends EditorAccess {
|
|
102
|
-
protected editorWidget(): EditorWidget | undefined;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Provides access to the active text editor.
|
|
106
|
-
*/
|
|
107
|
-
export declare class ActiveEditorAccess extends EditorAccess {
|
|
108
|
-
protected editorWidget(): EditorWidget | undefined;
|
|
109
|
-
}
|
|
110
|
-
export declare namespace EditorAccess {
|
|
111
|
-
const CURRENT = "current-editor-access";
|
|
112
|
-
const ACTIVE = "active-editor-access";
|
|
113
|
-
}
|
|
1
|
+
import URI from '@theia/core/lib/common/uri';
|
|
2
|
+
import { RecursivePartial, Emitter, Event, MaybePromise } from '@theia/core/lib/common';
|
|
3
|
+
import { WidgetOpenerOptions, NavigatableWidgetOpenHandler, NavigatableWidgetOptions } from '@theia/core/lib/browser';
|
|
4
|
+
import { EditorWidget } from './editor-widget';
|
|
5
|
+
import { Range, Position, Location, TextEditor } from './editor';
|
|
6
|
+
export interface WidgetId {
|
|
7
|
+
id: number;
|
|
8
|
+
uri: string;
|
|
9
|
+
}
|
|
10
|
+
export interface EditorOpenerOptions extends WidgetOpenerOptions {
|
|
11
|
+
selection?: RecursivePartial<Range>;
|
|
12
|
+
preview?: boolean;
|
|
13
|
+
counter?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class EditorManager extends NavigatableWidgetOpenHandler<EditorWidget> {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly label = "Code Editor";
|
|
18
|
+
protected readonly editorCounters: Map<string, number>;
|
|
19
|
+
protected readonly onActiveEditorChangedEmitter: Emitter<EditorWidget | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Emit when the active editor is changed.
|
|
22
|
+
*/
|
|
23
|
+
readonly onActiveEditorChanged: Event<EditorWidget | undefined>;
|
|
24
|
+
protected readonly onCurrentEditorChangedEmitter: Emitter<EditorWidget | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Emit when the current editor is changed.
|
|
27
|
+
*/
|
|
28
|
+
readonly onCurrentEditorChanged: Event<EditorWidget | undefined>;
|
|
29
|
+
protected init(): void;
|
|
30
|
+
getByUri(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget | undefined>;
|
|
31
|
+
getOrCreateByUri(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
32
|
+
protected tryGetPendingWidget(uri: URI, options?: EditorOpenerOptions): MaybePromise<EditorWidget> | undefined;
|
|
33
|
+
protected getWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget | undefined>;
|
|
34
|
+
protected getOrCreateWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
35
|
+
protected readonly recentlyVisibleIds: string[];
|
|
36
|
+
protected get recentlyVisible(): EditorWidget | undefined;
|
|
37
|
+
protected addRecentlyVisible(widget: EditorWidget): void;
|
|
38
|
+
protected removeRecentlyVisible(widget: EditorWidget): void;
|
|
39
|
+
protected _activeEditor: EditorWidget | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The active editor.
|
|
42
|
+
* If there is an active editor (one that has focus), active and current are the same.
|
|
43
|
+
*/
|
|
44
|
+
get activeEditor(): EditorWidget | undefined;
|
|
45
|
+
protected setActiveEditor(active: EditorWidget | undefined): void;
|
|
46
|
+
protected updateActiveEditor(): void;
|
|
47
|
+
protected _currentEditor: EditorWidget | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The most recently activated editor (which might not have the focus anymore, hence it is not active).
|
|
50
|
+
* If no editor has focus, e.g. when a context menu is shown, the active editor is `undefined`, but current might be the editor that was active before the menu popped up.
|
|
51
|
+
*/
|
|
52
|
+
get currentEditor(): EditorWidget | undefined;
|
|
53
|
+
protected setCurrentEditor(current: EditorWidget | undefined): void;
|
|
54
|
+
protected updateCurrentEditor(): void;
|
|
55
|
+
canHandle(uri: URI, options?: WidgetOpenerOptions): number;
|
|
56
|
+
open(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
57
|
+
/**
|
|
58
|
+
* Opens an editor to the side of the current editor. Defaults to opening to the right.
|
|
59
|
+
* To modify direction, pass options with `{widgetOptions: {mode: ...}}`
|
|
60
|
+
*/
|
|
61
|
+
openToSide(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
62
|
+
protected revealSelection(widget: EditorWidget, input?: EditorOpenerOptions, uri?: URI): void;
|
|
63
|
+
protected getSelection(widget: EditorWidget, selection: RecursivePartial<Range>): Range | Position | undefined;
|
|
64
|
+
protected removeFromCounter(widget: EditorWidget): void;
|
|
65
|
+
protected extractIdFromWidget(widget: EditorWidget): WidgetId;
|
|
66
|
+
protected checkCounterForWidget(widget: EditorWidget): void;
|
|
67
|
+
protected createCounterForUri(uri: URI): number;
|
|
68
|
+
protected getCounterForUri(uri: URI): number | undefined;
|
|
69
|
+
protected getOrCreateCounterForUri(uri: URI): number;
|
|
70
|
+
protected createWidgetOptions(uri: URI, options?: EditorOpenerOptions): NavigatableWidgetOptions;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Provides direct access to the underlying text editor.
|
|
74
|
+
*/
|
|
75
|
+
export declare abstract class EditorAccess {
|
|
76
|
+
protected readonly editorManager: EditorManager;
|
|
77
|
+
/**
|
|
78
|
+
* The URI of the underlying document from the editor.
|
|
79
|
+
*/
|
|
80
|
+
get uri(): string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The selection location from the text editor.
|
|
83
|
+
*/
|
|
84
|
+
get selection(): Location | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* The unique identifier of the language the current editor belongs to.
|
|
87
|
+
*/
|
|
88
|
+
get languageId(): string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* The text editor.
|
|
91
|
+
*/
|
|
92
|
+
get editor(): TextEditor | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* The editor widget, or `undefined` if not applicable.
|
|
95
|
+
*/
|
|
96
|
+
protected abstract editorWidget(): EditorWidget | undefined;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Provides direct access to the currently active text editor.
|
|
100
|
+
*/
|
|
101
|
+
export declare class CurrentEditorAccess extends EditorAccess {
|
|
102
|
+
protected editorWidget(): EditorWidget | undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Provides access to the active text editor.
|
|
106
|
+
*/
|
|
107
|
+
export declare class ActiveEditorAccess extends EditorAccess {
|
|
108
|
+
protected editorWidget(): EditorWidget | undefined;
|
|
109
|
+
}
|
|
110
|
+
export declare namespace EditorAccess {
|
|
111
|
+
const CURRENT = "current-editor-access";
|
|
112
|
+
const ACTIVE = "active-editor-access";
|
|
113
|
+
}
|
|
114
114
|
//# sourceMappingURL=editor-manager.d.ts.map
|