@theia/editor 1.53.0-next.55 → 1.53.0-next.64

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.
Files changed (42) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/editor-manager.d.ts.map +1 -1
  3. package/lib/browser/editor-manager.js +2 -4
  4. package/lib/browser/editor-manager.js.map +1 -1
  5. package/lib/browser/navigation/navigation-location-service.js +3 -3
  6. package/package.json +4 -4
  7. package/src/browser/decorations/editor-decoration-style.ts +41 -41
  8. package/src/browser/decorations/editor-decoration.ts +127 -127
  9. package/src/browser/decorations/editor-decorator.ts +36 -36
  10. package/src/browser/decorations/index.ts +19 -19
  11. package/src/browser/diff-navigator.ts +27 -27
  12. package/src/browser/editor-command.ts +393 -393
  13. package/src/browser/editor-contribution.ts +185 -185
  14. package/src/browser/editor-frontend-module.ts +90 -90
  15. package/src/browser/editor-generated-preference-schema.ts +2956 -2956
  16. package/src/browser/editor-keybinding.ts +55 -55
  17. package/src/browser/editor-language-quick-pick-service.ts +68 -68
  18. package/src/browser/editor-linenumber-contribution.ts +88 -88
  19. package/src/browser/editor-manager.ts +460 -462
  20. package/src/browser/editor-menu.ts +224 -224
  21. package/src/browser/editor-navigation-contribution.ts +343 -343
  22. package/src/browser/editor-preferences.ts +226 -226
  23. package/src/browser/editor-variable-contribution.ts +62 -62
  24. package/src/browser/editor-widget-factory.ts +82 -82
  25. package/src/browser/editor-widget.ts +139 -139
  26. package/src/browser/editor.ts +366 -366
  27. package/src/browser/index.ts +26 -26
  28. package/src/browser/language-status/editor-language-status-service.ts +271 -271
  29. package/src/browser/language-status/editor-language-status.css +101 -101
  30. package/src/browser/navigation/navigation-location-service.spec.ts +245 -245
  31. package/src/browser/navigation/navigation-location-service.ts +284 -284
  32. package/src/browser/navigation/navigation-location-similarity.spec.ts +46 -46
  33. package/src/browser/navigation/navigation-location-similarity.ts +58 -58
  34. package/src/browser/navigation/navigation-location-updater.spec.ts +197 -197
  35. package/src/browser/navigation/navigation-location-updater.ts +220 -220
  36. package/src/browser/navigation/navigation-location.ts +418 -418
  37. package/src/browser/navigation/test/mock-navigation-location-updater.ts +41 -41
  38. package/src/browser/quick-editor-service.ts +94 -94
  39. package/src/browser/style/index.css +19 -19
  40. package/src/browser/undo-redo-service.ts +120 -120
  41. package/src/common/language-selector.ts +104 -104
  42. package/src/package.spec.ts +28 -28
@@ -1,104 +1,104 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 Red Hat, Inc. 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 { match as matchGlobPattern } from '@theia/core/lib/common/glob';
18
-
19
- export interface RelativePattern {
20
- base: string;
21
- pattern: string;
22
- pathToRelative(from: string, to: string): string;
23
- }
24
-
25
- export interface LanguageFilter {
26
- language?: string;
27
- scheme?: string;
28
- pattern?: string | RelativePattern;
29
- hasAccessToAllModels?: boolean;
30
- }
31
- export type LanguageSelector = string | LanguageFilter | (string | LanguageFilter)[];
32
-
33
- export function score(selector: LanguageSelector | undefined, uriScheme: string, path: string, candidateLanguage: string, candidateIsSynchronized: boolean): number {
34
-
35
- if (Array.isArray(selector)) {
36
- let ret = 0;
37
- for (const filter of selector) {
38
- const value = score(filter, uriScheme, path, candidateLanguage, candidateIsSynchronized);
39
- if (value === 10) {
40
- return value;
41
- }
42
- if (value > ret) {
43
- ret = value;
44
- }
45
- }
46
- return ret;
47
-
48
- } else if (typeof selector === 'string') {
49
-
50
- if (!candidateIsSynchronized) {
51
- return 0;
52
- }
53
-
54
- if (selector === '*') {
55
- return 5;
56
- } else if (selector === candidateLanguage) {
57
- return 10;
58
- } else {
59
- return 0;
60
- }
61
-
62
- } else if (selector) {
63
- const { language, pattern, scheme, hasAccessToAllModels } = selector;
64
-
65
- if (!candidateIsSynchronized && !hasAccessToAllModels) {
66
- return 0;
67
- }
68
-
69
- let result = 0;
70
-
71
- if (scheme) {
72
- if (scheme === uriScheme) {
73
- result = 10;
74
- } else if (scheme === '*') {
75
- result = 5;
76
- } else {
77
- return 0;
78
- }
79
- }
80
-
81
- if (language) {
82
- if (language === candidateLanguage) {
83
- result = 10;
84
- } else if (language === '*') {
85
- result = Math.max(result, 5);
86
- } else {
87
- return 0;
88
- }
89
- }
90
-
91
- if (pattern) {
92
- if (pattern === path || matchGlobPattern(pattern, path)) {
93
- result = 10;
94
- } else {
95
- return 0;
96
- }
97
- }
98
-
99
- return result;
100
-
101
- } else {
102
- return 0;
103
- }
104
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 Red Hat, Inc. 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 { match as matchGlobPattern } from '@theia/core/lib/common/glob';
18
+
19
+ export interface RelativePattern {
20
+ base: string;
21
+ pattern: string;
22
+ pathToRelative(from: string, to: string): string;
23
+ }
24
+
25
+ export interface LanguageFilter {
26
+ language?: string;
27
+ scheme?: string;
28
+ pattern?: string | RelativePattern;
29
+ hasAccessToAllModels?: boolean;
30
+ }
31
+ export type LanguageSelector = string | LanguageFilter | (string | LanguageFilter)[];
32
+
33
+ export function score(selector: LanguageSelector | undefined, uriScheme: string, path: string, candidateLanguage: string, candidateIsSynchronized: boolean): number {
34
+
35
+ if (Array.isArray(selector)) {
36
+ let ret = 0;
37
+ for (const filter of selector) {
38
+ const value = score(filter, uriScheme, path, candidateLanguage, candidateIsSynchronized);
39
+ if (value === 10) {
40
+ return value;
41
+ }
42
+ if (value > ret) {
43
+ ret = value;
44
+ }
45
+ }
46
+ return ret;
47
+
48
+ } else if (typeof selector === 'string') {
49
+
50
+ if (!candidateIsSynchronized) {
51
+ return 0;
52
+ }
53
+
54
+ if (selector === '*') {
55
+ return 5;
56
+ } else if (selector === candidateLanguage) {
57
+ return 10;
58
+ } else {
59
+ return 0;
60
+ }
61
+
62
+ } else if (selector) {
63
+ const { language, pattern, scheme, hasAccessToAllModels } = selector;
64
+
65
+ if (!candidateIsSynchronized && !hasAccessToAllModels) {
66
+ return 0;
67
+ }
68
+
69
+ let result = 0;
70
+
71
+ if (scheme) {
72
+ if (scheme === uriScheme) {
73
+ result = 10;
74
+ } else if (scheme === '*') {
75
+ result = 5;
76
+ } else {
77
+ return 0;
78
+ }
79
+ }
80
+
81
+ if (language) {
82
+ if (language === candidateLanguage) {
83
+ result = 10;
84
+ } else if (language === '*') {
85
+ result = Math.max(result, 5);
86
+ } else {
87
+ return 0;
88
+ }
89
+ }
90
+
91
+ if (pattern) {
92
+ if (pattern === path || matchGlobPattern(pattern, path)) {
93
+ result = 10;
94
+ } else {
95
+ return 0;
96
+ }
97
+ }
98
+
99
+ return result;
100
+
101
+ } else {
102
+ return 0;
103
+ }
104
+ }
@@ -1,28 +1,28 @@
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
-
17
- /* note: this bogus test file is required so that
18
- we are able to run mocha unit tests on this
19
- package, without having any actual unit tests in it.
20
- This way a coverage report will be generated,
21
- showing 0% coverage, instead of no report.
22
- This file can be removed once we have real unit
23
- tests in place. */
24
-
25
- describe('editor package', () => {
26
-
27
- it('support code coverage statistics', () => true);
28
- });
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
+
17
+ /* note: this bogus test file is required so that
18
+ we are able to run mocha unit tests on this
19
+ package, without having any actual unit tests in it.
20
+ This way a coverage report will be generated,
21
+ showing 0% coverage, instead of no report.
22
+ This file can be removed once we have real unit
23
+ tests in place. */
24
+
25
+ describe('editor package', () => {
26
+
27
+ it('support code coverage statistics', () => true);
28
+ });