@theia/markers 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.
Files changed (81) hide show
  1. package/README.md +33 -33
  2. package/lib/browser/index.d.ts +2 -2
  3. package/lib/browser/index.js +29 -29
  4. package/lib/browser/marker-manager.d.ts +47 -47
  5. package/lib/browser/marker-manager.js +187 -187
  6. package/lib/browser/marker-tree-label-provider.d.ts +15 -15
  7. package/lib/browser/marker-tree-label-provider.js +84 -84
  8. package/lib/browser/marker-tree-label-provider.spec.d.ts +1 -1
  9. package/lib/browser/marker-tree-label-provider.spec.js +201 -201
  10. package/lib/browser/marker-tree-model.d.ts +12 -12
  11. package/lib/browser/marker-tree-model.js +60 -60
  12. package/lib/browser/marker-tree.d.ts +42 -42
  13. package/lib/browser/marker-tree.js +143 -143
  14. package/lib/browser/problem/problem-composite-tree-node.d.ts +11 -11
  15. package/lib/browser/problem/problem-composite-tree-node.js +76 -76
  16. package/lib/browser/problem/problem-composite-tree-node.spec.d.ts +1 -1
  17. package/lib/browser/problem/problem-composite-tree-node.spec.js +238 -238
  18. package/lib/browser/problem/problem-container.d.ts +8 -8
  19. package/lib/browser/problem/problem-container.js +46 -46
  20. package/lib/browser/problem/problem-contribution.d.ts +51 -51
  21. package/lib/browser/problem/problem-contribution.js +247 -247
  22. package/lib/browser/problem/problem-decorations-provider.d.ts +21 -21
  23. package/lib/browser/problem/problem-decorations-provider.js +95 -95
  24. package/lib/browser/problem/problem-decorator.d.ts +57 -57
  25. package/lib/browser/problem/problem-decorator.js +233 -233
  26. package/lib/browser/problem/problem-frontend-module.d.ts +4 -4
  27. package/lib/browser/problem/problem-frontend-module.js +55 -55
  28. package/lib/browser/problem/problem-layout-migrations.d.ts +5 -5
  29. package/lib/browser/problem/problem-layout-migrations.js +43 -43
  30. package/lib/browser/problem/problem-manager.d.ts +11 -11
  31. package/lib/browser/problem/problem-manager.js +53 -53
  32. package/lib/browser/problem/problem-manager.spec.d.ts +1 -1
  33. package/lib/browser/problem/problem-manager.spec.js +167 -167
  34. package/lib/browser/problem/problem-preferences.d.ts +13 -13
  35. package/lib/browser/problem/problem-preferences.js +56 -56
  36. package/lib/browser/problem/problem-selection.d.ts +12 -12
  37. package/lib/browser/problem/problem-selection.js +34 -34
  38. package/lib/browser/problem/problem-tabbar-decorator.d.ts +42 -42
  39. package/lib/browser/problem/problem-tabbar-decorator.js +160 -160
  40. package/lib/browser/problem/problem-tree-model.d.ts +32 -32
  41. package/lib/browser/problem/problem-tree-model.js +131 -131
  42. package/lib/browser/problem/problem-tree-model.spec.d.ts +1 -1
  43. package/lib/browser/problem/problem-tree-model.spec.js +172 -172
  44. package/lib/browser/problem/problem-utils.d.ts +44 -44
  45. package/lib/browser/problem/problem-utils.js +84 -84
  46. package/lib/browser/problem/problem-widget-tab-bar-decorator.d.ts +14 -14
  47. package/lib/browser/problem/problem-widget-tab-bar-decorator.js +69 -69
  48. package/lib/browser/problem/problem-widget.d.ts +46 -46
  49. package/lib/browser/problem/problem-widget.js +235 -235
  50. package/lib/common/marker.d.ts +16 -16
  51. package/lib/common/marker.js +31 -31
  52. package/lib/common/problem-marker.d.ts +9 -9
  53. package/lib/common/problem-marker.js +27 -27
  54. package/package.json +6 -6
  55. package/src/browser/index.ts +18 -18
  56. package/src/browser/marker-manager.ts +205 -205
  57. package/src/browser/marker-tree-label-provider.spec.ts +245 -245
  58. package/src/browser/marker-tree-label-provider.ts +75 -75
  59. package/src/browser/marker-tree-model.ts +47 -47
  60. package/src/browser/marker-tree.ts +154 -154
  61. package/src/browser/problem/problem-composite-tree-node.spec.ts +277 -277
  62. package/src/browser/problem/problem-composite-tree-node.ts +81 -81
  63. package/src/browser/problem/problem-container.ts +47 -47
  64. package/src/browser/problem/problem-contribution.ts +247 -247
  65. package/src/browser/problem/problem-decorations-provider.ts +72 -72
  66. package/src/browser/problem/problem-decorator.ts +222 -222
  67. package/src/browser/problem/problem-frontend-module.ts +64 -64
  68. package/src/browser/problem/problem-layout-migrations.ts +32 -32
  69. package/src/browser/problem/problem-manager.spec.ts +216 -216
  70. package/src/browser/problem/problem-manager.ts +51 -51
  71. package/src/browser/problem/problem-preferences.ts +64 -64
  72. package/src/browser/problem/problem-selection.ts +45 -45
  73. package/src/browser/problem/problem-tabbar-decorator.ts +151 -151
  74. package/src/browser/problem/problem-tree-model.spec.ts +189 -189
  75. package/src/browser/problem/problem-tree-model.ts +124 -124
  76. package/src/browser/problem/problem-utils.ts +90 -90
  77. package/src/browser/problem/problem-widget-tab-bar-decorator.ts +55 -55
  78. package/src/browser/problem/problem-widget.tsx +246 -246
  79. package/src/browser/style/index.css +92 -92
  80. package/src/common/marker.ts +53 -53
  81. package/src/common/problem-marker.ts +30 -30
@@ -1,90 +1,90 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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
- import { Marker } from '../../common/marker';
18
- import { Diagnostic, DiagnosticSeverity } from '@theia/core/shared/vscode-languageserver-protocol';
19
-
20
- export namespace ProblemUtils {
21
-
22
- /**
23
- * Comparator for severity.
24
- * - The highest severity (`error`) come first followed by others.
25
- * - `undefined` severities are treated as the last ones.
26
- * @param a the first marker for comparison.
27
- * @param b the second marker for comparison.
28
- */
29
- export const severityCompareMarker = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number =>
30
- (a.data.severity || Number.MAX_SAFE_INTEGER) - (b.data.severity || Number.MAX_SAFE_INTEGER);
31
-
32
- /**
33
- * Comparator for severity.
34
- * - The highest severity (`error`) come first followed by others.
35
- * - `undefined` severities are treated as the last ones.
36
- * @param a the first severity for comparison.
37
- * @param b the second severity for comparison.
38
- */
39
- export const severityCompare = (a: DiagnosticSeverity | undefined, b: DiagnosticSeverity | undefined): number =>
40
- (a || Number.MAX_SAFE_INTEGER) - (b || Number.MAX_SAFE_INTEGER);
41
-
42
- /**
43
- * Comparator for line numbers.
44
- * - The lowest line number comes first.
45
- * @param a the first marker for comparison.
46
- * @param b the second marker for comparison.
47
- */
48
- export const lineNumberCompare = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number => a.data.range.start.line - b.data.range.start.line;
49
-
50
- /**
51
- * Comparator for column numbers.
52
- * - The lowest column number comes first.
53
- * @param a the first marker for comparison.
54
- * @param b the second marker for comparison.
55
- */
56
- export const columnNumberCompare = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number => a.data.range.start.character - b.data.range.start.character;
57
-
58
- /**
59
- * Comparator for marker owner (source).
60
- * - The order is alphabetical.
61
- * @param a the first marker for comparison.
62
- * @param b the second marker for comparison.
63
- */
64
- export const ownerCompare = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number => a.owner.localeCompare(b.owner);
65
-
66
- export function getPriority(marker: Marker<Diagnostic>): number {
67
- const { severity } = marker.data;
68
- switch (severity) {
69
- case DiagnosticSeverity.Error: return 30;
70
- case DiagnosticSeverity.Warning: return 20;
71
- case DiagnosticSeverity.Information: return 10;
72
- default: return 0;
73
- }
74
- }
75
-
76
- export function getColor(marker: Marker<Diagnostic>): string {
77
- const { severity } = marker.data;
78
- switch (severity) {
79
- case DiagnosticSeverity.Error: return 'list.errorForeground';
80
- case DiagnosticSeverity.Warning: return 'list.warningForeground';
81
- default: return ''; // other severities should not be decorated.
82
- }
83
- }
84
-
85
- export function filterMarker(marker: Marker<Diagnostic>): boolean {
86
- const { severity } = marker.data;
87
- return severity === DiagnosticSeverity.Error
88
- || severity === DiagnosticSeverity.Warning;
89
- }
90
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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
+ import { Marker } from '../../common/marker';
18
+ import { Diagnostic, DiagnosticSeverity } from '@theia/core/shared/vscode-languageserver-protocol';
19
+
20
+ export namespace ProblemUtils {
21
+
22
+ /**
23
+ * Comparator for severity.
24
+ * - The highest severity (`error`) come first followed by others.
25
+ * - `undefined` severities are treated as the last ones.
26
+ * @param a the first marker for comparison.
27
+ * @param b the second marker for comparison.
28
+ */
29
+ export const severityCompareMarker = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number =>
30
+ (a.data.severity || Number.MAX_SAFE_INTEGER) - (b.data.severity || Number.MAX_SAFE_INTEGER);
31
+
32
+ /**
33
+ * Comparator for severity.
34
+ * - The highest severity (`error`) come first followed by others.
35
+ * - `undefined` severities are treated as the last ones.
36
+ * @param a the first severity for comparison.
37
+ * @param b the second severity for comparison.
38
+ */
39
+ export const severityCompare = (a: DiagnosticSeverity | undefined, b: DiagnosticSeverity | undefined): number =>
40
+ (a || Number.MAX_SAFE_INTEGER) - (b || Number.MAX_SAFE_INTEGER);
41
+
42
+ /**
43
+ * Comparator for line numbers.
44
+ * - The lowest line number comes first.
45
+ * @param a the first marker for comparison.
46
+ * @param b the second marker for comparison.
47
+ */
48
+ export const lineNumberCompare = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number => a.data.range.start.line - b.data.range.start.line;
49
+
50
+ /**
51
+ * Comparator for column numbers.
52
+ * - The lowest column number comes first.
53
+ * @param a the first marker for comparison.
54
+ * @param b the second marker for comparison.
55
+ */
56
+ export const columnNumberCompare = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number => a.data.range.start.character - b.data.range.start.character;
57
+
58
+ /**
59
+ * Comparator for marker owner (source).
60
+ * - The order is alphabetical.
61
+ * @param a the first marker for comparison.
62
+ * @param b the second marker for comparison.
63
+ */
64
+ export const ownerCompare = (a: Marker<Diagnostic>, b: Marker<Diagnostic>): number => a.owner.localeCompare(b.owner);
65
+
66
+ export function getPriority(marker: Marker<Diagnostic>): number {
67
+ const { severity } = marker.data;
68
+ switch (severity) {
69
+ case DiagnosticSeverity.Error: return 30;
70
+ case DiagnosticSeverity.Warning: return 20;
71
+ case DiagnosticSeverity.Information: return 10;
72
+ default: return 0;
73
+ }
74
+ }
75
+
76
+ export function getColor(marker: Marker<Diagnostic>): string {
77
+ const { severity } = marker.data;
78
+ switch (severity) {
79
+ case DiagnosticSeverity.Error: return 'list.errorForeground';
80
+ case DiagnosticSeverity.Warning: return 'list.warningForeground';
81
+ default: return ''; // other severities should not be decorated.
82
+ }
83
+ }
84
+
85
+ export function filterMarker(marker: Marker<Diagnostic>): boolean {
86
+ const { severity } = marker.data;
87
+ return severity === DiagnosticSeverity.Error
88
+ || severity === DiagnosticSeverity.Warning;
89
+ }
90
+ }
@@ -1,55 +1,55 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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
- import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
18
- import { Event, Emitter } from '@theia/core/lib/common/event';
19
- import { ProblemManager } from './problem-manager';
20
- import { TabBarDecorator } from '@theia/core/lib/browser/shell/tab-bar-decorator';
21
- import { Title, Widget } from '@theia/core/lib/browser';
22
- import { WidgetDecoration } from '@theia/core/lib/browser/widget-decoration';
23
-
24
- @injectable()
25
- export class ProblemWidgetTabBarDecorator implements TabBarDecorator {
26
-
27
- readonly id = 'theia-problems-widget-tabbar-decorator';
28
- protected readonly emitter = new Emitter<void>();
29
-
30
- @inject(ProblemManager)
31
- protected readonly problemManager: ProblemManager;
32
-
33
- @postConstruct()
34
- protected init(): void {
35
- this.problemManager.onDidChangeMarkers(() => this.fireDidChangeDecorations());
36
- }
37
-
38
- decorate(title: Title<Widget>): WidgetDecoration.Data[] {
39
- if (title.owner.id === 'problems') {
40
- const { infos, warnings, errors } = this.problemManager.getProblemStat();
41
- const markerCount = infos + warnings + errors;
42
- return markerCount > 0 ? [{ badge: markerCount }] : [];
43
- } else {
44
- return [];
45
- }
46
- }
47
-
48
- get onDidChangeDecorations(): Event<void> {
49
- return this.emitter.event;
50
- }
51
-
52
- protected fireDidChangeDecorations(): void {
53
- this.emitter.fire(undefined);
54
- }
55
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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
+ import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
18
+ import { Event, Emitter } from '@theia/core/lib/common/event';
19
+ import { ProblemManager } from './problem-manager';
20
+ import { TabBarDecorator } from '@theia/core/lib/browser/shell/tab-bar-decorator';
21
+ import { Title, Widget } from '@theia/core/lib/browser';
22
+ import { WidgetDecoration } from '@theia/core/lib/browser/widget-decoration';
23
+
24
+ @injectable()
25
+ export class ProblemWidgetTabBarDecorator implements TabBarDecorator {
26
+
27
+ readonly id = 'theia-problems-widget-tabbar-decorator';
28
+ protected readonly emitter = new Emitter<void>();
29
+
30
+ @inject(ProblemManager)
31
+ protected readonly problemManager: ProblemManager;
32
+
33
+ @postConstruct()
34
+ protected init(): void {
35
+ this.problemManager.onDidChangeMarkers(() => this.fireDidChangeDecorations());
36
+ }
37
+
38
+ decorate(title: Title<Widget>): WidgetDecoration.Data[] {
39
+ if (title.owner.id === 'problems') {
40
+ const { infos, warnings, errors } = this.problemManager.getProblemStat();
41
+ const markerCount = infos + warnings + errors;
42
+ return markerCount > 0 ? [{ badge: markerCount }] : [];
43
+ } else {
44
+ return [];
45
+ }
46
+ }
47
+
48
+ get onDidChangeDecorations(): Event<void> {
49
+ return this.emitter.event;
50
+ }
51
+
52
+ protected fireDidChangeDecorations(): void {
53
+ this.emitter.fire(undefined);
54
+ }
55
+ }