@codingame/monaco-vscode-testing-service-override 4.5.0 → 4.5.2
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/index.d.ts +1 -1
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/testing/browser/codeCoverageDecorations.js +46 -81
- package/vscode/src/vs/workbench/contrib/testing/browser/icons.js +32 -147
- package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageBars.js +18 -17
- package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageView.js +62 -102
- package/vscode/src/vs/workbench/contrib/testing/browser/testExplorerActions.js +181 -381
- package/vscode/src/vs/workbench/contrib/testing/browser/testing.contribution.js +25 -56
- package/vscode/src/vs/workbench/contrib/testing/browser/testingConfigurationUi.js +3 -10
- package/vscode/src/vs/workbench/contrib/testing/browser/testingDecorations.js +133 -193
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.js +31 -70
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerView.js +120 -173
- package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.js +217 -306
- package/vscode/src/vs/workbench/contrib/testing/browser/testingProgressUiService.js +16 -19
- package/vscode/src/vs/workbench/contrib/testing/browser/testingViewPaneContainer.js +14 -17
- package/vscode/src/vs/workbench/contrib/testing/browser/theme.js +79 -166
- package/vscode/src/vs/workbench/contrib/testing/common/configuration.js +48 -123
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +12 -50
- package/vscode/src/vs/workbench/contrib/testing/common/testServiceImpl.js +50 -57
- package/vscode/src/vs/workbench/contrib/testing/common/testingContentProvider.js +13 -16
- package/vscode/src/vs/workbench/contrib/testing/common/testingContextKeys.js +85 -108
- package/testing.d.ts +0 -5
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from 'vscode/service-override/testing';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-testing-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
30
|
-
"@codingame/monaco-vscode-terminal-service-override": "4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2",
|
|
30
|
+
"@codingame/monaco-vscode-terminal-service-override": "4.5.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -29,30 +29,27 @@ import { ITestCoverageService } from 'vscode/vscode/vs/workbench/contrib/testing
|
|
|
29
29
|
import { TestingContextKeys } from '../common/testingContextKeys.js';
|
|
30
30
|
|
|
31
31
|
var CodeCoverageDecorations_1, LineHoverWidget_1;
|
|
32
|
+
const _moduleId = "vs/workbench/contrib/testing/browser/codeCoverageDecorations";
|
|
32
33
|
const MAX_HOVERED_LINES = 30;
|
|
33
34
|
const CLASS_HIT = 'coverage-deco-hit';
|
|
34
35
|
const CLASS_MISS = 'coverage-deco-miss';
|
|
35
|
-
const TOGGLE_INLINE_COMMAND_TEXT = ( localizeWithPath(
|
|
36
|
-
'vs/workbench/contrib/testing/browser/codeCoverageDecorations',
|
|
37
|
-
'testing.toggleInlineCoverage',
|
|
38
|
-
'Toggle Inline Coverage'
|
|
39
|
-
));
|
|
36
|
+
const TOGGLE_INLINE_COMMAND_TEXT = ( localizeWithPath(_moduleId, 0, 'Toggle Inline Coverage'));
|
|
40
37
|
const TOGGLE_INLINE_COMMAND_ID = 'testing.toggleInlineCoverage';
|
|
41
38
|
const BRANCH_MISS_INDICATOR_CHARS = 4;
|
|
42
39
|
let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
43
40
|
static { CodeCoverageDecorations_1 = this; }
|
|
44
41
|
static { this.showInline = observableValue('inlineCoverage', false); }
|
|
45
|
-
static { this.fileCoverageDecorations = ( new WeakMap()); }
|
|
42
|
+
static { this.fileCoverageDecorations = ( (new WeakMap())); }
|
|
46
43
|
constructor(editor, instantiationService, coverage, log) {
|
|
47
44
|
super();
|
|
48
45
|
this.editor = editor;
|
|
49
46
|
this.log = log;
|
|
50
|
-
this.displayedStore = this._register(( new DisposableStore()));
|
|
51
|
-
this.hoveredStore = this._register(( new DisposableStore()));
|
|
52
|
-
this.decorationIds = ( new Map());
|
|
53
|
-
this.lineHoverWidget = ( new Lazy(
|
|
47
|
+
this.displayedStore = this._register(( (new DisposableStore())));
|
|
48
|
+
this.hoveredStore = this._register(( (new DisposableStore())));
|
|
49
|
+
this.decorationIds = ( (new Map()));
|
|
50
|
+
this.lineHoverWidget = ( (new Lazy(
|
|
54
51
|
() => this._register(instantiationService.createInstance(LineHoverWidget, this.editor))
|
|
55
|
-
));
|
|
52
|
+
)));
|
|
56
53
|
const modelObs = observableFromEvent(editor.onDidChangeModel, () => editor.getModel());
|
|
57
54
|
const configObs = observableFromEvent(editor.onDidChangeConfiguration, i => i);
|
|
58
55
|
const fileCoverage = derived(reader => {
|
|
@@ -122,7 +119,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
122
119
|
}
|
|
123
120
|
hoverInlineDecoration(model, position) {
|
|
124
121
|
const allDecorations = model.getDecorationsInRange(Range.fromPositions(position));
|
|
125
|
-
const decoration = mapFindFirst(allDecorations, ({ id }) => ( this.decorationIds.has(id)) ? { id, deco: this.decorationIds.get(id) } : undefined);
|
|
122
|
+
const decoration = mapFindFirst(allDecorations, ({ id }) => ( (this.decorationIds.has(id))) ? { id, deco: this.decorationIds.get(id) } : undefined);
|
|
126
123
|
if (decoration === this.hoveredSubject) {
|
|
127
124
|
return;
|
|
128
125
|
}
|
|
@@ -151,14 +148,14 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
151
148
|
this.hoveredStore.clear();
|
|
152
149
|
this.hoveredSubject = lineNumber;
|
|
153
150
|
const todo = [{ line: lineNumber, dir: 0 }];
|
|
154
|
-
const toEnable = ( new Set());
|
|
151
|
+
const toEnable = ( (new Set()));
|
|
155
152
|
const inlineEnabled = CodeCoverageDecorations_1.showInline.get();
|
|
156
153
|
if (!CodeCoverageDecorations_1.showInline.get()) {
|
|
157
154
|
for (let i = 0; i < todo.length && i < MAX_HOVERED_LINES; i++) {
|
|
158
155
|
const { line, dir } = todo[i];
|
|
159
156
|
let found = false;
|
|
160
157
|
for (const decoration of model.getLineDecorations(line)) {
|
|
161
|
-
if (( this.decorationIds.has(decoration.id))) {
|
|
158
|
+
if (( (this.decorationIds.has(decoration.id)))) {
|
|
162
159
|
toEnable.add(decoration.id);
|
|
163
160
|
found = true;
|
|
164
161
|
}
|
|
@@ -212,7 +209,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
212
209
|
if (detail.type === 2 ) {
|
|
213
210
|
const hits = detail.detail.branches[detail.branch].count;
|
|
214
211
|
const cls = hits ? CLASS_HIT : CLASS_MISS;
|
|
215
|
-
const showMissIndicator = !hits && range.isEmpty() && ( detail.detail.branches.some(b => b.count));
|
|
212
|
+
const showMissIndicator = !hits && range.isEmpty() && ( (detail.detail.branches.some(b => b.count)));
|
|
216
213
|
const options = {
|
|
217
214
|
showIfCollapsed: showMissIndicator,
|
|
218
215
|
description: 'coverage-gutter',
|
|
@@ -263,7 +260,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
263
260
|
});
|
|
264
261
|
this.displayedStore.add(toDisposable(() => {
|
|
265
262
|
model.changeDecorations(e => {
|
|
266
|
-
for (const decoration of ( this.decorationIds.keys())) {
|
|
263
|
+
for (const decoration of ( (this.decorationIds.keys()))) {
|
|
267
264
|
e.removeDecoration(decoration);
|
|
268
265
|
}
|
|
269
266
|
this.decorationIds.clear();
|
|
@@ -281,7 +278,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
281
278
|
if (existing) {
|
|
282
279
|
return existing;
|
|
283
280
|
}
|
|
284
|
-
const cts = this.loadingCancellation = ( new CancellationTokenSource());
|
|
281
|
+
const cts = this.loadingCancellation = ( (new CancellationTokenSource()));
|
|
285
282
|
this.displayedStore.add(this.loadingCancellation);
|
|
286
283
|
try {
|
|
287
284
|
const details = await coverage.details(this.loadingCancellation.token);
|
|
@@ -289,7 +286,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
289
286
|
return;
|
|
290
287
|
}
|
|
291
288
|
const model = CodeCoverageDecorations_1.fileCoverageDecorations.get(coverage)
|
|
292
|
-
|| ( new CoverageDetailsModel(details, textModel));
|
|
289
|
+
|| ( (new CoverageDetailsModel(details, textModel)));
|
|
293
290
|
CodeCoverageDecorations_1.fileCoverageDecorations.set(coverage, model);
|
|
294
291
|
return model;
|
|
295
292
|
}
|
|
@@ -299,11 +296,11 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
299
296
|
return undefined;
|
|
300
297
|
}
|
|
301
298
|
};
|
|
302
|
-
CodeCoverageDecorations = CodeCoverageDecorations_1 = ( __decorate([
|
|
303
|
-
( __param(1, IInstantiationService)),
|
|
304
|
-
( __param(2, ITestCoverageService)),
|
|
305
|
-
( __param(3, ILogService))
|
|
306
|
-
], CodeCoverageDecorations));
|
|
299
|
+
CodeCoverageDecorations = CodeCoverageDecorations_1 = ( (__decorate([
|
|
300
|
+
( (__param(1, IInstantiationService))),
|
|
301
|
+
( (__param(2, ITestCoverageService))),
|
|
302
|
+
( (__param(3, ILogService)))
|
|
303
|
+
], CodeCoverageDecorations)));
|
|
307
304
|
const countBadge = (count) => {
|
|
308
305
|
if (count === 0) {
|
|
309
306
|
return undefined;
|
|
@@ -319,11 +316,11 @@ class CoverageDetailsModel {
|
|
|
319
316
|
constructor(details, textModel) {
|
|
320
317
|
this.details = details;
|
|
321
318
|
this.ranges = [];
|
|
322
|
-
const detailRanges = ( details.map(detail => ({
|
|
319
|
+
const detailRanges = ( (details.map(detail => ({
|
|
323
320
|
range: tidyLocation(detail.location),
|
|
324
321
|
primary: true,
|
|
325
322
|
metadata: { detail, description: this.describe(detail, textModel) }
|
|
326
|
-
})));
|
|
323
|
+
}))));
|
|
327
324
|
for (const { range, metadata: { detail } } of detailRanges) {
|
|
328
325
|
if (detail.type === 1 && detail.branches) {
|
|
329
326
|
for (let i = 0; i < detail.branches.length; i++) {
|
|
@@ -384,9 +381,9 @@ class CoverageDetailsModel {
|
|
|
384
381
|
const text = wrapName(model.getValueInRange(tidyLocation(detail.location)).trim() || `<empty statement>`);
|
|
385
382
|
if (detail.branches?.length) {
|
|
386
383
|
const covered = detail.branches.filter(b => !!b.count).length;
|
|
387
|
-
return ( new MarkdownString()).appendMarkdown(( localizeWithPath(
|
|
388
|
-
|
|
389
|
-
|
|
384
|
+
return ( (new MarkdownString())).appendMarkdown(( localizeWithPath(
|
|
385
|
+
_moduleId,
|
|
386
|
+
1,
|
|
390
387
|
'{0} of {1} of branches in {2} were covered.',
|
|
391
388
|
covered,
|
|
392
389
|
detail.branches.length,
|
|
@@ -402,27 +399,15 @@ class CoverageDetailsModel {
|
|
|
402
399
|
const { count, label } = detail.detail.branches[detail.branch];
|
|
403
400
|
const label2 = label ? wrapInBackticks(label) : `#${detail.branch + 1}`;
|
|
404
401
|
if (!count) {
|
|
405
|
-
return ( new MarkdownString()).appendMarkdown(( localizeWithPath(
|
|
406
|
-
'vs/workbench/contrib/testing/browser/codeCoverageDecorations',
|
|
407
|
-
'coverage.branchNotCovered',
|
|
408
|
-
'Branch {0} in {1} was not covered.',
|
|
409
|
-
label2,
|
|
410
|
-
text
|
|
411
|
-
)));
|
|
402
|
+
return ( (new MarkdownString())).appendMarkdown(( localizeWithPath(_moduleId, 2, 'Branch {0} in {1} was not covered.', label2, text)));
|
|
412
403
|
}
|
|
413
404
|
else if (count === true) {
|
|
414
|
-
return ( new MarkdownString()).appendMarkdown(( localizeWithPath(
|
|
415
|
-
'vs/workbench/contrib/testing/browser/codeCoverageDecorations',
|
|
416
|
-
'coverage.branchCoveredYes',
|
|
417
|
-
'Branch {0} in {1} was executed.',
|
|
418
|
-
label2,
|
|
419
|
-
text
|
|
420
|
-
)));
|
|
405
|
+
return ( (new MarkdownString())).appendMarkdown(( localizeWithPath(_moduleId, 3, 'Branch {0} in {1} was executed.', label2, text)));
|
|
421
406
|
}
|
|
422
407
|
else {
|
|
423
|
-
return ( new MarkdownString()).appendMarkdown(( localizeWithPath(
|
|
424
|
-
|
|
425
|
-
|
|
408
|
+
return ( (new MarkdownString())).appendMarkdown(( localizeWithPath(
|
|
409
|
+
_moduleId,
|
|
410
|
+
4,
|
|
426
411
|
'Branch {0} in {1} was executed {2} time(s).',
|
|
427
412
|
label2,
|
|
428
413
|
text,
|
|
@@ -434,31 +419,15 @@ class CoverageDetailsModel {
|
|
|
434
419
|
}
|
|
435
420
|
}
|
|
436
421
|
function namedDetailLabel(name, detail) {
|
|
437
|
-
return ( new MarkdownString()).appendMarkdown(!detail.count
|
|
438
|
-
? ( localizeWithPath(
|
|
439
|
-
'vs/workbench/contrib/testing/browser/codeCoverageDecorations',
|
|
440
|
-
'coverage.declExecutedNo',
|
|
441
|
-
'`{0}` was not executed.',
|
|
442
|
-
name
|
|
443
|
-
))
|
|
422
|
+
return ( (new MarkdownString())).appendMarkdown(!detail.count
|
|
423
|
+
? ( localizeWithPath(_moduleId, 5, '`{0}` was not executed.', name))
|
|
444
424
|
: typeof detail.count === 'number'
|
|
445
|
-
? ( localizeWithPath(
|
|
446
|
-
|
|
447
|
-
'coverage.declExecutedCount',
|
|
448
|
-
'`{0}` was executed {1} time(s).',
|
|
449
|
-
name,
|
|
450
|
-
detail.count
|
|
451
|
-
))
|
|
452
|
-
: ( localizeWithPath(
|
|
453
|
-
'vs/workbench/contrib/testing/browser/codeCoverageDecorations',
|
|
454
|
-
'coverage.declExecutedYes',
|
|
455
|
-
'`{0}` was executed.',
|
|
456
|
-
name
|
|
457
|
-
)));
|
|
425
|
+
? ( localizeWithPath(_moduleId, 6, '`{0}` was executed {1} time(s).', name, detail.count))
|
|
426
|
+
: ( localizeWithPath(_moduleId, 7, '`{0}` was executed.', name)));
|
|
458
427
|
}
|
|
459
428
|
function tidyLocation(location) {
|
|
460
429
|
if (location instanceof Position) {
|
|
461
|
-
return Range.fromPositions(location, ( new Position(location.lineNumber, 0x7FFFFFFF)));
|
|
430
|
+
return Range.fromPositions(location, ( (new Position(location.lineNumber, 0x7FFFFFFF))));
|
|
462
431
|
}
|
|
463
432
|
return location;
|
|
464
433
|
}
|
|
@@ -469,7 +438,7 @@ let LineHoverComputer = class LineHoverComputer {
|
|
|
469
438
|
}
|
|
470
439
|
computeSync() {
|
|
471
440
|
const strs = [];
|
|
472
|
-
const s = ( new MarkdownString()).appendMarkdown(`[${TOGGLE_INLINE_COMMAND_TEXT}](command:${TOGGLE_INLINE_COMMAND_ID})`);
|
|
441
|
+
const s = ( (new MarkdownString())).appendMarkdown(`[${TOGGLE_INLINE_COMMAND_TEXT}](command:${TOGGLE_INLINE_COMMAND_ID})`);
|
|
473
442
|
s.isTrusted = true;
|
|
474
443
|
const binding = this.keybindingService.lookupKeybinding(TOGGLE_INLINE_COMMAND_ID);
|
|
475
444
|
if (binding) {
|
|
@@ -479,9 +448,9 @@ let LineHoverComputer = class LineHoverComputer {
|
|
|
479
448
|
return strs;
|
|
480
449
|
}
|
|
481
450
|
};
|
|
482
|
-
LineHoverComputer = ( __decorate([
|
|
483
|
-
( __param(0, IKeybindingService))
|
|
484
|
-
], LineHoverComputer));
|
|
451
|
+
LineHoverComputer = ( (__decorate([
|
|
452
|
+
( (__param(0, IKeybindingService)))
|
|
453
|
+
], LineHoverComputer)));
|
|
485
454
|
function wrapInBackticks(str) {
|
|
486
455
|
return '`' + str.replace(/[\n\r`]/g, '') + '`';
|
|
487
456
|
}
|
|
@@ -497,11 +466,11 @@ let LineHoverWidget = class LineHoverWidget extends Disposable {
|
|
|
497
466
|
constructor(editor, instantiationService) {
|
|
498
467
|
super();
|
|
499
468
|
this.editor = editor;
|
|
500
|
-
this.hover = this._register(( new HoverWidget()));
|
|
501
|
-
this.renderDisposables = this._register(( new DisposableStore()));
|
|
469
|
+
this.hover = this._register(( (new HoverWidget())));
|
|
470
|
+
this.renderDisposables = this._register(( (new DisposableStore())));
|
|
502
471
|
this.computer = instantiationService.createInstance(LineHoverComputer);
|
|
503
472
|
this.markdownRenderer = this._register(instantiationService.createInstance(MarkdownRenderer, { editor: this.editor }));
|
|
504
|
-
this.hoverOperation = this._register(( new HoverOperation(this.editor, this.computer)));
|
|
473
|
+
this.hoverOperation = this._register(( (new HoverOperation(this.editor, this.computer))));
|
|
505
474
|
this.hover.containerDomNode.classList.add('hidden');
|
|
506
475
|
this.hoverOperation.onResult(result => {
|
|
507
476
|
if (result.value.length) {
|
|
@@ -563,18 +532,14 @@ let LineHoverWidget = class LineHoverWidget extends Disposable {
|
|
|
563
532
|
h.containerDomNode.style.top = `${Math.max(Math.round(top), 0)}px`;
|
|
564
533
|
}
|
|
565
534
|
};
|
|
566
|
-
LineHoverWidget = LineHoverWidget_1 = ( __decorate([
|
|
567
|
-
( __param(1, IInstantiationService))
|
|
568
|
-
], LineHoverWidget));
|
|
535
|
+
LineHoverWidget = LineHoverWidget_1 = ( (__decorate([
|
|
536
|
+
( (__param(1, IInstantiationService)))
|
|
537
|
+
], LineHoverWidget)));
|
|
569
538
|
registerAction2(class ToggleInlineCoverage extends Action2 {
|
|
570
539
|
constructor() {
|
|
571
540
|
super({
|
|
572
541
|
id: TOGGLE_INLINE_COMMAND_ID,
|
|
573
|
-
title: ( localize2WithPath(
|
|
574
|
-
'vs/workbench/contrib/testing/browser/codeCoverageDecorations',
|
|
575
|
-
'coverage.toggleInline',
|
|
576
|
-
"Toggle Inline Coverage"
|
|
577
|
-
)),
|
|
542
|
+
title: ( localize2WithPath(_moduleId, 8, "Toggle Inline Coverage")),
|
|
578
543
|
category: Categories.Test,
|
|
579
544
|
keybinding: {
|
|
580
545
|
weight: 200 ,
|
|
@@ -5,154 +5,39 @@ import { registerThemingParticipant } from 'vscode/vscode/vs/platform/theme/comm
|
|
|
5
5
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
6
6
|
import { testStatesToIconColors, testStatesToRetiredIconColors, testingColorRunAction } from './theme.js';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)));
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)));
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
)));
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)));
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
)));
|
|
38
|
-
const testingDebugIcon = registerIcon('testing-debug-icon', Codicon.debugAltSmall, ( localizeWithPath(
|
|
39
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
40
|
-
'testingDebugIcon',
|
|
41
|
-
'Icon of the "debug test" action.'
|
|
42
|
-
)));
|
|
43
|
-
const testingCoverageIcon = registerIcon('testing-coverage-icon', Codicon.runCoverage, ( localizeWithPath(
|
|
44
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
45
|
-
'testingCoverageIcon',
|
|
46
|
-
'Icon of the "run test with coverage" action.'
|
|
47
|
-
)));
|
|
48
|
-
const testingCoverageAllIcon = registerIcon('testing-coverage-all-icon', Codicon.runAllCoverage, ( localizeWithPath(
|
|
49
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
50
|
-
'testingRunAllWithCoverageIcon',
|
|
51
|
-
'Icon of the "run all tests with coverage" action.'
|
|
52
|
-
)));
|
|
53
|
-
const testingCancelIcon = registerIcon('testing-cancel-icon', Codicon.debugStop, ( localizeWithPath(
|
|
54
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
55
|
-
'testingCancelIcon',
|
|
56
|
-
'Icon to cancel ongoing test runs.'
|
|
57
|
-
)));
|
|
58
|
-
const testingFilterIcon = registerIcon('testing-filter', Codicon.filter, ( localizeWithPath(
|
|
59
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
60
|
-
'filterIcon',
|
|
61
|
-
'Icon for the \'Filter\' action in the testing view.'
|
|
62
|
-
)));
|
|
63
|
-
const testingHiddenIcon = registerIcon('testing-hidden', Codicon.eyeClosed, ( localizeWithPath(
|
|
64
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
65
|
-
'hiddenIcon',
|
|
66
|
-
'Icon shown beside hidden tests, when they\'ve been shown.'
|
|
67
|
-
)));
|
|
68
|
-
registerIcon('testing-show-as-list-icon', Codicon.listTree, ( localizeWithPath(
|
|
69
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
70
|
-
'testingShowAsList',
|
|
71
|
-
'Icon shown when the test explorer is disabled as a tree.'
|
|
72
|
-
)));
|
|
73
|
-
registerIcon('testing-show-as-list-icon', Codicon.listFlat, ( localizeWithPath(
|
|
74
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
75
|
-
'testingShowAsTree',
|
|
76
|
-
'Icon shown when the test explorer is disabled as a list.'
|
|
77
|
-
)));
|
|
78
|
-
const testingUpdateProfiles = registerIcon('testing-update-profiles', Codicon.gear, ( localizeWithPath(
|
|
79
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
80
|
-
'testingUpdateProfiles',
|
|
81
|
-
'Icon shown to update test profiles.'
|
|
82
|
-
)));
|
|
83
|
-
const testingRefreshTests = registerIcon('testing-refresh-tests', Codicon.refresh, ( localizeWithPath(
|
|
84
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
85
|
-
'testingRefreshTests',
|
|
86
|
-
'Icon on the button to refresh tests.'
|
|
87
|
-
)));
|
|
88
|
-
const testingTurnContinuousRunOn = registerIcon('testing-turn-continuous-run-on', Codicon.eye, ( localizeWithPath(
|
|
89
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
90
|
-
'testingTurnContinuousRunOn',
|
|
91
|
-
'Icon to turn continuous test runs on.'
|
|
92
|
-
)));
|
|
93
|
-
const testingTurnContinuousRunOff = registerIcon('testing-turn-continuous-run-off', Codicon.eyeClosed, ( localizeWithPath(
|
|
94
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
95
|
-
'testingTurnContinuousRunOff',
|
|
96
|
-
'Icon to turn continuous test runs off.'
|
|
97
|
-
)));
|
|
98
|
-
const testingContinuousIsOn = registerIcon('testing-continuous-is-on', Codicon.eye, ( localizeWithPath(
|
|
99
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
100
|
-
'testingTurnContinuousRunIsOn',
|
|
101
|
-
'Icon when continuous run is on for a test ite,.'
|
|
102
|
-
)));
|
|
103
|
-
const testingCancelRefreshTests = registerIcon('testing-cancel-refresh-tests', Codicon.stop, ( localizeWithPath(
|
|
104
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
105
|
-
'testingCancelRefreshTests',
|
|
106
|
-
'Icon on the button to cancel refreshing tests.'
|
|
107
|
-
)));
|
|
108
|
-
const testingCoverageReport = registerIcon('testing-coverage', Codicon.coverage, ( localizeWithPath(
|
|
109
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
110
|
-
'testingCoverage',
|
|
111
|
-
'Icon representing test coverage'
|
|
112
|
-
)));
|
|
113
|
-
const testingWasCovered = registerIcon('testing-was-covered', Codicon.check, ( localizeWithPath(
|
|
114
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
115
|
-
'testingWasCovered',
|
|
116
|
-
'Icon representing that an element was covered'
|
|
117
|
-
)));
|
|
118
|
-
const testingCoverageMissingBranch = registerIcon('testing-missing-branch', Codicon.question, ( localizeWithPath(
|
|
119
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
120
|
-
'testingMissingBranch',
|
|
121
|
-
'Icon representing a uncovered block without a range'
|
|
122
|
-
)));
|
|
123
|
-
const testingStatesToIcons = ( new Map([
|
|
124
|
-
[6 , registerIcon('testing-error-icon', Codicon.issues, ( localizeWithPath(
|
|
125
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
126
|
-
'testingErrorIcon',
|
|
127
|
-
'Icon shown for tests that have an error.'
|
|
128
|
-
)))],
|
|
129
|
-
[4 , registerIcon('testing-failed-icon', Codicon.error, ( localizeWithPath(
|
|
130
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
131
|
-
'testingFailedIcon',
|
|
132
|
-
'Icon shown for tests that failed.'
|
|
133
|
-
)))],
|
|
134
|
-
[3 , registerIcon('testing-passed-icon', Codicon.pass, ( localizeWithPath(
|
|
135
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
136
|
-
'testingPassedIcon',
|
|
137
|
-
'Icon shown for tests that passed.'
|
|
138
|
-
)))],
|
|
139
|
-
[1 , registerIcon('testing-queued-icon', Codicon.history, ( localizeWithPath(
|
|
140
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
141
|
-
'testingQueuedIcon',
|
|
142
|
-
'Icon shown for tests that are queued.'
|
|
143
|
-
)))],
|
|
8
|
+
const _moduleId = "vs/workbench/contrib/testing/browser/icons";
|
|
9
|
+
const testingViewIcon = registerIcon('test-view-icon', Codicon.beaker, ( localizeWithPath(_moduleId, 0, 'View icon of the test view.')));
|
|
10
|
+
const testingResultsIcon = registerIcon('test-results-icon', Codicon.checklist, ( localizeWithPath(_moduleId, 1, 'Icons for test results.')));
|
|
11
|
+
const testingRunIcon = registerIcon('testing-run-icon', Codicon.run, ( localizeWithPath(_moduleId, 2, 'Icon of the "run test" action.')));
|
|
12
|
+
const testingRerunIcon = registerIcon('testing-rerun-icon', Codicon.refresh, ( localizeWithPath(_moduleId, 3, 'Icon of the "rerun tests" action.')));
|
|
13
|
+
const testingRunAllIcon = registerIcon('testing-run-all-icon', Codicon.runAll, ( localizeWithPath(_moduleId, 4, 'Icon of the "run all tests" action.')));
|
|
14
|
+
const testingDebugAllIcon = registerIcon('testing-debug-all-icon', Codicon.debugAltSmall, ( localizeWithPath(_moduleId, 5, 'Icon of the "debug all tests" action.')));
|
|
15
|
+
const testingDebugIcon = registerIcon('testing-debug-icon', Codicon.debugAltSmall, ( localizeWithPath(_moduleId, 6, 'Icon of the "debug test" action.')));
|
|
16
|
+
const testingCoverageIcon = registerIcon('testing-coverage-icon', Codicon.runCoverage, ( localizeWithPath(_moduleId, 7, 'Icon of the "run test with coverage" action.')));
|
|
17
|
+
const testingCoverageAllIcon = registerIcon('testing-coverage-all-icon', Codicon.runAllCoverage, ( localizeWithPath(_moduleId, 8, 'Icon of the "run all tests with coverage" action.')));
|
|
18
|
+
const testingCancelIcon = registerIcon('testing-cancel-icon', Codicon.debugStop, ( localizeWithPath(_moduleId, 9, 'Icon to cancel ongoing test runs.')));
|
|
19
|
+
const testingFilterIcon = registerIcon('testing-filter', Codicon.filter, ( localizeWithPath(_moduleId, 10, 'Icon for the \'Filter\' action in the testing view.')));
|
|
20
|
+
const testingHiddenIcon = registerIcon('testing-hidden', Codicon.eyeClosed, ( localizeWithPath(_moduleId, 11, 'Icon shown beside hidden tests, when they\'ve been shown.')));
|
|
21
|
+
registerIcon('testing-show-as-list-icon', Codicon.listTree, ( localizeWithPath(_moduleId, 12, 'Icon shown when the test explorer is disabled as a tree.')));
|
|
22
|
+
registerIcon('testing-show-as-list-icon', Codicon.listFlat, ( localizeWithPath(_moduleId, 13, 'Icon shown when the test explorer is disabled as a list.')));
|
|
23
|
+
const testingUpdateProfiles = registerIcon('testing-update-profiles', Codicon.gear, ( localizeWithPath(_moduleId, 14, 'Icon shown to update test profiles.')));
|
|
24
|
+
const testingRefreshTests = registerIcon('testing-refresh-tests', Codicon.refresh, ( localizeWithPath(_moduleId, 15, 'Icon on the button to refresh tests.')));
|
|
25
|
+
const testingTurnContinuousRunOn = registerIcon('testing-turn-continuous-run-on', Codicon.eye, ( localizeWithPath(_moduleId, 16, 'Icon to turn continuous test runs on.')));
|
|
26
|
+
const testingTurnContinuousRunOff = registerIcon('testing-turn-continuous-run-off', Codicon.eyeClosed, ( localizeWithPath(_moduleId, 17, 'Icon to turn continuous test runs off.')));
|
|
27
|
+
const testingContinuousIsOn = registerIcon('testing-continuous-is-on', Codicon.eye, ( localizeWithPath(_moduleId, 18, 'Icon when continuous run is on for a test ite,.')));
|
|
28
|
+
const testingCancelRefreshTests = registerIcon('testing-cancel-refresh-tests', Codicon.stop, ( localizeWithPath(_moduleId, 19, 'Icon on the button to cancel refreshing tests.')));
|
|
29
|
+
const testingCoverageReport = registerIcon('testing-coverage', Codicon.coverage, ( localizeWithPath(_moduleId, 20, 'Icon representing test coverage')));
|
|
30
|
+
const testingWasCovered = registerIcon('testing-was-covered', Codicon.check, ( localizeWithPath(_moduleId, 21, 'Icon representing that an element was covered')));
|
|
31
|
+
const testingCoverageMissingBranch = registerIcon('testing-missing-branch', Codicon.question, ( localizeWithPath(_moduleId, 22, 'Icon representing a uncovered block without a range')));
|
|
32
|
+
const testingStatesToIcons = ( (new Map([
|
|
33
|
+
[6 , registerIcon('testing-error-icon', Codicon.issues, ( localizeWithPath(_moduleId, 23, 'Icon shown for tests that have an error.')))],
|
|
34
|
+
[4 , registerIcon('testing-failed-icon', Codicon.error, ( localizeWithPath(_moduleId, 24, 'Icon shown for tests that failed.')))],
|
|
35
|
+
[3 , registerIcon('testing-passed-icon', Codicon.pass, ( localizeWithPath(_moduleId, 25, 'Icon shown for tests that passed.')))],
|
|
36
|
+
[1 , registerIcon('testing-queued-icon', Codicon.history, ( localizeWithPath(_moduleId, 26, 'Icon shown for tests that are queued.')))],
|
|
144
37
|
[2 , spinningLoading],
|
|
145
|
-
[5 , registerIcon('testing-skipped-icon', Codicon.debugStepOver, ( localizeWithPath(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
'Icon shown for tests that are skipped.'
|
|
149
|
-
)))],
|
|
150
|
-
[0 , registerIcon('testing-unset-icon', Codicon.circleOutline, ( localizeWithPath(
|
|
151
|
-
'vs/workbench/contrib/testing/browser/icons',
|
|
152
|
-
'testingUnsetIcon',
|
|
153
|
-
'Icon shown for tests that are in an unset state.'
|
|
154
|
-
)))],
|
|
155
|
-
]));
|
|
38
|
+
[5 , registerIcon('testing-skipped-icon', Codicon.debugStepOver, ( localizeWithPath(_moduleId, 27, 'Icon shown for tests that are skipped.')))],
|
|
39
|
+
[0 , registerIcon('testing-unset-icon', Codicon.circleOutline, ( localizeWithPath(_moduleId, 28, 'Icon shown for tests that are in an unset state.')))],
|
|
40
|
+
])));
|
|
156
41
|
registerThemingParticipant((theme, collector) => {
|
|
157
42
|
for (const [state, icon] of testingStatesToIcons.entries()) {
|
|
158
43
|
const color = testStatesToIconColors[state];
|
|
@@ -30,6 +30,7 @@ import { getTestingConfiguration, observeTestingConfiguration } from '../common/
|
|
|
30
30
|
import { getTotalCoveragePercent } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverage';
|
|
31
31
|
import { ITestCoverageService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverageService.service';
|
|
32
32
|
|
|
33
|
+
const _moduleId = "vs/workbench/contrib/testing/browser/testCoverageBars";
|
|
33
34
|
let ManagedTestCoverageBars = class ManagedTestCoverageBars extends Disposable {
|
|
34
35
|
get visible() {
|
|
35
36
|
return !!this._coverage;
|
|
@@ -38,7 +39,7 @@ let ManagedTestCoverageBars = class ManagedTestCoverageBars extends Disposable {
|
|
|
38
39
|
super();
|
|
39
40
|
this.options = options;
|
|
40
41
|
this.configurationService = configurationService;
|
|
41
|
-
this.el = ( new Lazy(() => {
|
|
42
|
+
this.el = ( (new Lazy(() => {
|
|
42
43
|
if (this.options.compact) {
|
|
43
44
|
const el = h('.test-coverage-bars.compact', [
|
|
44
45
|
h('.tpc@overall'),
|
|
@@ -59,8 +60,8 @@ let ManagedTestCoverageBars = class ManagedTestCoverageBars extends Disposable {
|
|
|
59
60
|
this.attachHover(el.branch, branchCoverageText);
|
|
60
61
|
return el;
|
|
61
62
|
}
|
|
62
|
-
}));
|
|
63
|
-
this.visibleStore = this._register(( new DisposableStore()));
|
|
63
|
+
})));
|
|
64
|
+
this.visibleStore = this._register(( (new DisposableStore())));
|
|
64
65
|
this.customHovers = [];
|
|
65
66
|
}
|
|
66
67
|
attachHover(target, factory) {
|
|
@@ -108,9 +109,9 @@ let ManagedTestCoverageBars = class ManagedTestCoverageBars extends Disposable {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
};
|
|
111
|
-
ManagedTestCoverageBars = ( __decorate([
|
|
112
|
-
( __param(1, IConfigurationService))
|
|
113
|
-
], ManagedTestCoverageBars));
|
|
112
|
+
ManagedTestCoverageBars = ( (__decorate([
|
|
113
|
+
( (__param(1, IConfigurationService)))
|
|
114
|
+
], ManagedTestCoverageBars)));
|
|
114
115
|
const percent = (cc) => clamp(cc.total === 0 ? 1 : cc.covered / cc.total, 0, 1);
|
|
115
116
|
const epsilon = 10e-8;
|
|
116
117
|
const barWidth = 16;
|
|
@@ -173,24 +174,24 @@ const displayPercent = (value, precision = 2) => {
|
|
|
173
174
|
};
|
|
174
175
|
const nf = new Intl.NumberFormat();
|
|
175
176
|
const stmtCoverageText = (coverage) => ( localizeWithPath(
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
_moduleId,
|
|
178
|
+
0,
|
|
178
179
|
'{0}/{1} statements covered ({2})',
|
|
179
180
|
nf.format(coverage.statement.covered),
|
|
180
181
|
nf.format(coverage.statement.total),
|
|
181
182
|
displayPercent(percent(coverage.statement))
|
|
182
183
|
));
|
|
183
184
|
const fnCoverageText = (coverage) => coverage.declaration && ( localizeWithPath(
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
_moduleId,
|
|
186
|
+
1,
|
|
186
187
|
'{0}/{1} functions covered ({2})',
|
|
187
188
|
nf.format(coverage.declaration.covered),
|
|
188
189
|
nf.format(coverage.declaration.total),
|
|
189
190
|
displayPercent(percent(coverage.declaration))
|
|
190
191
|
));
|
|
191
192
|
const branchCoverageText = (coverage) => coverage.branch && ( localizeWithPath(
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
_moduleId,
|
|
194
|
+
2,
|
|
194
195
|
'{0}/{1} branches covered ({2})',
|
|
195
196
|
nf.format(coverage.branch.covered),
|
|
196
197
|
nf.format(coverage.branch.total),
|
|
@@ -203,7 +204,7 @@ const getOverallHoverText = (coverage) => {
|
|
|
203
204
|
branchCoverageText(coverage),
|
|
204
205
|
].filter(isDefined).join('\n\n');
|
|
205
206
|
return {
|
|
206
|
-
markdown: ( new MarkdownString()).appendText(str),
|
|
207
|
+
markdown: ( (new MarkdownString())).appendText(str),
|
|
207
208
|
markdownNotSupportedFallback: str
|
|
208
209
|
};
|
|
209
210
|
};
|
|
@@ -232,9 +233,9 @@ let ExplorerTestCoverageBars = class ExplorerTestCoverageBars extends ManagedTes
|
|
|
232
233
|
this.options.container?.classList.toggle('explorer-item-with-test-coverage', this.visible);
|
|
233
234
|
}
|
|
234
235
|
};
|
|
235
|
-
ExplorerTestCoverageBars = ( __decorate([
|
|
236
|
-
( __param(1, IConfigurationService)),
|
|
237
|
-
( __param(2, ITestCoverageService))
|
|
238
|
-
], ExplorerTestCoverageBars));
|
|
236
|
+
ExplorerTestCoverageBars = ( (__decorate([
|
|
237
|
+
( (__param(1, IConfigurationService))),
|
|
238
|
+
( (__param(2, ITestCoverageService)))
|
|
239
|
+
], ExplorerTestCoverageBars)));
|
|
239
240
|
|
|
240
241
|
export { ExplorerTestCoverageBars, ManagedTestCoverageBars };
|