@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,91 +1,91 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2020 Red Hat, Inc. 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.score = void 0;
|
|
19
|
-
const glob_1 = require("@theia/core/lib/common/glob");
|
|
20
|
-
function score(selector, uriScheme, path, candidateLanguage, candidateIsSynchronized) {
|
|
21
|
-
if (Array.isArray(selector)) {
|
|
22
|
-
let ret = 0;
|
|
23
|
-
for (const filter of selector) {
|
|
24
|
-
const value = score(filter, uriScheme, path, candidateLanguage, candidateIsSynchronized);
|
|
25
|
-
if (value === 10) {
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
if (value > ret) {
|
|
29
|
-
ret = value;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return ret;
|
|
33
|
-
}
|
|
34
|
-
else if (typeof selector === 'string') {
|
|
35
|
-
if (!candidateIsSynchronized) {
|
|
36
|
-
return 0;
|
|
37
|
-
}
|
|
38
|
-
if (selector === '*') {
|
|
39
|
-
return 5;
|
|
40
|
-
}
|
|
41
|
-
else if (selector === candidateLanguage) {
|
|
42
|
-
return 10;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
return 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else if (selector) {
|
|
49
|
-
const { language, pattern, scheme, hasAccessToAllModels } = selector;
|
|
50
|
-
if (!candidateIsSynchronized && !hasAccessToAllModels) {
|
|
51
|
-
return 0;
|
|
52
|
-
}
|
|
53
|
-
let result = 0;
|
|
54
|
-
if (scheme) {
|
|
55
|
-
if (scheme === uriScheme) {
|
|
56
|
-
result = 10;
|
|
57
|
-
}
|
|
58
|
-
else if (scheme === '*') {
|
|
59
|
-
result = 5;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (language) {
|
|
66
|
-
if (language === candidateLanguage) {
|
|
67
|
-
result = 10;
|
|
68
|
-
}
|
|
69
|
-
else if (language === '*') {
|
|
70
|
-
result = Math.max(result, 5);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return 0;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (pattern) {
|
|
77
|
-
if (pattern === path || (0, glob_1.match)(pattern, path)) {
|
|
78
|
-
result = 10;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
return 0;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return 0;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.score = score;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 Red Hat, Inc. 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.score = void 0;
|
|
19
|
+
const glob_1 = require("@theia/core/lib/common/glob");
|
|
20
|
+
function score(selector, uriScheme, path, candidateLanguage, candidateIsSynchronized) {
|
|
21
|
+
if (Array.isArray(selector)) {
|
|
22
|
+
let ret = 0;
|
|
23
|
+
for (const filter of selector) {
|
|
24
|
+
const value = score(filter, uriScheme, path, candidateLanguage, candidateIsSynchronized);
|
|
25
|
+
if (value === 10) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
if (value > ret) {
|
|
29
|
+
ret = value;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return ret;
|
|
33
|
+
}
|
|
34
|
+
else if (typeof selector === 'string') {
|
|
35
|
+
if (!candidateIsSynchronized) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
if (selector === '*') {
|
|
39
|
+
return 5;
|
|
40
|
+
}
|
|
41
|
+
else if (selector === candidateLanguage) {
|
|
42
|
+
return 10;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (selector) {
|
|
49
|
+
const { language, pattern, scheme, hasAccessToAllModels } = selector;
|
|
50
|
+
if (!candidateIsSynchronized && !hasAccessToAllModels) {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
let result = 0;
|
|
54
|
+
if (scheme) {
|
|
55
|
+
if (scheme === uriScheme) {
|
|
56
|
+
result = 10;
|
|
57
|
+
}
|
|
58
|
+
else if (scheme === '*') {
|
|
59
|
+
result = 5;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (language) {
|
|
66
|
+
if (language === candidateLanguage) {
|
|
67
|
+
result = 10;
|
|
68
|
+
}
|
|
69
|
+
else if (language === '*') {
|
|
70
|
+
result = Math.max(result, 5);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (pattern) {
|
|
77
|
+
if (pattern === path || (0, glob_1.match)(pattern, path)) {
|
|
78
|
+
result = 10;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.score = score;
|
|
91
91
|
//# sourceMappingURL=language-selector.js.map
|
package/lib/package.spec.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 Ericsson and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
/* note: this bogus test file is required so that
|
|
17
|
-
we are able to run mocha unit tests on this
|
|
18
|
-
package, without having any actual unit tests in it.
|
|
19
|
-
This way a coverage report will be generated,
|
|
20
|
-
showing 0% coverage, instead of no report.
|
|
21
|
-
This file can be removed once we have real unit
|
|
22
|
-
tests in place. */
|
|
23
|
-
describe('editor package', () => {
|
|
24
|
-
it('support code coverage statistics', () => true);
|
|
25
|
-
});
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/* note: this bogus test file is required so that
|
|
17
|
+
we are able to run mocha unit tests on this
|
|
18
|
+
package, without having any actual unit tests in it.
|
|
19
|
+
This way a coverage report will be generated,
|
|
20
|
+
showing 0% coverage, instead of no report.
|
|
21
|
+
This file can be removed once we have real unit
|
|
22
|
+
tests in place. */
|
|
23
|
+
describe('editor package', () => {
|
|
24
|
+
it('support code coverage statistics', () => true);
|
|
25
|
+
});
|
|
26
26
|
//# sourceMappingURL=package.spec.js.map
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.0-next.72+4a275b29d",
|
|
4
4
|
"description": "Theia - Editor Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.
|
|
7
|
-
"@theia/variable-resolver": "1.
|
|
6
|
+
"@theia/core": "1.46.0-next.72+4a275b29d",
|
|
7
|
+
"@theia/variable-resolver": "1.46.0-next.72+4a275b29d"
|
|
8
8
|
},
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"watch": "theiaext watch"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@theia/ext-scripts": "1.
|
|
42
|
+
"@theia/ext-scripts": "1.46.0"
|
|
43
43
|
},
|
|
44
44
|
"nyc": {
|
|
45
45
|
"extends": "../../configs/nyc.json"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "4a275b29d0db6c81190488c7f76cb667da05ef19"
|
|
48
48
|
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { Disposable } from '@theia/core';
|
|
18
|
-
import { DecorationStyle } from '@theia/core/lib/browser';
|
|
19
|
-
|
|
20
|
-
export class EditorDecorationStyle implements Disposable {
|
|
21
|
-
|
|
22
|
-
constructor(
|
|
23
|
-
readonly selector: string,
|
|
24
|
-
styleProvider: (style: CSSStyleDeclaration) => void,
|
|
25
|
-
protected decorationsStyleSheet: CSSStyleSheet
|
|
26
|
-
) {
|
|
27
|
-
const styleRule = DecorationStyle.getOrCreateStyleRule(selector, decorationsStyleSheet);
|
|
28
|
-
if (styleRule) {
|
|
29
|
-
styleProvider(styleRule.style);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get className(): string {
|
|
34
|
-
return this.selector.split('::')[0];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
dispose(): void {
|
|
38
|
-
DecorationStyle.deleteStyleRule(this.selector, this.decorationsStyleSheet);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Disposable } from '@theia/core';
|
|
18
|
+
import { DecorationStyle } from '@theia/core/lib/browser';
|
|
19
|
+
|
|
20
|
+
export class EditorDecorationStyle implements Disposable {
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
readonly selector: string,
|
|
24
|
+
styleProvider: (style: CSSStyleDeclaration) => void,
|
|
25
|
+
protected decorationsStyleSheet: CSSStyleSheet
|
|
26
|
+
) {
|
|
27
|
+
const styleRule = DecorationStyle.getOrCreateStyleRule(selector, decorationsStyleSheet);
|
|
28
|
+
if (styleRule) {
|
|
29
|
+
styleProvider(styleRule.style);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get className(): string {
|
|
34
|
+
return this.selector.split('::')[0];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
dispose(): void {
|
|
38
|
+
DecorationStyle.deleteStyleRule(this.selector, this.decorationsStyleSheet);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { Range } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
18
|
-
|
|
19
|
-
export interface EditorDecoration {
|
|
20
|
-
/**
|
|
21
|
-
* range to which this decoration instance is applied.
|
|
22
|
-
*/
|
|
23
|
-
range: Range;
|
|
24
|
-
/**
|
|
25
|
-
* options to be applied with this decoration.
|
|
26
|
-
*/
|
|
27
|
-
options: EditorDecorationOptions
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface EditorDecorationOptions {
|
|
31
|
-
/**
|
|
32
|
-
* behavior of decorations when typing/editing near their edges.
|
|
33
|
-
*/
|
|
34
|
-
stickiness?: TrackedRangeStickiness;
|
|
35
|
-
/**
|
|
36
|
-
* CSS class name of this decoration.
|
|
37
|
-
*/
|
|
38
|
-
className?: string;
|
|
39
|
-
/**
|
|
40
|
-
* hover message for this decoration.
|
|
41
|
-
*/
|
|
42
|
-
hoverMessage?: string;
|
|
43
|
-
/**
|
|
44
|
-
* the decoration will be rendered in the glyph margin with this class name.
|
|
45
|
-
*/
|
|
46
|
-
glyphMarginClassName?: string;
|
|
47
|
-
/**
|
|
48
|
-
* hover message for the glyph margin of this decoration.
|
|
49
|
-
*/
|
|
50
|
-
glyphMarginHoverMessage?: string;
|
|
51
|
-
/**
|
|
52
|
-
* should the decoration be rendered for the whole line.
|
|
53
|
-
*/
|
|
54
|
-
isWholeLine?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* the decoration will be rendered in the lines decorations with this class name.
|
|
57
|
-
*/
|
|
58
|
-
linesDecorationsClassName?: string;
|
|
59
|
-
/**
|
|
60
|
-
* the decoration will be rendered in the margin in full width with this class name.
|
|
61
|
-
*/
|
|
62
|
-
marginClassName?: string;
|
|
63
|
-
/**
|
|
64
|
-
* the decoration will be rendered inline with this class name.
|
|
65
|
-
* to be used only to change text, otherwise use `className`.
|
|
66
|
-
*/
|
|
67
|
-
inlineClassName?: string;
|
|
68
|
-
/**
|
|
69
|
-
* the decoration will be rendered before the text with this class name.
|
|
70
|
-
*/
|
|
71
|
-
beforeContentClassName?: string;
|
|
72
|
-
/**
|
|
73
|
-
* the decoration will be rendered after the text with this class name.
|
|
74
|
-
*/
|
|
75
|
-
afterContentClassName?: string;
|
|
76
|
-
/**
|
|
77
|
-
* render this decoration in the overview ruler.
|
|
78
|
-
*/
|
|
79
|
-
overviewRuler?: DecorationOverviewRulerOptions;
|
|
80
|
-
/**
|
|
81
|
-
* If set, render this decoration in the minimap.
|
|
82
|
-
*/
|
|
83
|
-
minimap?: DecorationMinimapOptions;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface DecorationOptions {
|
|
87
|
-
/**
|
|
88
|
-
* color of the decoration in the overview ruler.
|
|
89
|
-
* use `rgba` values to play well with other decorations.
|
|
90
|
-
*/
|
|
91
|
-
color: string | { id: string } | undefined;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* The color to use in dark themes. Will be favored over `color` except in light themes.
|
|
95
|
-
*/
|
|
96
|
-
darkColor?: string | { id: string };
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export enum MinimapPosition {
|
|
100
|
-
Inline = 1,
|
|
101
|
-
Gutter = 2
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface DecorationMinimapOptions extends DecorationOptions {
|
|
105
|
-
position: MinimapPosition;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface DecorationOverviewRulerOptions extends DecorationOptions {
|
|
109
|
-
/**
|
|
110
|
-
* position in the overview ruler.
|
|
111
|
-
*/
|
|
112
|
-
position: OverviewRulerLane;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export enum OverviewRulerLane {
|
|
116
|
-
Left = 1,
|
|
117
|
-
Center = 2,
|
|
118
|
-
Right = 4,
|
|
119
|
-
Full = 7
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export enum TrackedRangeStickiness {
|
|
123
|
-
AlwaysGrowsWhenTypingAtEdges = 0,
|
|
124
|
-
NeverGrowsWhenTypingAtEdges = 1,
|
|
125
|
-
GrowsOnlyWhenTypingBefore = 2,
|
|
126
|
-
GrowsOnlyWhenTypingAfter = 3,
|
|
127
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Range } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
18
|
+
|
|
19
|
+
export interface EditorDecoration {
|
|
20
|
+
/**
|
|
21
|
+
* range to which this decoration instance is applied.
|
|
22
|
+
*/
|
|
23
|
+
range: Range;
|
|
24
|
+
/**
|
|
25
|
+
* options to be applied with this decoration.
|
|
26
|
+
*/
|
|
27
|
+
options: EditorDecorationOptions
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface EditorDecorationOptions {
|
|
31
|
+
/**
|
|
32
|
+
* behavior of decorations when typing/editing near their edges.
|
|
33
|
+
*/
|
|
34
|
+
stickiness?: TrackedRangeStickiness;
|
|
35
|
+
/**
|
|
36
|
+
* CSS class name of this decoration.
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* hover message for this decoration.
|
|
41
|
+
*/
|
|
42
|
+
hoverMessage?: string;
|
|
43
|
+
/**
|
|
44
|
+
* the decoration will be rendered in the glyph margin with this class name.
|
|
45
|
+
*/
|
|
46
|
+
glyphMarginClassName?: string;
|
|
47
|
+
/**
|
|
48
|
+
* hover message for the glyph margin of this decoration.
|
|
49
|
+
*/
|
|
50
|
+
glyphMarginHoverMessage?: string;
|
|
51
|
+
/**
|
|
52
|
+
* should the decoration be rendered for the whole line.
|
|
53
|
+
*/
|
|
54
|
+
isWholeLine?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* the decoration will be rendered in the lines decorations with this class name.
|
|
57
|
+
*/
|
|
58
|
+
linesDecorationsClassName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* the decoration will be rendered in the margin in full width with this class name.
|
|
61
|
+
*/
|
|
62
|
+
marginClassName?: string;
|
|
63
|
+
/**
|
|
64
|
+
* the decoration will be rendered inline with this class name.
|
|
65
|
+
* to be used only to change text, otherwise use `className`.
|
|
66
|
+
*/
|
|
67
|
+
inlineClassName?: string;
|
|
68
|
+
/**
|
|
69
|
+
* the decoration will be rendered before the text with this class name.
|
|
70
|
+
*/
|
|
71
|
+
beforeContentClassName?: string;
|
|
72
|
+
/**
|
|
73
|
+
* the decoration will be rendered after the text with this class name.
|
|
74
|
+
*/
|
|
75
|
+
afterContentClassName?: string;
|
|
76
|
+
/**
|
|
77
|
+
* render this decoration in the overview ruler.
|
|
78
|
+
*/
|
|
79
|
+
overviewRuler?: DecorationOverviewRulerOptions;
|
|
80
|
+
/**
|
|
81
|
+
* If set, render this decoration in the minimap.
|
|
82
|
+
*/
|
|
83
|
+
minimap?: DecorationMinimapOptions;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface DecorationOptions {
|
|
87
|
+
/**
|
|
88
|
+
* color of the decoration in the overview ruler.
|
|
89
|
+
* use `rgba` values to play well with other decorations.
|
|
90
|
+
*/
|
|
91
|
+
color: string | { id: string } | undefined;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The color to use in dark themes. Will be favored over `color` except in light themes.
|
|
95
|
+
*/
|
|
96
|
+
darkColor?: string | { id: string };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export enum MinimapPosition {
|
|
100
|
+
Inline = 1,
|
|
101
|
+
Gutter = 2
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface DecorationMinimapOptions extends DecorationOptions {
|
|
105
|
+
position: MinimapPosition;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface DecorationOverviewRulerOptions extends DecorationOptions {
|
|
109
|
+
/**
|
|
110
|
+
* position in the overview ruler.
|
|
111
|
+
*/
|
|
112
|
+
position: OverviewRulerLane;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export enum OverviewRulerLane {
|
|
116
|
+
Left = 1,
|
|
117
|
+
Center = 2,
|
|
118
|
+
Right = 4,
|
|
119
|
+
Full = 7
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export enum TrackedRangeStickiness {
|
|
123
|
+
AlwaysGrowsWhenTypingAtEdges = 0,
|
|
124
|
+
NeverGrowsWhenTypingAtEdges = 1,
|
|
125
|
+
GrowsOnlyWhenTypingBefore = 2,
|
|
126
|
+
GrowsOnlyWhenTypingAfter = 3,
|
|
127
|
+
}
|