@codingame/monaco-vscode-testing-service-override 3.2.3 → 4.0.0
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.
- package/package.json +8 -8
- package/testing.js +1 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/codeCoverageDecorations.js +48 -24
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.js +8 -9
- package/vscode/src/vs/workbench/contrib/testing/browser/icons.js +11 -1
- package/vscode/src/vs/workbench/contrib/testing/browser/media/testMessageColorizer.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/media/testing.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageBars.js +18 -5
- package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageView.js +21 -2
- package/vscode/src/vs/workbench/contrib/testing/browser/testExplorerActions.js +23 -12
- package/vscode/src/vs/workbench/contrib/testing/browser/testMessageColorizer.js +73 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testing.contribution.js +6 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingConfigurationUi.js +120 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingDecorations.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.js +10 -10
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerView.js +33 -19
- package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.js +50 -31
- package/vscode/src/vs/workbench/contrib/testing/browser/theme.js +80 -2
- package/vscode/src/vs/workbench/contrib/testing/common/configuration.js +4 -1
- package/vscode/src/vs/workbench/contrib/testing/common/observableUtils.js +20 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingContentProvider.js +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { groupBy } from 'vscode/vscode/vs/base/common/arrays';
|
|
2
|
+
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
3
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
5
|
+
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
6
|
+
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
7
|
+
import { testingUpdateProfiles } from './icons.js';
|
|
8
|
+
import { testConfigurationGroupNames } from '../common/constants.js';
|
|
9
|
+
import { ITestProfileService, canUseProfileWithTest } from 'vscode/vscode/vs/workbench/contrib/testing/common/testProfileService';
|
|
10
|
+
|
|
11
|
+
function buildPicker(accessor, { onlyGroup, showConfigureButtons = true, onlyForTest, onlyConfigurable, placeholder = ( ( localizeWithPath(
|
|
12
|
+
'vs/workbench/contrib/testing/browser/testingConfigurationUi',
|
|
13
|
+
'testConfigurationUi.pick',
|
|
14
|
+
'Pick a test profile to use'
|
|
15
|
+
))), }) {
|
|
16
|
+
const profileService = accessor.get(ITestProfileService);
|
|
17
|
+
const items = [];
|
|
18
|
+
const pushItems = (allProfiles, description) => {
|
|
19
|
+
for (const profiles of groupBy(allProfiles, (a, b) => a.group - b.group)) {
|
|
20
|
+
let addedHeader = false;
|
|
21
|
+
if (onlyGroup) {
|
|
22
|
+
if (profiles[0].group !== onlyGroup) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
addedHeader = true;
|
|
26
|
+
}
|
|
27
|
+
for (const profile of profiles) {
|
|
28
|
+
if (onlyConfigurable && !profile.hasConfigurationHandler) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!addedHeader) {
|
|
32
|
+
items.push({ type: 'separator', label: testConfigurationGroupNames[profiles[0].group] });
|
|
33
|
+
addedHeader = true;
|
|
34
|
+
}
|
|
35
|
+
items.push(({
|
|
36
|
+
type: 'item',
|
|
37
|
+
profile,
|
|
38
|
+
label: profile.label,
|
|
39
|
+
description,
|
|
40
|
+
alwaysShow: true,
|
|
41
|
+
buttons: profile.hasConfigurationHandler && showConfigureButtons
|
|
42
|
+
? [{
|
|
43
|
+
iconClass: ThemeIcon.asClassName(testingUpdateProfiles),
|
|
44
|
+
tooltip: ( (localizeWithPath(
|
|
45
|
+
'vs/workbench/contrib/testing/browser/testingConfigurationUi',
|
|
46
|
+
'updateTestConfiguration',
|
|
47
|
+
'Update Test Configuration'
|
|
48
|
+
)))
|
|
49
|
+
}] : []
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
if (onlyForTest !== undefined) {
|
|
55
|
+
pushItems(profileService.getControllerProfiles(onlyForTest.controllerId).filter(p => canUseProfileWithTest(p, onlyForTest)));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
for (const { profiles, controller } of profileService.all()) {
|
|
59
|
+
pushItems(profiles, controller.label.value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const quickpick = accessor.get(IQuickInputService).createQuickPick();
|
|
63
|
+
quickpick.items = items;
|
|
64
|
+
quickpick.placeholder = placeholder;
|
|
65
|
+
return quickpick;
|
|
66
|
+
}
|
|
67
|
+
const triggerButtonHandler = (service, resolve) => (evt) => {
|
|
68
|
+
const profile = evt.item.profile;
|
|
69
|
+
if (profile) {
|
|
70
|
+
service.configure(profile.controllerId, profile.profileId);
|
|
71
|
+
resolve(undefined);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
CommandsRegistry.registerCommand({
|
|
75
|
+
id: 'vscode.pickMultipleTestProfiles',
|
|
76
|
+
handler: async (accessor, options) => {
|
|
77
|
+
const profileService = accessor.get(ITestProfileService);
|
|
78
|
+
const quickpick = buildPicker(accessor, options);
|
|
79
|
+
if (!quickpick) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
quickpick.canSelectMany = true;
|
|
83
|
+
if (options.selected) {
|
|
84
|
+
quickpick.selectedItems = quickpick.items
|
|
85
|
+
.filter((i) => i.type === 'item')
|
|
86
|
+
.filter(i => ( (options.selected.some(
|
|
87
|
+
s => s.controllerId === i.profile.controllerId && s.profileId === i.profile.profileId
|
|
88
|
+
))));
|
|
89
|
+
}
|
|
90
|
+
const pick = await ( (new Promise(resolve => {
|
|
91
|
+
quickpick.onDidAccept(() => {
|
|
92
|
+
const selected = quickpick.selectedItems;
|
|
93
|
+
resolve(( (selected.map(s => s.profile))).filter(isDefined));
|
|
94
|
+
});
|
|
95
|
+
quickpick.onDidHide(() => resolve(undefined));
|
|
96
|
+
quickpick.onDidTriggerItemButton(triggerButtonHandler(profileService, resolve));
|
|
97
|
+
quickpick.show();
|
|
98
|
+
})));
|
|
99
|
+
quickpick.dispose();
|
|
100
|
+
return pick;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
CommandsRegistry.registerCommand({
|
|
104
|
+
id: 'vscode.pickTestProfile',
|
|
105
|
+
handler: async (accessor, options) => {
|
|
106
|
+
const profileService = accessor.get(ITestProfileService);
|
|
107
|
+
const quickpick = buildPicker(accessor, options);
|
|
108
|
+
if (!quickpick) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const pick = await ( (new Promise(resolve => {
|
|
112
|
+
quickpick.onDidAccept(() => resolve(quickpick.selectedItems[0]?.profile));
|
|
113
|
+
quickpick.onDidHide(() => resolve(undefined));
|
|
114
|
+
quickpick.onDidTriggerItemButton(triggerButtonHandler(profileService, resolve));
|
|
115
|
+
quickpick.show();
|
|
116
|
+
})));
|
|
117
|
+
quickpick.dispose();
|
|
118
|
+
return pick;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { $ } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { renderStringAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
|
|
4
3
|
import { Action, Separator, SubmenuAction } from 'vscode/vscode/vs/base/common/actions';
|
|
5
4
|
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
6
5
|
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
@@ -31,6 +30,7 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
31
30
|
import { GutterActionsRegistry, EditorLineNumberContextMenu } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu';
|
|
32
31
|
import { getTestItemContextOverlay } from './explorerProjections/testItemContextOverlay.js';
|
|
33
32
|
import { testingRunAllIcon, testingRunIcon, testingStatesToIcons } from './icons.js';
|
|
33
|
+
import { renderTestMessageAsText } from './testMessageColorizer.js';
|
|
34
34
|
import { getTestingConfiguration } from '../common/configuration.js';
|
|
35
35
|
import { labelForTestInState } from '../common/constants.js';
|
|
36
36
|
import { TestId } from 'vscode/vscode/vs/workbench/contrib/testing/common/testId';
|
|
@@ -919,7 +919,7 @@ let TestMessageDecoration = class TestMessageDecoration {
|
|
|
919
919
|
options.isWholeLine = true;
|
|
920
920
|
options.stickiness = 1 ;
|
|
921
921
|
options.collapseOnReplaceEdit = true;
|
|
922
|
-
let inlineText =
|
|
922
|
+
let inlineText = renderTestMessageAsText(message).replace(lineBreakRe, ' ');
|
|
923
923
|
if (inlineText.length > MAX_INLINE_MESSAGE_LENGTH) {
|
|
924
924
|
inlineText = inlineText.slice(0, MAX_INLINE_MESSAGE_LENGTH - 1) + '…';
|
|
925
925
|
}
|
|
@@ -41,8 +41,8 @@ const testFilterDescriptions = {
|
|
|
41
41
|
)),
|
|
42
42
|
};
|
|
43
43
|
let TestingExplorerFilter = class TestingExplorerFilter extends BaseActionViewItem {
|
|
44
|
-
constructor(action, state, instantiationService, testService) {
|
|
45
|
-
super(null, action);
|
|
44
|
+
constructor(action, options, state, instantiationService, testService) {
|
|
45
|
+
super(null, action, options);
|
|
46
46
|
this.state = state;
|
|
47
47
|
this.instantiationService = instantiationService;
|
|
48
48
|
this.testService = testService;
|
|
@@ -123,9 +123,9 @@ let TestingExplorerFilter = class TestingExplorerFilter extends BaseActionViewIt
|
|
|
123
123
|
this.state.setText(input.getValue());
|
|
124
124
|
})));
|
|
125
125
|
const actionbar = this._register(( new ActionBar(container, {
|
|
126
|
-
actionViewItemProvider: action => {
|
|
126
|
+
actionViewItemProvider: (action, options) => {
|
|
127
127
|
if (action.id === this.filtersAction.id) {
|
|
128
|
-
return this.instantiationService.createInstance(FiltersDropdownMenuActionViewItem, action, this.state, this.actionRunner);
|
|
128
|
+
return this.instantiationService.createInstance(FiltersDropdownMenuActionViewItem, action, options, this.state, this.actionRunner);
|
|
129
129
|
}
|
|
130
130
|
return undefined;
|
|
131
131
|
},
|
|
@@ -151,12 +151,12 @@ let TestingExplorerFilter = class TestingExplorerFilter extends BaseActionViewIt
|
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
TestingExplorerFilter = ( __decorate([
|
|
154
|
-
( __param(
|
|
155
|
-
( __param(
|
|
156
|
-
( __param(
|
|
154
|
+
( __param(2, ITestExplorerFilterState)),
|
|
155
|
+
( __param(3, IInstantiationService)),
|
|
156
|
+
( __param(4, ITestService))
|
|
157
157
|
], TestingExplorerFilter));
|
|
158
158
|
let FiltersDropdownMenuActionViewItem = class FiltersDropdownMenuActionViewItem extends DropdownMenuActionViewItem {
|
|
159
|
-
constructor(action, filters, actionRunner, contextMenuService, testService) {
|
|
159
|
+
constructor(action, options, filters, actionRunner, contextMenuService, testService) {
|
|
160
160
|
super(action, { getActions: () => this.getActions() }, contextMenuService, {
|
|
161
161
|
actionRunner,
|
|
162
162
|
classNames: action.class,
|
|
@@ -229,8 +229,8 @@ let FiltersDropdownMenuActionViewItem = class FiltersDropdownMenuActionViewItem
|
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
FiltersDropdownMenuActionViewItem = ( __decorate([
|
|
232
|
-
( __param(
|
|
233
|
-
( __param(
|
|
232
|
+
( __param(4, IContextMenuService)),
|
|
233
|
+
( __param(5, ITestService))
|
|
234
234
|
], FiltersDropdownMenuActionViewItem));
|
|
235
235
|
|
|
236
236
|
export { TestingExplorerFilter };
|
|
@@ -2,6 +2,8 @@ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.e
|
|
|
2
2
|
import { append, $, clearNode, reset, h, addStandardDisposableListener, isMouseEvent } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
3
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
4
4
|
import { Button } from 'vscode/vscode/vs/base/browser/ui/button/button';
|
|
5
|
+
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
6
|
+
import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
|
|
5
7
|
import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
6
8
|
import { DefaultKeyboardNavigationDelegate } from 'vscode/vscode/vs/base/browser/ui/list/listWidget';
|
|
7
9
|
import { Action, Separator, ActionRunner } from 'vscode/vscode/vs/base/common/actions';
|
|
@@ -9,7 +11,7 @@ import { mapFindFirst } from 'vscode/vscode/vs/base/common/arraysFind';
|
|
|
9
11
|
import { RunOnceScheduler, disposableTimeout } from 'vscode/vscode/vs/base/common/async';
|
|
10
12
|
import { Color, RGBA } from 'vscode/vscode/vs/base/common/color';
|
|
11
13
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
12
|
-
import {
|
|
14
|
+
import { DisposableStore, Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
13
15
|
import { fuzzyContains } from 'vscode/vscode/vs/base/common/strings';
|
|
14
16
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
15
17
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
@@ -30,7 +32,17 @@ import { UnmanagedProgress } from 'vscode/vscode/vs/platform/progress/common/pro
|
|
|
30
32
|
import { WillSaveStateReason, IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
31
33
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
32
34
|
import { defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
33
|
-
import
|
|
35
|
+
import 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
36
|
+
import { foreground } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
37
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
38
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
|
|
39
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
|
|
40
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/listColors';
|
|
41
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
|
|
42
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
43
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
44
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
45
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
34
46
|
import { spinningLoading } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
35
47
|
import { registerThemingParticipant, IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
36
48
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
@@ -203,18 +215,18 @@ let TestingExplorerView = class TestingExplorerView extends ViewPane {
|
|
|
203
215
|
this._register(this.viewModel);
|
|
204
216
|
this._onDidChangeViewWelcomeState.fire();
|
|
205
217
|
}
|
|
206
|
-
getActionViewItem(action) {
|
|
218
|
+
getActionViewItem(action, options) {
|
|
207
219
|
switch (action.id) {
|
|
208
220
|
case "workbench.actions.treeView.testExplorer.filter" :
|
|
209
|
-
this.filter.value = this.instantiationService.createInstance(TestingExplorerFilter, action);
|
|
221
|
+
this.filter.value = this.instantiationService.createInstance(TestingExplorerFilter, action, options);
|
|
210
222
|
this.filterFocusListener.value = this.filter.value.onDidFocus(() => this.lastFocusState = 0 );
|
|
211
223
|
return this.filter.value;
|
|
212
224
|
case "testing.runSelected" :
|
|
213
|
-
return this.getRunGroupDropdown(2 , action);
|
|
225
|
+
return this.getRunGroupDropdown(2 , action, options);
|
|
214
226
|
case "testing.debugSelected" :
|
|
215
|
-
return this.getRunGroupDropdown(4 , action);
|
|
227
|
+
return this.getRunGroupDropdown(4 , action, options);
|
|
216
228
|
default:
|
|
217
|
-
return super.getActionViewItem(action);
|
|
229
|
+
return super.getActionViewItem(action, options);
|
|
218
230
|
}
|
|
219
231
|
}
|
|
220
232
|
getTestConfigGroupActions(group) {
|
|
@@ -283,10 +295,10 @@ let TestingExplorerView = class TestingExplorerView extends ViewPane {
|
|
|
283
295
|
this.filter.value?.saveState();
|
|
284
296
|
super.saveState();
|
|
285
297
|
}
|
|
286
|
-
getRunGroupDropdown(group, defaultAction) {
|
|
298
|
+
getRunGroupDropdown(group, defaultAction, options) {
|
|
287
299
|
const dropdownActions = this.getTestConfigGroupActions(group);
|
|
288
300
|
if (dropdownActions.length < 2) {
|
|
289
|
-
return super.getActionViewItem(defaultAction);
|
|
301
|
+
return super.getActionViewItem(defaultAction, options);
|
|
290
302
|
}
|
|
291
303
|
const primaryAction = this.instantiationService.createInstance(MenuItemAction, {
|
|
292
304
|
id: defaultAction.id,
|
|
@@ -296,11 +308,11 @@ let TestingExplorerView = class TestingExplorerView extends ViewPane {
|
|
|
296
308
|
: testingDebugAllIcon,
|
|
297
309
|
}, undefined, undefined, undefined);
|
|
298
310
|
const dropdownAction = ( new Action('selectRunConfig', 'Select Configuration...', 'codicon-chevron-down', true));
|
|
299
|
-
return this.instantiationService.createInstance(DropdownWithPrimaryActionViewItem, primaryAction, dropdownAction, dropdownActions, '', this.contextMenuService,
|
|
311
|
+
return this.instantiationService.createInstance(DropdownWithPrimaryActionViewItem, primaryAction, dropdownAction, dropdownActions, '', this.contextMenuService, options);
|
|
300
312
|
}
|
|
301
313
|
createFilterActionBar() {
|
|
302
314
|
const bar = ( new ActionBar(this.treeHeader, {
|
|
303
|
-
actionViewItemProvider: action => this.getActionViewItem(action),
|
|
315
|
+
actionViewItemProvider: (action, options) => this.getActionViewItem(action, options),
|
|
304
316
|
triggerKeys: { keyDown: false, keys: [] },
|
|
305
317
|
}));
|
|
306
318
|
bar.push(( new Action(
|
|
@@ -367,6 +379,7 @@ let ResultSummaryView = class ResultSummaryView extends Disposable {
|
|
|
367
379
|
this.render();
|
|
368
380
|
}
|
|
369
381
|
}));
|
|
382
|
+
this.countHover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.elements.count, ''));
|
|
370
383
|
const ab = this._register(( new ActionBar(this.elements.rerun, {
|
|
371
384
|
actionViewItemProvider: (action, options) => createActionViewItem(instantiationService, action, options),
|
|
372
385
|
})));
|
|
@@ -408,7 +421,7 @@ let ResultSummaryView = class ResultSummaryView extends Disposable {
|
|
|
408
421
|
rerun.style.display = 'block';
|
|
409
422
|
}
|
|
410
423
|
count.textContent = `${counts.passed}/${counts.totalWillBeRun}`;
|
|
411
|
-
|
|
424
|
+
this.countHover.update(getTestProgressText(counts));
|
|
412
425
|
this.renderActivityBadge(counts);
|
|
413
426
|
if (!this.elementsWereAttached) {
|
|
414
427
|
clearNode(this.container);
|
|
@@ -1049,7 +1062,7 @@ let ErrorRenderer = class ErrorRenderer {
|
|
|
1049
1062
|
}
|
|
1050
1063
|
renderTemplate(container) {
|
|
1051
1064
|
const label = append(container, $('.error'));
|
|
1052
|
-
return { label };
|
|
1065
|
+
return { label, disposable: ( new DisposableStore()) };
|
|
1053
1066
|
}
|
|
1054
1067
|
renderElement({ element }, _, data) {
|
|
1055
1068
|
clearNode(data.label);
|
|
@@ -1060,9 +1073,10 @@ let ErrorRenderer = class ErrorRenderer {
|
|
|
1060
1073
|
const result = this.renderer.render(element.message, { inline: true });
|
|
1061
1074
|
data.label.appendChild(result.element);
|
|
1062
1075
|
}
|
|
1063
|
-
data.
|
|
1076
|
+
data.disposable.add(setupCustomHover(getDefaultHoverDelegate('mouse'), data.label, element.description));
|
|
1064
1077
|
}
|
|
1065
|
-
disposeTemplate() {
|
|
1078
|
+
disposeTemplate(data) {
|
|
1079
|
+
data.disposable.dispose();
|
|
1066
1080
|
}
|
|
1067
1081
|
};
|
|
1068
1082
|
ErrorRenderer = ErrorRenderer_1 = ( __decorate([
|
|
@@ -1090,8 +1104,8 @@ let TestItemRenderer = class TestItemRenderer extends Disposable {
|
|
|
1090
1104
|
append(wrapper, $(ThemeIcon.asCSSSelector(testingHiddenIcon)));
|
|
1091
1105
|
const actionBar = disposable.add(( new ActionBar(wrapper, {
|
|
1092
1106
|
actionRunner: this.actionRunner,
|
|
1093
|
-
actionViewItemProvider: action => action instanceof MenuItemAction
|
|
1094
|
-
? this.instantiationService.createInstance(MenuEntryActionViewItem, action,
|
|
1107
|
+
actionViewItemProvider: (action, options) => action instanceof MenuItemAction
|
|
1108
|
+
? this.instantiationService.createInstance(MenuEntryActionViewItem, action, { hoverDelegate: options.hoverDelegate })
|
|
1095
1109
|
: undefined
|
|
1096
1110
|
})));
|
|
1097
1111
|
disposable.add(this.crService.onDidChange(changed => {
|
|
@@ -1135,7 +1149,7 @@ let TestItemRenderer = class TestItemRenderer extends Disposable {
|
|
|
1135
1149
|
if (node.element.retired) {
|
|
1136
1150
|
data.icon.className += ' retired';
|
|
1137
1151
|
}
|
|
1138
|
-
data.
|
|
1152
|
+
data.elementDisposable.add(setupCustomHover(getDefaultHoverDelegate('mouse'), data.label, getLabelForTestTreeElement(node.element)));
|
|
1139
1153
|
if (node.element.test.item.label.trim()) {
|
|
1140
1154
|
reset(data.label, ...renderLabelWithIcons(node.element.test.item.label));
|
|
1141
1155
|
}
|
|
@@ -1165,7 +1179,7 @@ const formatDuration = (ms) => {
|
|
|
1165
1179
|
if (ms < 10) {
|
|
1166
1180
|
return `${ms.toFixed(1)}ms`;
|
|
1167
1181
|
}
|
|
1168
|
-
if (ms <
|
|
1182
|
+
if (ms < 1_000) {
|
|
1169
1183
|
return `${ms.toFixed(0)}ms`;
|
|
1170
1184
|
}
|
|
1171
1185
|
return `${(ms / 1000).toFixed(1)}s`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { append, $, reset, Dimension, scheduleAtNextAnimationFrame, getWindow } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { renderStringAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
|
|
4
3
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
5
4
|
import { alert } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
6
5
|
import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
@@ -15,6 +14,10 @@ import { stripIcons } from 'vscode/vscode/vs/base/common/iconLabels';
|
|
|
15
14
|
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
16
15
|
import { Lazy } from 'vscode/vscode/vs/base/common/lazy';
|
|
17
16
|
import { DisposableStore, Disposable, MutableDisposable, toDisposable, combinedDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
17
|
+
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
18
|
+
import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
19
|
+
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
20
|
+
import 'vscode/vscode/vs/base/common/cancellation';
|
|
18
21
|
import { count } from 'vscode/vscode/vs/base/common/strings';
|
|
19
22
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
20
23
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
@@ -22,13 +25,14 @@ import './testingOutputPeek.css.js';
|
|
|
22
25
|
import { isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
23
26
|
import { EditorAction2 } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
24
27
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
25
|
-
import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditorWidget';
|
|
28
|
+
import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
29
|
+
import { EmbeddedCodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget';
|
|
26
30
|
import { DiffEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
|
|
27
|
-
import {
|
|
31
|
+
import { EmbeddedDiffEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget';
|
|
32
|
+
import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
|
|
28
33
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
29
34
|
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
30
35
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
31
|
-
import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
|
|
32
36
|
import { PeekViewWidget, peekViewTitleForeground, peekViewTitleInfoForeground, IPeekViewService, peekViewResultsBackground } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
|
|
33
37
|
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
34
38
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
@@ -50,7 +54,17 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
|
|
|
50
54
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
51
55
|
import { TerminalCapabilityStore } from 'vscode/vscode/vs/platform/terminal/common/capabilities/terminalCapabilityStore';
|
|
52
56
|
import { formatMessageForTerminal } from 'vscode/vscode/vs/platform/terminal/common/terminalStrings';
|
|
53
|
-
import
|
|
57
|
+
import 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
58
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
59
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
60
|
+
import { editorBackground } from 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
|
|
61
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
|
|
62
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/listColors';
|
|
63
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
|
|
64
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
65
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
66
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
67
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
54
68
|
import { widgetClose } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
55
69
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
56
70
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
@@ -58,13 +72,13 @@ import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPan
|
|
|
58
72
|
import { EditorModel } from 'vscode/vscode/vs/workbench/common/editor/editorModel';
|
|
59
73
|
import { PANEL_BACKGROUND, SIDE_BAR_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
60
74
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
61
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
62
75
|
import { DetachedProcessInfo } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/detachedTerminal';
|
|
63
76
|
import { ITerminalService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal';
|
|
64
77
|
import { getXtermScaledDimensions } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal';
|
|
65
78
|
import { TERMINAL_BACKGROUND_COLOR } from 'vscode/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry';
|
|
66
79
|
import { getTestItemContextOverlay } from './explorerProjections/testItemContextOverlay.js';
|
|
67
80
|
import { testingStatesToIcons, testingRunIcon, testingDebugIcon, testingCoverageReport } from './icons.js';
|
|
81
|
+
import { renderTestMessageAsText, colorizeTestMessageInEditor } from './testMessageColorizer.js';
|
|
68
82
|
import { testingPeekBorder, testingMessagePeekBorder, testingPeekHeaderBackground, testingPeekMessageHeaderBackground } from './theme.js';
|
|
69
83
|
import { getTestingConfiguration } from '../common/configuration.js';
|
|
70
84
|
import { MutableObservableValue, staticObservableValue } from 'vscode/vscode/vs/workbench/contrib/testing/common/observableValue';
|
|
@@ -75,15 +89,20 @@ import { ITestProfileService } from 'vscode/vscode/vs/workbench/contrib/testing/
|
|
|
75
89
|
import { resultItemParents, LiveTestResult, maxCountPriority } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResult';
|
|
76
90
|
import { ITestResultService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResultService';
|
|
77
91
|
import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService';
|
|
78
|
-
import { ITestMessage, getMarkId } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
|
|
92
|
+
import { InternalTestItem, ITestMessage, getMarkId, testResultStateToContextValues } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
|
|
79
93
|
import { TestingContextKeys } from 'vscode/vscode/vs/workbench/contrib/testing/common/testingContextKeys';
|
|
80
94
|
import { ITestingPeekOpener } from 'vscode/vscode/vs/workbench/contrib/testing/common/testingPeekOpener';
|
|
81
95
|
import { isFailedState, cmpPriority } from 'vscode/vscode/vs/workbench/contrib/testing/common/testingStates';
|
|
82
96
|
import { parseTestUri, buildTestUri } from '../common/testingUri.js';
|
|
83
97
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
84
|
-
import {
|
|
98
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
85
99
|
|
|
86
100
|
var TestingOutputPeekController_1, TestResultsViewContent_1, TestResultsPeek_1, TestRunElementRenderer_1;
|
|
101
|
+
const getMessageArgs = (test, message) => ({
|
|
102
|
+
$mid: 18 ,
|
|
103
|
+
test: InternalTestItem.serialize(test),
|
|
104
|
+
message: ITestMessage.serialize(message),
|
|
105
|
+
});
|
|
87
106
|
class MessageSubject {
|
|
88
107
|
get isDiffable() {
|
|
89
108
|
return this.message.type === 0 && isDiffable(this.message);
|
|
@@ -91,13 +110,6 @@ class MessageSubject {
|
|
|
91
110
|
get contextValue() {
|
|
92
111
|
return this.message.type === 0 ? this.message.contextValue : undefined;
|
|
93
112
|
}
|
|
94
|
-
get context() {
|
|
95
|
-
return {
|
|
96
|
-
$mid: 18 ,
|
|
97
|
-
extId: this.test.extId,
|
|
98
|
-
message: ITestMessage.serialize(this.message),
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
113
|
constructor(result, test, taskIndex, messageIndex) {
|
|
102
114
|
this.result = result;
|
|
103
115
|
this.taskIndex = taskIndex;
|
|
@@ -110,6 +122,7 @@ class MessageSubject {
|
|
|
110
122
|
this.actualUri = buildTestUri({ ...parts, type: 3 });
|
|
111
123
|
this.messageUri = buildTestUri({ ...parts, type: 2 });
|
|
112
124
|
const message = this.message = messages[this.messageIndex];
|
|
125
|
+
this.context = getMessageArgs(test, message);
|
|
113
126
|
this.revealLocation = message.location ?? (test.item.uri && test.item.range ? { uri: test.item.uri, range: Range.lift(test.item.range) } : undefined);
|
|
114
127
|
}
|
|
115
128
|
}
|
|
@@ -452,7 +465,7 @@ let TestingOutputPeekController = TestingOutputPeekController_1 = class TestingO
|
|
|
452
465
|
this.peek.value.create();
|
|
453
466
|
}
|
|
454
467
|
if (subject instanceof MessageSubject) {
|
|
455
|
-
alert(
|
|
468
|
+
alert(renderTestMessageAsText(subject.message.message));
|
|
456
469
|
}
|
|
457
470
|
this.peek.value.setModel(subject);
|
|
458
471
|
this.currentPeekUri = uri;
|
|
@@ -785,7 +798,7 @@ let TestResultsPeek = class TestResultsPeek extends PeekViewWidget {
|
|
|
785
798
|
async showInPlace(subject) {
|
|
786
799
|
if (subject instanceof MessageSubject) {
|
|
787
800
|
const message = subject.message;
|
|
788
|
-
this.setTitle(firstLine(
|
|
801
|
+
this.setTitle(firstLine(renderTestMessageAsText(message.message)), stripIcons(subject.test.label));
|
|
789
802
|
}
|
|
790
803
|
else {
|
|
791
804
|
this.setTitle(( localizeWithPath(
|
|
@@ -1029,6 +1042,7 @@ let PlainTextMessagePeek = class PlainTextMessagePeek extends Disposable {
|
|
|
1029
1042
|
this.container = container;
|
|
1030
1043
|
this.instantiationService = instantiationService;
|
|
1031
1044
|
this.modelService = modelService;
|
|
1045
|
+
this.widgetDecorations = this._register(( new MutableDisposable()));
|
|
1032
1046
|
this.widget = this._register(( new MutableDisposable()));
|
|
1033
1047
|
this.model = this._register(( new MutableDisposable()));
|
|
1034
1048
|
}
|
|
@@ -1049,10 +1063,12 @@ let PlainTextMessagePeek = class PlainTextMessagePeek extends Disposable {
|
|
|
1049
1063
|
}
|
|
1050
1064
|
this.widget.value.setModel(modelRef.object.textEditorModel);
|
|
1051
1065
|
this.widget.value.updateOptions(commonEditorOptions);
|
|
1066
|
+
this.widgetDecorations.value = colorizeTestMessageInEditor(message.message, this.widget.value);
|
|
1052
1067
|
}
|
|
1053
1068
|
clear() {
|
|
1054
|
-
this.
|
|
1069
|
+
this.widgetDecorations.clear();
|
|
1055
1070
|
this.widget.clear();
|
|
1071
|
+
this.model.clear();
|
|
1056
1072
|
}
|
|
1057
1073
|
layout(dimensions) {
|
|
1058
1074
|
this.dimension = dimensions;
|
|
@@ -1399,7 +1415,10 @@ class TestCaseElement {
|
|
|
1399
1415
|
this.test = test;
|
|
1400
1416
|
this.taskIndex = taskIndex;
|
|
1401
1417
|
this.type = 'test';
|
|
1402
|
-
this.context =
|
|
1418
|
+
this.context = {
|
|
1419
|
+
$mid: 16 ,
|
|
1420
|
+
tests: [InternalTestItem.serialize(this.test)],
|
|
1421
|
+
};
|
|
1403
1422
|
this.id = `${this.results.id}/${this.test.item.extId}`;
|
|
1404
1423
|
}
|
|
1405
1424
|
}
|
|
@@ -1433,11 +1452,10 @@ class TestMessageElement {
|
|
|
1433
1452
|
return Event.filter(this.result.onChange, e => e.item.item.extId === this.test.item.extId);
|
|
1434
1453
|
}
|
|
1435
1454
|
get context() {
|
|
1436
|
-
return
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
};
|
|
1455
|
+
return getMessageArgs(this.test, this.message);
|
|
1456
|
+
}
|
|
1457
|
+
get outputSubject() {
|
|
1458
|
+
return ( new TestOutputSubject(this.result, this.taskIndex, this.test));
|
|
1441
1459
|
}
|
|
1442
1460
|
constructor(result, test, taskIndex, messageIndex) {
|
|
1443
1461
|
this.result = result;
|
|
@@ -1456,7 +1474,7 @@ class TestMessageElement {
|
|
|
1456
1474
|
testExtId: test.item.extId
|
|
1457
1475
|
});
|
|
1458
1476
|
this.id = ( this.uri.toString());
|
|
1459
|
-
const asPlaintext =
|
|
1477
|
+
const asPlaintext = renderTestMessageAsText(m.message);
|
|
1460
1478
|
const lines = count(asPlaintext.trimEnd(), '\n');
|
|
1461
1479
|
this.label = firstLine(asPlaintext);
|
|
1462
1480
|
if (lines > 0) {
|
|
@@ -1528,6 +1546,7 @@ let OutputPeekTree = class OutputPeekTree extends Disposable {
|
|
|
1528
1546
|
if (task.coverage.get()) {
|
|
1529
1547
|
result = Iterable.concat(Iterable.single({
|
|
1530
1548
|
element: ( new CoverageElement(results, task, coverageService)),
|
|
1549
|
+
incompressible: true,
|
|
1531
1550
|
}), result);
|
|
1532
1551
|
}
|
|
1533
1552
|
return result;
|
|
@@ -1762,8 +1781,8 @@ let TestRunElementRenderer = class TestRunElementRenderer {
|
|
|
1762
1781
|
const icon = append(wrapper, $('.state'));
|
|
1763
1782
|
const label = append(wrapper, $('.name'));
|
|
1764
1783
|
const actionBar = ( new ActionBar(wrapper, {
|
|
1765
|
-
actionViewItemProvider: action => action instanceof MenuItemAction
|
|
1766
|
-
? this.instantiationService.createInstance(MenuEntryActionViewItem, action,
|
|
1784
|
+
actionViewItemProvider: (action, options) => action instanceof MenuItemAction
|
|
1785
|
+
? this.instantiationService.createInstance(MenuEntryActionViewItem, action, { hoverDelegate: options.hoverDelegate })
|
|
1767
1786
|
: undefined
|
|
1768
1787
|
}));
|
|
1769
1788
|
const elementDisposable = ( new DisposableStore());
|
|
@@ -1860,9 +1879,7 @@ let TreeActionsProvider = class TreeActionsProvider {
|
|
|
1860
1879
|
}
|
|
1861
1880
|
}
|
|
1862
1881
|
if (element instanceof TestCaseElement || element instanceof TestMessageElement) {
|
|
1863
|
-
contextKeys.push([TestingContextKeys.testResultOutdated.key, element.test.retired], ...getTestItemContextOverlay(element.test, capabilities));
|
|
1864
|
-
}
|
|
1865
|
-
if (element instanceof TestCaseElement) {
|
|
1882
|
+
contextKeys.push([TestingContextKeys.testResultOutdated.key, element.test.retired], [TestingContextKeys.testResultState.key, testResultStateToContextValues[element.test.ownComputedState]], ...getTestItemContextOverlay(element.test, capabilities));
|
|
1866
1883
|
const extId = element.test.item.extId;
|
|
1867
1884
|
if (( element.test.tasks[element.taskIndex].messages.some(m => m.type === 1 ))) {
|
|
1868
1885
|
primary.push(( new Action('testing.outputPeek.showResultOutput', ( localizeWithPath(
|
|
@@ -1890,11 +1907,13 @@ let TreeActionsProvider = class TreeActionsProvider {
|
|
|
1890
1907
|
'Debug Test'
|
|
1891
1908
|
)), ThemeIcon.asClassName(testingDebugIcon), undefined, () => this.commandService.executeCommand('vscode.runTestsById', 4 , extId))));
|
|
1892
1909
|
}
|
|
1910
|
+
}
|
|
1911
|
+
if (element instanceof TestMessageElement) {
|
|
1893
1912
|
primary.push(( new Action('testing.outputPeek.goToFile', ( localizeWithPath(
|
|
1894
1913
|
'vs/workbench/contrib/testing/browser/testingOutputPeek',
|
|
1895
1914
|
'testing.goToFile',
|
|
1896
1915
|
"Go to Source"
|
|
1897
|
-
)), ThemeIcon.asClassName(Codicon.goToFile), undefined, () => this.commandService.executeCommand('vscode.revealTest', extId))));
|
|
1916
|
+
)), ThemeIcon.asClassName(Codicon.goToFile), undefined, () => this.commandService.executeCommand('vscode.revealTest', element.test.item.extId))));
|
|
1898
1917
|
}
|
|
1899
1918
|
if (element instanceof TestMessageElement) {
|
|
1900
1919
|
id = MenuId.TestMessageContext;
|