@theia/markers 1.45.1 → 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,96 +1,96 @@
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-only 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
- const debounce = require("@theia/core/shared/lodash.debounce");
35
- let ProblemDecorationsProvider = class ProblemDecorationsProvider {
36
- constructor() {
37
- this.currentUris = [];
38
- this.onDidChangeEmitter = new core_1.Emitter();
39
- this.fireDidDecorationsChanged = debounce(() => this.doFireDidDecorationsChanged(), 50);
40
- }
41
- get onDidChange() {
42
- return this.onDidChangeEmitter.event;
43
- }
44
- init() {
45
- this.problemManager.onDidChangeMarkers(() => this.fireDidDecorationsChanged());
46
- }
47
- doFireDidDecorationsChanged() {
48
- const newUris = Array.from(this.problemManager.getUris(), stringified => new uri_1.default(stringified));
49
- this.onDidChangeEmitter.fire(newUris.concat(this.currentUris));
50
- this.currentUris = newUris;
51
- }
52
- provideDecorations(uri, token) {
53
- const markers = this.problemManager.findMarkers({ uri }).filter(problem_utils_1.ProblemUtils.filterMarker).sort(problem_utils_1.ProblemUtils.severityCompareMarker);
54
- if (markers.length) {
55
- return {
56
- bubble: true,
57
- letter: markers.length.toString(),
58
- weight: problem_utils_1.ProblemUtils.getPriority(markers[0]),
59
- colorId: problem_utils_1.ProblemUtils.getColor(markers[0]),
60
- tooltip: markers.length === 1 ? core_1.nls.localizeByDefault('1 problem in this file') : core_1.nls.localizeByDefault('{0} problems in this file', markers.length),
61
- };
62
- }
63
- }
64
- };
65
- __decorate([
66
- (0, inversify_1.inject)(problem_manager_1.ProblemManager),
67
- __metadata("design:type", problem_manager_1.ProblemManager)
68
- ], ProblemDecorationsProvider.prototype, "problemManager", void 0);
69
- __decorate([
70
- (0, inversify_1.postConstruct)(),
71
- __metadata("design:type", Function),
72
- __metadata("design:paramtypes", []),
73
- __metadata("design:returntype", void 0)
74
- ], ProblemDecorationsProvider.prototype, "init", null);
75
- ProblemDecorationsProvider = __decorate([
76
- (0, inversify_1.injectable)()
77
- ], ProblemDecorationsProvider);
78
- exports.ProblemDecorationsProvider = ProblemDecorationsProvider;
79
- let ProblemDecorationContribution = class ProblemDecorationContribution {
80
- initialize() {
81
- this.decorationsService.registerDecorationsProvider(this.problemDecorationProvider);
82
- }
83
- };
84
- __decorate([
85
- (0, inversify_1.inject)(decorations_service_1.DecorationsService),
86
- __metadata("design:type", Object)
87
- ], ProblemDecorationContribution.prototype, "decorationsService", void 0);
88
- __decorate([
89
- (0, inversify_1.inject)(ProblemDecorationsProvider),
90
- __metadata("design:type", ProblemDecorationsProvider)
91
- ], ProblemDecorationContribution.prototype, "problemDecorationProvider", void 0);
92
- ProblemDecorationContribution = __decorate([
93
- (0, inversify_1.injectable)()
94
- ], ProblemDecorationContribution);
95
- 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-only 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
+ const debounce = require("@theia/core/shared/lodash.debounce");
35
+ let ProblemDecorationsProvider = class ProblemDecorationsProvider {
36
+ constructor() {
37
+ this.currentUris = [];
38
+ this.onDidChangeEmitter = new core_1.Emitter();
39
+ this.fireDidDecorationsChanged = debounce(() => this.doFireDidDecorationsChanged(), 50);
40
+ }
41
+ get onDidChange() {
42
+ return this.onDidChangeEmitter.event;
43
+ }
44
+ init() {
45
+ this.problemManager.onDidChangeMarkers(() => this.fireDidDecorationsChanged());
46
+ }
47
+ doFireDidDecorationsChanged() {
48
+ const newUris = Array.from(this.problemManager.getUris(), stringified => new uri_1.default(stringified));
49
+ this.onDidChangeEmitter.fire(newUris.concat(this.currentUris));
50
+ this.currentUris = newUris;
51
+ }
52
+ provideDecorations(uri, token) {
53
+ const markers = this.problemManager.findMarkers({ uri }).filter(problem_utils_1.ProblemUtils.filterMarker).sort(problem_utils_1.ProblemUtils.severityCompareMarker);
54
+ if (markers.length) {
55
+ return {
56
+ bubble: true,
57
+ letter: markers.length.toString(),
58
+ weight: problem_utils_1.ProblemUtils.getPriority(markers[0]),
59
+ colorId: problem_utils_1.ProblemUtils.getColor(markers[0]),
60
+ tooltip: markers.length === 1 ? core_1.nls.localizeByDefault('1 problem in this file') : core_1.nls.localizeByDefault('{0} problems in this file', markers.length),
61
+ };
62
+ }
63
+ }
64
+ };
65
+ __decorate([
66
+ (0, inversify_1.inject)(problem_manager_1.ProblemManager),
67
+ __metadata("design:type", problem_manager_1.ProblemManager)
68
+ ], ProblemDecorationsProvider.prototype, "problemManager", void 0);
69
+ __decorate([
70
+ (0, inversify_1.postConstruct)(),
71
+ __metadata("design:type", Function),
72
+ __metadata("design:paramtypes", []),
73
+ __metadata("design:returntype", void 0)
74
+ ], ProblemDecorationsProvider.prototype, "init", null);
75
+ ProblemDecorationsProvider = __decorate([
76
+ (0, inversify_1.injectable)()
77
+ ], ProblemDecorationsProvider);
78
+ exports.ProblemDecorationsProvider = ProblemDecorationsProvider;
79
+ let ProblemDecorationContribution = class ProblemDecorationContribution {
80
+ initialize() {
81
+ this.decorationsService.registerDecorationsProvider(this.problemDecorationProvider);
82
+ }
83
+ };
84
+ __decorate([
85
+ (0, inversify_1.inject)(decorations_service_1.DecorationsService),
86
+ __metadata("design:type", Object)
87
+ ], ProblemDecorationContribution.prototype, "decorationsService", void 0);
88
+ __decorate([
89
+ (0, inversify_1.inject)(ProblemDecorationsProvider),
90
+ __metadata("design:type", ProblemDecorationsProvider)
91
+ ], ProblemDecorationContribution.prototype, "problemDecorationProvider", void 0);
92
+ ProblemDecorationContribution = __decorate([
93
+ (0, inversify_1.injectable)()
94
+ ], ProblemDecorationContribution);
95
+ exports.ProblemDecorationContribution = ProblemDecorationContribution;
96
96
  //# 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