@theia/markers 1.34.3 → 1.34.4

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 (82) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +33 -33
  3. package/lib/browser/index.d.ts +2 -2
  4. package/lib/browser/index.js +29 -29
  5. package/lib/browser/marker-manager.d.ts +47 -47
  6. package/lib/browser/marker-manager.js +187 -187
  7. package/lib/browser/marker-tree-label-provider.d.ts +15 -15
  8. package/lib/browser/marker-tree-label-provider.js +84 -84
  9. package/lib/browser/marker-tree-label-provider.spec.d.ts +1 -1
  10. package/lib/browser/marker-tree-label-provider.spec.js +201 -201
  11. package/lib/browser/marker-tree-model.d.ts +12 -12
  12. package/lib/browser/marker-tree-model.js +60 -60
  13. package/lib/browser/marker-tree.d.ts +42 -42
  14. package/lib/browser/marker-tree.js +143 -143
  15. package/lib/browser/problem/problem-composite-tree-node.d.ts +8 -8
  16. package/lib/browser/problem/problem-composite-tree-node.js +68 -68
  17. package/lib/browser/problem/problem-composite-tree-node.spec.d.ts +1 -1
  18. package/lib/browser/problem/problem-composite-tree-node.spec.js +216 -216
  19. package/lib/browser/problem/problem-container.d.ts +8 -8
  20. package/lib/browser/problem/problem-container.js +42 -42
  21. package/lib/browser/problem/problem-contribution.d.ts +51 -51
  22. package/lib/browser/problem/problem-contribution.js +247 -247
  23. package/lib/browser/problem/problem-decorations-provider.d.ts +18 -18
  24. package/lib/browser/problem/problem-decorations-provider.js +92 -92
  25. package/lib/browser/problem/problem-decorator.d.ts +57 -57
  26. package/lib/browser/problem/problem-decorator.js +233 -233
  27. package/lib/browser/problem/problem-frontend-module.d.ts +4 -4
  28. package/lib/browser/problem/problem-frontend-module.js +55 -55
  29. package/lib/browser/problem/problem-layout-migrations.d.ts +5 -5
  30. package/lib/browser/problem/problem-layout-migrations.js +43 -43
  31. package/lib/browser/problem/problem-manager.d.ts +11 -11
  32. package/lib/browser/problem/problem-manager.js +53 -53
  33. package/lib/browser/problem/problem-manager.spec.d.ts +1 -1
  34. package/lib/browser/problem/problem-manager.spec.js +167 -167
  35. package/lib/browser/problem/problem-preferences.d.ts +13 -13
  36. package/lib/browser/problem/problem-preferences.js +56 -56
  37. package/lib/browser/problem/problem-selection.d.ts +12 -12
  38. package/lib/browser/problem/problem-selection.js +34 -34
  39. package/lib/browser/problem/problem-tabbar-decorator.d.ts +42 -42
  40. package/lib/browser/problem/problem-tabbar-decorator.js +160 -160
  41. package/lib/browser/problem/problem-tree-model.d.ts +26 -26
  42. package/lib/browser/problem/problem-tree-model.js +122 -122
  43. package/lib/browser/problem/problem-tree-model.spec.d.ts +1 -1
  44. package/lib/browser/problem/problem-tree-model.spec.js +172 -172
  45. package/lib/browser/problem/problem-utils.d.ts +44 -44
  46. package/lib/browser/problem/problem-utils.js +84 -84
  47. package/lib/browser/problem/problem-widget-tab-bar-decorator.d.ts +14 -14
  48. package/lib/browser/problem/problem-widget-tab-bar-decorator.js +69 -69
  49. package/lib/browser/problem/problem-widget.d.ts +45 -45
  50. package/lib/browser/problem/problem-widget.js +231 -231
  51. package/lib/common/marker.d.ts +16 -16
  52. package/lib/common/marker.js +31 -31
  53. package/lib/common/problem-marker.d.ts +9 -9
  54. package/lib/common/problem-marker.js +27 -27
  55. package/package.json +6 -6
  56. package/src/browser/index.ts +18 -18
  57. package/src/browser/marker-manager.ts +205 -205
  58. package/src/browser/marker-tree-label-provider.spec.ts +245 -245
  59. package/src/browser/marker-tree-label-provider.ts +75 -75
  60. package/src/browser/marker-tree-model.ts +47 -47
  61. package/src/browser/marker-tree.ts +154 -154
  62. package/src/browser/problem/problem-composite-tree-node.spec.ts +255 -255
  63. package/src/browser/problem/problem-composite-tree-node.ts +68 -68
  64. package/src/browser/problem/problem-container.ts +47 -47
  65. package/src/browser/problem/problem-contribution.ts +247 -247
  66. package/src/browser/problem/problem-decorations-provider.ts +67 -67
  67. package/src/browser/problem/problem-decorator.ts +222 -222
  68. package/src/browser/problem/problem-frontend-module.ts +64 -64
  69. package/src/browser/problem/problem-layout-migrations.ts +32 -32
  70. package/src/browser/problem/problem-manager.spec.ts +216 -216
  71. package/src/browser/problem/problem-manager.ts +51 -51
  72. package/src/browser/problem/problem-preferences.ts +64 -64
  73. package/src/browser/problem/problem-selection.ts +45 -45
  74. package/src/browser/problem/problem-tabbar-decorator.ts +151 -151
  75. package/src/browser/problem/problem-tree-model.spec.ts +189 -189
  76. package/src/browser/problem/problem-tree-model.ts +113 -113
  77. package/src/browser/problem/problem-utils.ts +90 -90
  78. package/src/browser/problem/problem-widget-tab-bar-decorator.ts +55 -55
  79. package/src/browser/problem/problem-widget.tsx +241 -241
  80. package/src/browser/style/index.css +92 -92
  81. package/src/common/marker.ts +53 -53
  82. package/src/common/problem-marker.ts +30 -30
@@ -1,93 +1,93 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2022 Ericsson 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.ProblemDecorationContribution = exports.ProblemDecorationsProvider = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const uri_1 = require("@theia/core/lib/common/uri");
30
- const decorations_service_1 = require("@theia/core/lib/browser/decorations-service");
31
- const problem_manager_1 = require("./problem-manager");
32
- const problem_utils_1 = require("./problem-utils");
33
- const core_1 = require("@theia/core");
34
- let ProblemDecorationsProvider = class ProblemDecorationsProvider {
35
- constructor() {
36
- this.currentUris = [];
37
- this.onDidChangeEmitter = new core_1.Emitter();
38
- }
39
- get onDidChange() {
40
- return this.onDidChangeEmitter.event;
41
- }
42
- init() {
43
- this.problemManager.onDidChangeMarkers(() => {
44
- const newUris = Array.from(this.problemManager.getUris(), stringified => new uri_1.default(stringified));
45
- this.onDidChangeEmitter.fire(newUris.concat(this.currentUris));
46
- this.currentUris = newUris;
47
- });
48
- }
49
- provideDecorations(uri, token) {
50
- const markers = this.problemManager.findMarkers({ uri }).filter(problem_utils_1.ProblemUtils.filterMarker).sort(problem_utils_1.ProblemUtils.severityCompareMarker);
51
- if (markers.length) {
52
- return {
53
- bubble: true,
54
- letter: markers.length.toString(),
55
- weight: problem_utils_1.ProblemUtils.getPriority(markers[0]),
56
- colorId: problem_utils_1.ProblemUtils.getColor(markers[0]),
57
- tooltip: markers.length === 1 ? core_1.nls.localizeByDefault('1 problem in this file') : core_1.nls.localizeByDefault('{0} problems in this file', markers.length),
58
- };
59
- }
60
- }
61
- };
62
- __decorate([
63
- (0, inversify_1.inject)(problem_manager_1.ProblemManager),
64
- __metadata("design:type", problem_manager_1.ProblemManager)
65
- ], ProblemDecorationsProvider.prototype, "problemManager", void 0);
66
- __decorate([
67
- (0, inversify_1.postConstruct)(),
68
- __metadata("design:type", Function),
69
- __metadata("design:paramtypes", []),
70
- __metadata("design:returntype", void 0)
71
- ], ProblemDecorationsProvider.prototype, "init", null);
72
- ProblemDecorationsProvider = __decorate([
73
- (0, inversify_1.injectable)()
74
- ], ProblemDecorationsProvider);
75
- exports.ProblemDecorationsProvider = ProblemDecorationsProvider;
76
- let ProblemDecorationContribution = class ProblemDecorationContribution {
77
- initialize() {
78
- this.decorationsService.registerDecorationsProvider(this.problemDecorationProvider);
79
- }
80
- };
81
- __decorate([
82
- (0, inversify_1.inject)(decorations_service_1.DecorationsService),
83
- __metadata("design:type", Object)
84
- ], ProblemDecorationContribution.prototype, "decorationsService", void 0);
85
- __decorate([
86
- (0, inversify_1.inject)(ProblemDecorationsProvider),
87
- __metadata("design:type", ProblemDecorationsProvider)
88
- ], ProblemDecorationContribution.prototype, "problemDecorationProvider", void 0);
89
- ProblemDecorationContribution = __decorate([
90
- (0, inversify_1.injectable)()
91
- ], ProblemDecorationContribution);
92
- exports.ProblemDecorationContribution = ProblemDecorationContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2022 Ericsson 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.ProblemDecorationContribution = exports.ProblemDecorationsProvider = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const uri_1 = require("@theia/core/lib/common/uri");
30
+ const decorations_service_1 = require("@theia/core/lib/browser/decorations-service");
31
+ const problem_manager_1 = require("./problem-manager");
32
+ const problem_utils_1 = require("./problem-utils");
33
+ const core_1 = require("@theia/core");
34
+ let ProblemDecorationsProvider = class ProblemDecorationsProvider {
35
+ constructor() {
36
+ this.currentUris = [];
37
+ this.onDidChangeEmitter = new core_1.Emitter();
38
+ }
39
+ get onDidChange() {
40
+ return this.onDidChangeEmitter.event;
41
+ }
42
+ init() {
43
+ this.problemManager.onDidChangeMarkers(() => {
44
+ const newUris = Array.from(this.problemManager.getUris(), stringified => new uri_1.default(stringified));
45
+ this.onDidChangeEmitter.fire(newUris.concat(this.currentUris));
46
+ this.currentUris = newUris;
47
+ });
48
+ }
49
+ provideDecorations(uri, token) {
50
+ const markers = this.problemManager.findMarkers({ uri }).filter(problem_utils_1.ProblemUtils.filterMarker).sort(problem_utils_1.ProblemUtils.severityCompareMarker);
51
+ if (markers.length) {
52
+ return {
53
+ bubble: true,
54
+ letter: markers.length.toString(),
55
+ weight: problem_utils_1.ProblemUtils.getPriority(markers[0]),
56
+ colorId: problem_utils_1.ProblemUtils.getColor(markers[0]),
57
+ tooltip: markers.length === 1 ? core_1.nls.localizeByDefault('1 problem in this file') : core_1.nls.localizeByDefault('{0} problems in this file', markers.length),
58
+ };
59
+ }
60
+ }
61
+ };
62
+ __decorate([
63
+ (0, inversify_1.inject)(problem_manager_1.ProblemManager),
64
+ __metadata("design:type", problem_manager_1.ProblemManager)
65
+ ], ProblemDecorationsProvider.prototype, "problemManager", void 0);
66
+ __decorate([
67
+ (0, inversify_1.postConstruct)(),
68
+ __metadata("design:type", Function),
69
+ __metadata("design:paramtypes", []),
70
+ __metadata("design:returntype", void 0)
71
+ ], ProblemDecorationsProvider.prototype, "init", null);
72
+ ProblemDecorationsProvider = __decorate([
73
+ (0, inversify_1.injectable)()
74
+ ], ProblemDecorationsProvider);
75
+ exports.ProblemDecorationsProvider = ProblemDecorationsProvider;
76
+ let ProblemDecorationContribution = class ProblemDecorationContribution {
77
+ initialize() {
78
+ this.decorationsService.registerDecorationsProvider(this.problemDecorationProvider);
79
+ }
80
+ };
81
+ __decorate([
82
+ (0, inversify_1.inject)(decorations_service_1.DecorationsService),
83
+ __metadata("design:type", Object)
84
+ ], ProblemDecorationContribution.prototype, "decorationsService", void 0);
85
+ __decorate([
86
+ (0, inversify_1.inject)(ProblemDecorationsProvider),
87
+ __metadata("design:type", ProblemDecorationsProvider)
88
+ ], ProblemDecorationContribution.prototype, "problemDecorationProvider", void 0);
89
+ ProblemDecorationContribution = __decorate([
90
+ (0, inversify_1.injectable)()
91
+ ], ProblemDecorationContribution);
92
+ exports.ProblemDecorationContribution = ProblemDecorationContribution;
93
93
  //# sourceMappingURL=problem-decorations-provider.js.map
@@ -1,58 +1,58 @@
1
- import { Diagnostic } from '@theia/core/shared/vscode-languageserver-protocol';
2
- import URI from '@theia/core/lib/common/uri';
3
- import { Event, Emitter } from '@theia/core/lib/common/event';
4
- import { Tree, TreeNode } from '@theia/core/lib/browser/tree/tree';
5
- import { TreeDecorator, TreeDecoration } from '@theia/core/lib/browser/tree/tree-decorator';
6
- import { Marker } from '../../common/marker';
7
- import { ProblemManager } from './problem-manager';
8
- import { ProblemPreferences } from './problem-preferences';
9
- import { LabelProvider } from '@theia/core/lib/browser';
10
- import { WorkspaceService } from '@theia/workspace/lib/browser';
11
- /**
12
- * @deprecated since 1.25.0
13
- * URI-based decorators should implement `DecorationsProvider` and contribute decorations via the `DecorationsService`.
14
- */
15
- export declare class ProblemDecorator implements TreeDecorator {
16
- protected readonly problemManager: ProblemManager;
17
- protected problemPreferences: ProblemPreferences;
18
- protected readonly workspaceService: WorkspaceService;
19
- protected readonly labelProvider: LabelProvider;
20
- readonly id = "theia-problem-decorator";
21
- protected readonly emitter: Emitter<(tree: Tree) => Map<string, TreeDecoration.Data>>;
22
- constructor(problemManager: ProblemManager);
23
- protected init(): void;
24
- decorations(tree: Tree): Promise<Map<string, TreeDecoration.Data>>;
25
- get onDidChangeDecorations(): Event<(tree: Tree) => Map<string, TreeDecoration.Data>>;
26
- protected fireDidChangeDecorations(event: (tree: Tree) => Map<string, TreeDecoration.Data>): void;
27
- protected collectDecorators(tree: Tree): Map<string, TreeDecoration.Data>;
28
- protected generateCaptionSuffix(nodeURI: URI): string;
29
- /**
30
- * Traverses up the tree from the given node and attaches decorations to any parents.
31
- */
32
- protected appendContainerMarkers(node: TreeNode, decoration: TreeDecoration.Data, decorations: Map<string, TreeDecoration.Data>): void;
33
- /**
34
- * @returns a map matching stringified URI's to a decoration whose features reflect the highest-severity problem found
35
- * and the number of problems found (based on {@link ProblemDecorator.toDecorator })
36
- */
37
- protected collectMarkers(tree: Tree): Map<string, TreeDecoration.Data>;
38
- protected toDecorator(markers: Marker<Diagnostic>[]): TreeDecoration.Data;
39
- protected getColor(marker: Marker<Diagnostic>): TreeDecoration.Color;
40
- /**
41
- * Get the decoration for a given marker diagnostic.
42
- * Markers with higher severity have a higher priority and should be displayed.
43
- * @param marker the diagnostic marker.
44
- */
45
- protected getPriority(marker: Marker<Diagnostic>): number;
46
- /**
47
- * Returns `true` if the diagnostic (`data`) of the marker argument has `Error`, `Warning`, or `Information` severity.
48
- * Otherwise, returns `false`.
49
- */
50
- protected filterMarker(marker: Marker<Diagnostic>): boolean;
51
- protected getUriFromNode(node: TreeNode): string | undefined;
52
- protected compare(left: Marker<Diagnostic>, right: Marker<Diagnostic>): number;
53
- protected compareDecorators(left: TreeDecoration.Data, right: TreeDecoration.Data): number;
54
- }
55
- export declare namespace ProblemDecorator {
56
- const severityCompare: (a: Marker<Diagnostic>, b: Marker<Diagnostic>) => number;
57
- }
1
+ import { Diagnostic } from '@theia/core/shared/vscode-languageserver-protocol';
2
+ import URI from '@theia/core/lib/common/uri';
3
+ import { Event, Emitter } from '@theia/core/lib/common/event';
4
+ import { Tree, TreeNode } from '@theia/core/lib/browser/tree/tree';
5
+ import { TreeDecorator, TreeDecoration } from '@theia/core/lib/browser/tree/tree-decorator';
6
+ import { Marker } from '../../common/marker';
7
+ import { ProblemManager } from './problem-manager';
8
+ import { ProblemPreferences } from './problem-preferences';
9
+ import { LabelProvider } from '@theia/core/lib/browser';
10
+ import { WorkspaceService } from '@theia/workspace/lib/browser';
11
+ /**
12
+ * @deprecated since 1.25.0
13
+ * URI-based decorators should implement `DecorationsProvider` and contribute decorations via the `DecorationsService`.
14
+ */
15
+ export declare class ProblemDecorator implements TreeDecorator {
16
+ protected readonly problemManager: ProblemManager;
17
+ protected problemPreferences: ProblemPreferences;
18
+ protected readonly workspaceService: WorkspaceService;
19
+ protected readonly labelProvider: LabelProvider;
20
+ readonly id = "theia-problem-decorator";
21
+ protected readonly emitter: Emitter<(tree: Tree) => Map<string, TreeDecoration.Data>>;
22
+ constructor(problemManager: ProblemManager);
23
+ protected init(): void;
24
+ decorations(tree: Tree): Promise<Map<string, TreeDecoration.Data>>;
25
+ get onDidChangeDecorations(): Event<(tree: Tree) => Map<string, TreeDecoration.Data>>;
26
+ protected fireDidChangeDecorations(event: (tree: Tree) => Map<string, TreeDecoration.Data>): void;
27
+ protected collectDecorators(tree: Tree): Map<string, TreeDecoration.Data>;
28
+ protected generateCaptionSuffix(nodeURI: URI): string;
29
+ /**
30
+ * Traverses up the tree from the given node and attaches decorations to any parents.
31
+ */
32
+ protected appendContainerMarkers(node: TreeNode, decoration: TreeDecoration.Data, decorations: Map<string, TreeDecoration.Data>): void;
33
+ /**
34
+ * @returns a map matching stringified URI's to a decoration whose features reflect the highest-severity problem found
35
+ * and the number of problems found (based on {@link ProblemDecorator.toDecorator })
36
+ */
37
+ protected collectMarkers(tree: Tree): Map<string, TreeDecoration.Data>;
38
+ protected toDecorator(markers: Marker<Diagnostic>[]): TreeDecoration.Data;
39
+ protected getColor(marker: Marker<Diagnostic>): TreeDecoration.Color;
40
+ /**
41
+ * Get the decoration for a given marker diagnostic.
42
+ * Markers with higher severity have a higher priority and should be displayed.
43
+ * @param marker the diagnostic marker.
44
+ */
45
+ protected getPriority(marker: Marker<Diagnostic>): number;
46
+ /**
47
+ * Returns `true` if the diagnostic (`data`) of the marker argument has `Error`, `Warning`, or `Information` severity.
48
+ * Otherwise, returns `false`.
49
+ */
50
+ protected filterMarker(marker: Marker<Diagnostic>): boolean;
51
+ protected getUriFromNode(node: TreeNode): string | undefined;
52
+ protected compare(left: Marker<Diagnostic>, right: Marker<Diagnostic>): number;
53
+ protected compareDecorators(left: TreeDecoration.Data, right: TreeDecoration.Data): number;
54
+ }
55
+ export declare namespace ProblemDecorator {
56
+ const severityCompare: (a: Marker<Diagnostic>, b: Marker<Diagnostic>) => number;
57
+ }
58
58
  //# sourceMappingURL=problem-decorator.d.ts.map