@theia/test 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 (53) hide show
  1. package/lib/browser/constants.d.ts +45 -45
  2. package/lib/browser/constants.js +17 -17
  3. package/lib/browser/test-service.d.ts +154 -154
  4. package/lib/browser/test-service.js +247 -247
  5. package/lib/browser/view/test-context-key-service.d.ts +7 -7
  6. package/lib/browser/view/test-context-key-service.js +51 -51
  7. package/lib/browser/view/test-execution-state-manager.d.ts +13 -13
  8. package/lib/browser/view/test-execution-state-manager.js +173 -173
  9. package/lib/browser/view/test-output-ui-model.d.ts +47 -47
  10. package/lib/browser/view/test-output-ui-model.js +151 -151
  11. package/lib/browser/view/test-output-view-contribution.d.ts +5 -5
  12. package/lib/browser/view/test-output-view-contribution.js +47 -47
  13. package/lib/browser/view/test-output-widget.d.ts +24 -24
  14. package/lib/browser/view/test-output-widget.js +158 -158
  15. package/lib/browser/view/test-result-view-contribution.d.ts +5 -5
  16. package/lib/browser/view/test-result-view-contribution.js +47 -47
  17. package/lib/browser/view/test-result-widget.d.ts +20 -20
  18. package/lib/browser/view/test-result-widget.js +108 -108
  19. package/lib/browser/view/test-run-view-contribution.d.ts +17 -17
  20. package/lib/browser/view/test-run-view-contribution.js +100 -100
  21. package/lib/browser/view/test-run-widget.d.ts +58 -58
  22. package/lib/browser/view/test-run-widget.js +310 -310
  23. package/lib/browser/view/test-tree-widget.d.ts +67 -67
  24. package/lib/browser/view/test-tree-widget.js +386 -386
  25. package/lib/browser/view/test-view-contribution.d.ts +45 -45
  26. package/lib/browser/view/test-view-contribution.js +288 -288
  27. package/lib/browser/view/test-view-frontend-module.d.ts +6 -6
  28. package/lib/browser/view/test-view-frontend-module.js +121 -121
  29. package/lib/common/collections.d.ts +46 -46
  30. package/lib/common/collections.js +210 -210
  31. package/lib/common/tree-delta.d.ts +51 -51
  32. package/lib/common/tree-delta.js +240 -240
  33. package/lib/common/tree-delta.spec.d.ts +1 -1
  34. package/lib/common/tree-delta.spec.js +139 -139
  35. package/package.json +8 -8
  36. package/src/browser/constants.ts +71 -71
  37. package/src/browser/style/index.css +41 -41
  38. package/src/browser/test-service.ts +355 -355
  39. package/src/browser/view/test-context-key-service.ts +36 -36
  40. package/src/browser/view/test-execution-state-manager.ts +147 -147
  41. package/src/browser/view/test-output-ui-model.ts +156 -156
  42. package/src/browser/view/test-output-view-contribution.ts +34 -34
  43. package/src/browser/view/test-output-widget.ts +148 -148
  44. package/src/browser/view/test-result-view-contribution.ts +34 -34
  45. package/src/browser/view/test-result-widget.ts +92 -92
  46. package/src/browser/view/test-run-view-contribution.ts +89 -89
  47. package/src/browser/view/test-run-widget.tsx +271 -271
  48. package/src/browser/view/test-tree-widget.tsx +360 -360
  49. package/src/browser/view/test-view-contribution.ts +300 -300
  50. package/src/browser/view/test-view-frontend-module.ts +134 -134
  51. package/src/common/collections.ts +223 -223
  52. package/src/common/tree-delta.spec.ts +166 -166
  53. package/src/common/tree-delta.ts +259 -259
@@ -1,109 +1,109 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 STMicroelectronics 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
- var TestResultWidget_1;
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.TestResultWidget = void 0;
29
- const browser_1 = require("@theia/core/lib/browser");
30
- const inversify_1 = require("@theia/core/shared/inversify");
31
- const test_output_ui_model_1 = require("./test-output-ui-model");
32
- const core_1 = require("@theia/core");
33
- const test_service_1 = require("../test-service");
34
- const markdown_renderer_1 = require("@theia/core/lib/browser/markdown-rendering/markdown-renderer");
35
- const markdown_rendering_1 = require("@theia/core/lib/common/markdown-rendering");
36
- let TestResultWidget = TestResultWidget_1 = class TestResultWidget extends browser_1.BaseWidget {
37
- constructor() {
38
- super();
39
- this.toDisposeOnRender = new core_1.DisposableCollection();
40
- this.input = [];
41
- this.id = TestResultWidget_1.ID;
42
- this.title.label = core_1.nls.localizeByDefault('Test Results');
43
- this.title.caption = core_1.nls.localizeByDefault('Test Results');
44
- this.title.iconClass = (0, browser_1.codicon)('checklist');
45
- this.title.closable = true;
46
- this.scrollOptions = {
47
- minScrollbarLength: 35,
48
- };
49
- }
50
- init() {
51
- this.uiModel.onDidChangeSelectedTestState(e => {
52
- if (test_service_1.TestFailure.is(e)) {
53
- this.setInput(e.messages);
54
- }
55
- });
56
- }
57
- onAfterAttach(msg) {
58
- super.onAfterAttach(msg);
59
- this.content = this.node.ownerDocument.createElement('div');
60
- this.node.append(this.content);
61
- }
62
- setInput(messages) {
63
- this.input = messages;
64
- this.update();
65
- }
66
- onUpdateRequest(msg) {
67
- this.render();
68
- super.onUpdateRequest(msg);
69
- }
70
- render() {
71
- this.toDisposeOnRender.dispose();
72
- this.toDisposeOnRender = new core_1.DisposableCollection();
73
- this.content.innerHTML = '';
74
- this.input.forEach(message => {
75
- if (markdown_rendering_1.MarkdownString.is(message.message)) {
76
- const line = this.markdownRenderer.render(message.message);
77
- this.content.append(line.element);
78
- this.toDisposeOnRender.push(line);
79
- }
80
- else {
81
- this.content.append(this.node.ownerDocument.createTextNode(message.message));
82
- }
83
- });
84
- }
85
- dispose() {
86
- this.toDisposeOnRender.dispose();
87
- }
88
- };
89
- TestResultWidget.ID = 'test-result-widget';
90
- __decorate([
91
- (0, inversify_1.inject)(test_output_ui_model_1.TestOutputUIModel),
92
- __metadata("design:type", test_output_ui_model_1.TestOutputUIModel)
93
- ], TestResultWidget.prototype, "uiModel", void 0);
94
- __decorate([
95
- (0, inversify_1.inject)(markdown_renderer_1.MarkdownRenderer),
96
- __metadata("design:type", Object)
97
- ], TestResultWidget.prototype, "markdownRenderer", void 0);
98
- __decorate([
99
- (0, inversify_1.postConstruct)(),
100
- __metadata("design:type", Function),
101
- __metadata("design:paramtypes", []),
102
- __metadata("design:returntype", void 0)
103
- ], TestResultWidget.prototype, "init", null);
104
- TestResultWidget = TestResultWidget_1 = __decorate([
105
- (0, inversify_1.injectable)(),
106
- __metadata("design:paramtypes", [])
107
- ], TestResultWidget);
108
- exports.TestResultWidget = TestResultWidget;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 STMicroelectronics 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
+ var TestResultWidget_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.TestResultWidget = void 0;
29
+ const browser_1 = require("@theia/core/lib/browser");
30
+ const inversify_1 = require("@theia/core/shared/inversify");
31
+ const test_output_ui_model_1 = require("./test-output-ui-model");
32
+ const core_1 = require("@theia/core");
33
+ const test_service_1 = require("../test-service");
34
+ const markdown_renderer_1 = require("@theia/core/lib/browser/markdown-rendering/markdown-renderer");
35
+ const markdown_rendering_1 = require("@theia/core/lib/common/markdown-rendering");
36
+ let TestResultWidget = TestResultWidget_1 = class TestResultWidget extends browser_1.BaseWidget {
37
+ constructor() {
38
+ super();
39
+ this.toDisposeOnRender = new core_1.DisposableCollection();
40
+ this.input = [];
41
+ this.id = TestResultWidget_1.ID;
42
+ this.title.label = core_1.nls.localizeByDefault('Test Results');
43
+ this.title.caption = core_1.nls.localizeByDefault('Test Results');
44
+ this.title.iconClass = (0, browser_1.codicon)('checklist');
45
+ this.title.closable = true;
46
+ this.scrollOptions = {
47
+ minScrollbarLength: 35,
48
+ };
49
+ }
50
+ init() {
51
+ this.uiModel.onDidChangeSelectedTestState(e => {
52
+ if (test_service_1.TestFailure.is(e)) {
53
+ this.setInput(e.messages);
54
+ }
55
+ });
56
+ }
57
+ onAfterAttach(msg) {
58
+ super.onAfterAttach(msg);
59
+ this.content = this.node.ownerDocument.createElement('div');
60
+ this.node.append(this.content);
61
+ }
62
+ setInput(messages) {
63
+ this.input = messages;
64
+ this.update();
65
+ }
66
+ onUpdateRequest(msg) {
67
+ this.render();
68
+ super.onUpdateRequest(msg);
69
+ }
70
+ render() {
71
+ this.toDisposeOnRender.dispose();
72
+ this.toDisposeOnRender = new core_1.DisposableCollection();
73
+ this.content.innerHTML = '';
74
+ this.input.forEach(message => {
75
+ if (markdown_rendering_1.MarkdownString.is(message.message)) {
76
+ const line = this.markdownRenderer.render(message.message);
77
+ this.content.append(line.element);
78
+ this.toDisposeOnRender.push(line);
79
+ }
80
+ else {
81
+ this.content.append(this.node.ownerDocument.createTextNode(message.message));
82
+ }
83
+ });
84
+ }
85
+ dispose() {
86
+ this.toDisposeOnRender.dispose();
87
+ }
88
+ };
89
+ TestResultWidget.ID = 'test-result-widget';
90
+ __decorate([
91
+ (0, inversify_1.inject)(test_output_ui_model_1.TestOutputUIModel),
92
+ __metadata("design:type", test_output_ui_model_1.TestOutputUIModel)
93
+ ], TestResultWidget.prototype, "uiModel", void 0);
94
+ __decorate([
95
+ (0, inversify_1.inject)(markdown_renderer_1.MarkdownRenderer),
96
+ __metadata("design:type", Object)
97
+ ], TestResultWidget.prototype, "markdownRenderer", void 0);
98
+ __decorate([
99
+ (0, inversify_1.postConstruct)(),
100
+ __metadata("design:type", Function),
101
+ __metadata("design:paramtypes", []),
102
+ __metadata("design:returntype", void 0)
103
+ ], TestResultWidget.prototype, "init", null);
104
+ TestResultWidget = TestResultWidget_1 = __decorate([
105
+ (0, inversify_1.injectable)(),
106
+ __metadata("design:paramtypes", [])
107
+ ], TestResultWidget);
108
+ exports.TestResultWidget = TestResultWidget;
109
109
  //# sourceMappingURL=test-result-widget.js.map
@@ -1,18 +1,18 @@
1
- import { AbstractViewContribution, Widget } from '@theia/core/lib/browser';
2
- import { TestService } from '../test-service';
3
- import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
4
- import { TestRunTreeWidget } from './test-run-widget';
5
- import { CommandRegistry, MenuModelRegistry } from '@theia/core';
6
- import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
7
- export declare const TEST_RUNS_CONTEXT_MENU: string[];
8
- export declare const TEST_RUNS_INLINE_MENU: string[];
9
- export declare class TestRunViewContribution extends AbstractViewContribution<TestRunTreeWidget> implements TabBarToolbarContribution {
10
- protected readonly testService: TestService;
11
- protected readonly contextKeys: ContextKeyService;
12
- constructor();
13
- registerToolbarItems(registry: TabBarToolbarRegistry): void;
14
- registerMenus(menus: MenuModelRegistry): void;
15
- registerCommands(commands: CommandRegistry): void;
16
- protected withWidget<T>(widget: Widget | undefined, cb: (widget: TestRunTreeWidget) => T): T | false;
17
- }
1
+ import { AbstractViewContribution, Widget } from '@theia/core/lib/browser';
2
+ import { TestService } from '../test-service';
3
+ import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
4
+ import { TestRunTreeWidget } from './test-run-widget';
5
+ import { CommandRegistry, MenuModelRegistry } from '@theia/core';
6
+ import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
7
+ export declare const TEST_RUNS_CONTEXT_MENU: string[];
8
+ export declare const TEST_RUNS_INLINE_MENU: string[];
9
+ export declare class TestRunViewContribution extends AbstractViewContribution<TestRunTreeWidget> implements TabBarToolbarContribution {
10
+ protected readonly testService: TestService;
11
+ protected readonly contextKeys: ContextKeyService;
12
+ constructor();
13
+ registerToolbarItems(registry: TabBarToolbarRegistry): void;
14
+ registerMenus(menus: MenuModelRegistry): void;
15
+ registerCommands(commands: CommandRegistry): void;
16
+ protected withWidget<T>(widget: Widget | undefined, cb: (widget: TestRunTreeWidget) => T): T | false;
17
+ }
18
18
  //# sourceMappingURL=test-run-view-contribution.d.ts.map
@@ -1,101 +1,101 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 STMicroelectronics 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.TestRunViewContribution = exports.TEST_RUNS_INLINE_MENU = exports.TEST_RUNS_CONTEXT_MENU = void 0;
28
- const browser_1 = require("@theia/core/lib/browser");
29
- const inversify_1 = require("@theia/core/shared/inversify");
30
- const test_service_1 = require("../test-service");
31
- const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
32
- const test_run_widget_1 = require("./test-run-widget");
33
- const test_view_contribution_1 = require("./test-view-contribution");
34
- const core_1 = require("@theia/core");
35
- exports.TEST_RUNS_CONTEXT_MENU = ['test-runs-context-menu'];
36
- exports.TEST_RUNS_INLINE_MENU = [...exports.TEST_RUNS_CONTEXT_MENU, 'inline'];
37
- let TestRunViewContribution = class TestRunViewContribution extends browser_1.AbstractViewContribution {
38
- constructor() {
39
- super({
40
- viewContainerId: test_view_contribution_1.TEST_VIEW_CONTAINER_ID,
41
- widgetId: test_run_widget_1.TestRunTreeWidget.ID,
42
- widgetName: core_1.nls.localize('theia/test/testRuns', 'Test Runs'),
43
- defaultWidgetOptions: {
44
- area: 'left',
45
- rank: 200,
46
- }
47
- });
48
- }
49
- registerToolbarItems(registry) {
50
- registry.registerItem({
51
- id: test_view_contribution_1.TestViewCommands.CLEAR_ALL_RESULTS.id,
52
- command: test_view_contribution_1.TestViewCommands.CLEAR_ALL_RESULTS.id,
53
- priority: 1
54
- });
55
- }
56
- registerMenus(menus) {
57
- super.registerMenus(menus);
58
- menus.registerMenuAction(exports.TEST_RUNS_CONTEXT_MENU, {
59
- commandId: test_view_contribution_1.TestViewCommands.CANCEL_RUN.id
60
- });
61
- }
62
- registerCommands(commands) {
63
- super.registerCommands(commands);
64
- commands.registerCommand(test_view_contribution_1.TestViewCommands.CANCEL_RUN, {
65
- isEnabled: t => test_service_1.TestRun.is(t) && t.isRunning,
66
- isVisible: t => test_service_1.TestRun.is(t),
67
- execute: t => {
68
- if (test_service_1.TestRun.is(t)) {
69
- t.cancel();
70
- }
71
- }
72
- });
73
- commands.registerCommand(test_view_contribution_1.TestViewCommands.CLEAR_ALL_RESULTS, {
74
- isEnabled: w => this.withWidget(w, () => true),
75
- isVisible: w => this.withWidget(w, () => true),
76
- execute: () => {
77
- this.testService.clearResults();
78
- }
79
- });
80
- }
81
- withWidget(widget = this.tryGetWidget(), cb) {
82
- if (widget instanceof test_run_widget_1.TestRunTreeWidget && widget.id === test_run_widget_1.TestRunTreeWidget.ID) {
83
- return cb(widget);
84
- }
85
- return false;
86
- }
87
- };
88
- __decorate([
89
- (0, inversify_1.inject)(test_service_1.TestService),
90
- __metadata("design:type", Object)
91
- ], TestRunViewContribution.prototype, "testService", void 0);
92
- __decorate([
93
- (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
94
- __metadata("design:type", Object)
95
- ], TestRunViewContribution.prototype, "contextKeys", void 0);
96
- TestRunViewContribution = __decorate([
97
- (0, inversify_1.injectable)(),
98
- __metadata("design:paramtypes", [])
99
- ], TestRunViewContribution);
100
- exports.TestRunViewContribution = TestRunViewContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 STMicroelectronics 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.TestRunViewContribution = exports.TEST_RUNS_INLINE_MENU = exports.TEST_RUNS_CONTEXT_MENU = void 0;
28
+ const browser_1 = require("@theia/core/lib/browser");
29
+ const inversify_1 = require("@theia/core/shared/inversify");
30
+ const test_service_1 = require("../test-service");
31
+ const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
32
+ const test_run_widget_1 = require("./test-run-widget");
33
+ const test_view_contribution_1 = require("./test-view-contribution");
34
+ const core_1 = require("@theia/core");
35
+ exports.TEST_RUNS_CONTEXT_MENU = ['test-runs-context-menu'];
36
+ exports.TEST_RUNS_INLINE_MENU = [...exports.TEST_RUNS_CONTEXT_MENU, 'inline'];
37
+ let TestRunViewContribution = class TestRunViewContribution extends browser_1.AbstractViewContribution {
38
+ constructor() {
39
+ super({
40
+ viewContainerId: test_view_contribution_1.TEST_VIEW_CONTAINER_ID,
41
+ widgetId: test_run_widget_1.TestRunTreeWidget.ID,
42
+ widgetName: core_1.nls.localize('theia/test/testRuns', 'Test Runs'),
43
+ defaultWidgetOptions: {
44
+ area: 'left',
45
+ rank: 200,
46
+ }
47
+ });
48
+ }
49
+ registerToolbarItems(registry) {
50
+ registry.registerItem({
51
+ id: test_view_contribution_1.TestViewCommands.CLEAR_ALL_RESULTS.id,
52
+ command: test_view_contribution_1.TestViewCommands.CLEAR_ALL_RESULTS.id,
53
+ priority: 1
54
+ });
55
+ }
56
+ registerMenus(menus) {
57
+ super.registerMenus(menus);
58
+ menus.registerMenuAction(exports.TEST_RUNS_CONTEXT_MENU, {
59
+ commandId: test_view_contribution_1.TestViewCommands.CANCEL_RUN.id
60
+ });
61
+ }
62
+ registerCommands(commands) {
63
+ super.registerCommands(commands);
64
+ commands.registerCommand(test_view_contribution_1.TestViewCommands.CANCEL_RUN, {
65
+ isEnabled: t => test_service_1.TestRun.is(t) && t.isRunning,
66
+ isVisible: t => test_service_1.TestRun.is(t),
67
+ execute: t => {
68
+ if (test_service_1.TestRun.is(t)) {
69
+ t.cancel();
70
+ }
71
+ }
72
+ });
73
+ commands.registerCommand(test_view_contribution_1.TestViewCommands.CLEAR_ALL_RESULTS, {
74
+ isEnabled: w => this.withWidget(w, () => true),
75
+ isVisible: w => this.withWidget(w, () => true),
76
+ execute: () => {
77
+ this.testService.clearResults();
78
+ }
79
+ });
80
+ }
81
+ withWidget(widget = this.tryGetWidget(), cb) {
82
+ if (widget instanceof test_run_widget_1.TestRunTreeWidget && widget.id === test_run_widget_1.TestRunTreeWidget.ID) {
83
+ return cb(widget);
84
+ }
85
+ return false;
86
+ }
87
+ };
88
+ __decorate([
89
+ (0, inversify_1.inject)(test_service_1.TestService),
90
+ __metadata("design:type", Object)
91
+ ], TestRunViewContribution.prototype, "testService", void 0);
92
+ __decorate([
93
+ (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
94
+ __metadata("design:type", Object)
95
+ ], TestRunViewContribution.prototype, "contextKeys", void 0);
96
+ TestRunViewContribution = __decorate([
97
+ (0, inversify_1.injectable)(),
98
+ __metadata("design:paramtypes", [])
99
+ ], TestRunViewContribution);
100
+ exports.TestRunViewContribution = TestRunViewContribution;
101
101
  //# sourceMappingURL=test-run-view-contribution.js.map
@@ -1,59 +1,59 @@
1
- /// <reference types="react" />
2
- import { TreeWidget, TreeModel, TreeProps, CompositeTreeNode, TreeNode, TreeImpl, NodeProps, SelectableTreeNode } from '@theia/core/lib/browser/tree';
3
- import { ContextMenuRenderer } from '@theia/core/lib/browser';
4
- import { IconThemeService } from '@theia/core/lib/browser/icon-theme-service';
5
- import { ThemeService } from '@theia/core/lib/browser/theming';
6
- import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
7
- import { TestExecutionState, TestItem, TestMessage, TestRun, TestService } from '../test-service';
8
- import * as React from '@theia/core/shared/react';
9
- import { TestExecutionStateManager } from './test-execution-state-manager';
10
- import { TestOutputUIModel } from './test-output-ui-model';
11
- declare class TestRunNode implements TreeNode, SelectableTreeNode {
12
- readonly counter: number;
13
- readonly id: string;
14
- readonly run: TestRun;
15
- readonly parent: CompositeTreeNode;
16
- constructor(counter: number, id: string, run: TestRun, parent: CompositeTreeNode);
17
- get name(): string;
18
- expanded?: boolean;
19
- selected: boolean;
20
- children: TestItemNode[];
21
- }
22
- declare class TestItemNode implements TreeNode, SelectableTreeNode {
23
- readonly id: string;
24
- readonly item: TestItem;
25
- readonly parent: TestRunNode;
26
- constructor(id: string, item: TestItem, parent: TestRunNode);
27
- selected: boolean;
28
- get name(): string;
29
- }
30
- export declare class TestRunTree extends TreeImpl {
31
- private ROOT;
32
- protected readonly testService: TestService;
33
- private controllerListeners;
34
- private runs;
35
- private nextId;
36
- init(): void;
37
- private addController;
38
- private addRun;
39
- protected createRunNode(run: TestRun): TestRunNode;
40
- createTestItemNode(parent: TestRunNode, item: TestItem): TestItemNode;
41
- protected resolveChildren(parent: CompositeTreeNode): Promise<TreeNode[]>;
42
- }
43
- export declare class TestRunTreeWidget extends TreeWidget {
44
- static ID: string;
45
- protected readonly iconThemeService: IconThemeService;
46
- protected readonly contextKeys: ContextKeyService;
47
- protected readonly themeService: ThemeService;
48
- protected readonly stateManager: TestExecutionStateManager;
49
- protected readonly uiModel: TestOutputUIModel;
50
- constructor(props: TreeProps, model: TreeModel, contextMenuRenderer: ContextMenuRenderer);
51
- protected init(): void;
52
- protected renderTree(model: TreeModel): React.ReactNode;
53
- protected getTestStateClass(state: TestExecutionState | undefined): string;
54
- protected renderIcon(node: TreeNode, props: NodeProps): React.ReactNode;
55
- protected toContextMenuArgs(node: SelectableTreeNode): (TestRun | TestItem | TestMessage[])[];
56
- storeState(): object;
57
- }
58
- export {};
1
+ /// <reference types="react" />
2
+ import { TreeWidget, TreeModel, TreeProps, CompositeTreeNode, TreeNode, TreeImpl, NodeProps, SelectableTreeNode } from '@theia/core/lib/browser/tree';
3
+ import { ContextMenuRenderer } from '@theia/core/lib/browser';
4
+ import { IconThemeService } from '@theia/core/lib/browser/icon-theme-service';
5
+ import { ThemeService } from '@theia/core/lib/browser/theming';
6
+ import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
7
+ import { TestExecutionState, TestItem, TestMessage, TestRun, TestService } from '../test-service';
8
+ import * as React from '@theia/core/shared/react';
9
+ import { TestExecutionStateManager } from './test-execution-state-manager';
10
+ import { TestOutputUIModel } from './test-output-ui-model';
11
+ declare class TestRunNode implements TreeNode, SelectableTreeNode {
12
+ readonly counter: number;
13
+ readonly id: string;
14
+ readonly run: TestRun;
15
+ readonly parent: CompositeTreeNode;
16
+ constructor(counter: number, id: string, run: TestRun, parent: CompositeTreeNode);
17
+ get name(): string;
18
+ expanded?: boolean;
19
+ selected: boolean;
20
+ children: TestItemNode[];
21
+ }
22
+ declare class TestItemNode implements TreeNode, SelectableTreeNode {
23
+ readonly id: string;
24
+ readonly item: TestItem;
25
+ readonly parent: TestRunNode;
26
+ constructor(id: string, item: TestItem, parent: TestRunNode);
27
+ selected: boolean;
28
+ get name(): string;
29
+ }
30
+ export declare class TestRunTree extends TreeImpl {
31
+ private ROOT;
32
+ protected readonly testService: TestService;
33
+ private controllerListeners;
34
+ private runs;
35
+ private nextId;
36
+ init(): void;
37
+ private addController;
38
+ private addRun;
39
+ protected createRunNode(run: TestRun): TestRunNode;
40
+ createTestItemNode(parent: TestRunNode, item: TestItem): TestItemNode;
41
+ protected resolveChildren(parent: CompositeTreeNode): Promise<TreeNode[]>;
42
+ }
43
+ export declare class TestRunTreeWidget extends TreeWidget {
44
+ static ID: string;
45
+ protected readonly iconThemeService: IconThemeService;
46
+ protected readonly contextKeys: ContextKeyService;
47
+ protected readonly themeService: ThemeService;
48
+ protected readonly stateManager: TestExecutionStateManager;
49
+ protected readonly uiModel: TestOutputUIModel;
50
+ constructor(props: TreeProps, model: TreeModel, contextMenuRenderer: ContextMenuRenderer);
51
+ protected init(): void;
52
+ protected renderTree(model: TreeModel): React.ReactNode;
53
+ protected getTestStateClass(state: TestExecutionState | undefined): string;
54
+ protected renderIcon(node: TreeNode, props: NodeProps): React.ReactNode;
55
+ protected toContextMenuArgs(node: SelectableTreeNode): (TestRun | TestItem | TestMessage[])[];
56
+ storeState(): object;
57
+ }
58
+ export {};
59
59
  //# sourceMappingURL=test-run-widget.d.ts.map