@codingame/monaco-vscode-testing-service-override 9.0.3 → 10.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 +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackWidget.js +12 -15
- package/vscode/src/vs/workbench/contrib/testing/browser/codeCoverageDecorations.js +61 -93
- package/vscode/src/vs/workbench/contrib/testing/browser/codeCoverageDisplayUtils.js +8 -9
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/index.js +5 -6
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/listProjection.js +8 -9
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.js +12 -13
- package/vscode/src/vs/workbench/contrib/testing/browser/icons.js +30 -31
- package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageBars.js +15 -13
- package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageView.js +32 -39
- package/vscode/src/vs/workbench/contrib/testing/browser/testExplorerActions.js +275 -309
- package/vscode/src/vs/workbench/contrib/testing/browser/testMessageColorizer.js +8 -18
- package/vscode/src/vs/workbench/contrib/testing/browser/testResultsView/testResultsOutput.js +18 -21
- package/vscode/src/vs/workbench/contrib/testing/browser/testResultsView/testResultsSubject.js +11 -12
- package/vscode/src/vs/workbench/contrib/testing/browser/testResultsView/testResultsTree.js +35 -37
- package/vscode/src/vs/workbench/contrib/testing/browser/testResultsView/testResultsViewContent.js +14 -23
- package/vscode/src/vs/workbench/contrib/testing/browser/testing.contribution.js +41 -33
- package/vscode/src/vs/workbench/contrib/testing/browser/testingConfigurationUi.js +3 -3
- package/vscode/src/vs/workbench/contrib/testing/browser/testingDecorations.js +72 -82
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.js +17 -20
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerView.js +106 -125
- package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.js +52 -59
- package/vscode/src/vs/workbench/contrib/testing/browser/testingProgressUiService.js +21 -23
- package/vscode/src/vs/workbench/contrib/testing/browser/testingViewPaneContainer.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/browser/theme.js +42 -43
- package/vscode/src/vs/workbench/contrib/testing/common/configuration.js +76 -125
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +20 -0
- package/vscode/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.js +4 -4
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +5 -6
- package/vscode/src/vs/workbench/contrib/testing/common/testExclusions.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testExplorerFilterState.js +8 -17
- package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +16 -17
- package/vscode/src/vs/workbench/contrib/testing/common/testResultService.js +4 -5
- package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testService.js +3 -5
- package/vscode/src/vs/workbench/contrib/testing/common/testServiceImpl.js +13 -15
- package/vscode/src/vs/workbench/contrib/testing/common/testingContentProvider.js +11 -12
- package/vscode/src/vs/workbench/contrib/testing/common/testingContextKeys.js +40 -39
- package/vscode/src/vs/workbench/contrib/testing/common/testingContinuousRunService.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testingUri.js +24 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-testing-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
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@
|
|
30
|
-
"@codingame/monaco-vscode-terminal-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-terminal-service-override": "10.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -7,14 +7,12 @@ import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
|
7
7
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
8
8
|
import { Disposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
9
|
import { observableValue, transaction } from 'vscode/vscode/vs/base/common/observableInternal/base';
|
|
10
|
-
import
|
|
10
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
11
11
|
import { autorun, autorunWithStore } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
12
|
+
import { derived } from 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
12
13
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
13
|
-
import 'vscode/vscode/vs/base/common/arrays';
|
|
14
|
-
import { Constants } from 'vscode/vscode/vs/base/common/uint';
|
|
15
14
|
import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
|
|
16
15
|
import './media/callStackWidget.css.js';
|
|
17
|
-
import { EditorContributionInstantiation } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
18
16
|
import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
19
17
|
import { EmbeddedCodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget';
|
|
20
18
|
import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
@@ -25,7 +23,6 @@ import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
|
25
23
|
import { createActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
26
24
|
import { MenuWorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
|
|
27
25
|
import { MenuId, registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
28
|
-
import { TextEditorSelectionRevealType } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
29
26
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
30
27
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
31
28
|
import { WorkbenchList } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
@@ -167,7 +164,7 @@ let StackAccessibilityProvider = class StackAccessibilityProvider {
|
|
|
167
164
|
if (e instanceof CallStackFrame) {
|
|
168
165
|
if (e.source && e.line) {
|
|
169
166
|
return ( localize(
|
|
170
|
-
|
|
167
|
+
10873,
|
|
171
168
|
'{0}, line {1} in {2}',
|
|
172
169
|
e.name,
|
|
173
170
|
e.line,
|
|
@@ -179,7 +176,7 @@ let StackAccessibilityProvider = class StackAccessibilityProvider {
|
|
|
179
176
|
assertNever();
|
|
180
177
|
}
|
|
181
178
|
getWidgetAriaLabel() {
|
|
182
|
-
return ( localize(
|
|
179
|
+
return ( localize(10874, 'Stack Trace'));
|
|
183
180
|
}
|
|
184
181
|
};
|
|
185
182
|
StackAccessibilityProvider = ( (__decorate([
|
|
@@ -306,7 +303,7 @@ let FrameCodeRenderer = class FrameCodeRenderer extends AbstractFrameRenderer {
|
|
|
306
303
|
finishRenderTemplate(data) {
|
|
307
304
|
const contributions = [{
|
|
308
305
|
id: ClickToLocationContribution.ID,
|
|
309
|
-
instantiation:
|
|
306
|
+
instantiation: 2 ,
|
|
310
307
|
ctor: ClickToLocationContribution,
|
|
311
308
|
}];
|
|
312
309
|
const editor = this.containingEditor
|
|
@@ -361,7 +358,7 @@ let FrameCodeRenderer = class FrameCodeRenderer extends AbstractFrameRenderer {
|
|
|
361
358
|
template.toolbar.context = { uri: item.source, range };
|
|
362
359
|
template.editor.setHiddenAreas([
|
|
363
360
|
Range.fromPositions({ column: 1, lineNumber: 1 }, { column: 1, lineNumber: Math.max(1, item.line - CONTEXT_LINES - 1) }),
|
|
364
|
-
Range.fromPositions({ column: 1, lineNumber: item.line + CONTEXT_LINES + 1 }, { column: 1, lineNumber:
|
|
361
|
+
Range.fromPositions({ column: 1, lineNumber: item.line + CONTEXT_LINES + 1 }, { column: 1, lineNumber: 1073741824 }),
|
|
365
362
|
]);
|
|
366
363
|
template.editor.changeDecorations(accessor => {
|
|
367
364
|
for (const d of template.decorations) {
|
|
@@ -370,7 +367,7 @@ let FrameCodeRenderer = class FrameCodeRenderer extends AbstractFrameRenderer {
|
|
|
370
367
|
template.decorations.length = 0;
|
|
371
368
|
const beforeRange = range.setStartPosition(range.startLineNumber, 1);
|
|
372
369
|
const hasCharactersBefore = !!template.editor.getModel()?.getValueInRange(beforeRange).trim();
|
|
373
|
-
const decoRange = range.setEndPosition(range.startLineNumber,
|
|
370
|
+
const decoRange = range.setEndPosition(range.startLineNumber, 1073741824 );
|
|
374
371
|
template.decorations.push(accessor.addDecoration(decoRange, makeStackFrameColumnDecoration(!hasCharactersBefore)));
|
|
375
372
|
template.decorations.push(accessor.addDecoration(decoRange, TOP_STACK_FRAME_DECORATION));
|
|
376
373
|
});
|
|
@@ -399,7 +396,7 @@ let MissingCodeRenderer = class MissingCodeRenderer {
|
|
|
399
396
|
const cast = element;
|
|
400
397
|
templateData.label.element.setResource({
|
|
401
398
|
name: cast.name,
|
|
402
|
-
description: ( localize(
|
|
399
|
+
description: ( localize(10875, 'Line {0} column {1}', cast.line, cast.column)),
|
|
403
400
|
range: { startLineNumber: cast.line, startColumn: cast.column, endColumn: cast.column, endLineNumber: cast.line },
|
|
404
401
|
}, {
|
|
405
402
|
icon: Codicon.fileBinary,
|
|
@@ -460,7 +457,7 @@ let SkippedRenderer = class SkippedRenderer {
|
|
|
460
457
|
}
|
|
461
458
|
button.enabled = false;
|
|
462
459
|
this.loadFrames(data.current).catch(e => {
|
|
463
|
-
this.notificationService.error(( localize(
|
|
460
|
+
this.notificationService.error(( localize(10876, 'Failed to load stack frames: {0}', e.message)));
|
|
464
461
|
});
|
|
465
462
|
}));
|
|
466
463
|
return data;
|
|
@@ -498,7 +495,7 @@ let ClickToLocationContribution = class ClickToLocationContribution extends Disp
|
|
|
498
495
|
resource: model.uri,
|
|
499
496
|
options: {
|
|
500
497
|
selection: Range.fromPositions(( (new Position(this.current.line, this.current.word.startColumn)))),
|
|
501
|
-
selectionRevealType:
|
|
498
|
+
selectionRevealType: 1 ,
|
|
502
499
|
},
|
|
503
500
|
}, e.hasSideBySideModifier ? SIDE_GROUP : undefined);
|
|
504
501
|
}));
|
|
@@ -537,7 +534,7 @@ registerAction2(class extends Action2 {
|
|
|
537
534
|
constructor() {
|
|
538
535
|
super({
|
|
539
536
|
id: 'callStackWidget.goToFile',
|
|
540
|
-
title: ( localize2(
|
|
537
|
+
title: ( localize2(10877, 'Open File')),
|
|
541
538
|
icon: Codicon.goToFile,
|
|
542
539
|
menu: {
|
|
543
540
|
id: MenuId.DebugCallStackToolbar,
|
|
@@ -552,7 +549,7 @@ registerAction2(class extends Action2 {
|
|
|
552
549
|
resource: uri,
|
|
553
550
|
options: {
|
|
554
551
|
selection: range,
|
|
555
|
-
selectionRevealType:
|
|
552
|
+
selectionRevealType: 1 ,
|
|
556
553
|
},
|
|
557
554
|
});
|
|
558
555
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { h, addStandardDisposableListener, EventType, reset } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
3
|
import { ActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
4
|
-
import { ActionBar
|
|
4
|
+
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
5
5
|
import { renderIcon } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
6
6
|
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
7
7
|
import { mapFindFirst } from 'vscode/vscode/vs/base/common/arraysFind';
|
|
@@ -9,18 +9,18 @@ import { assertNever, assert } from 'vscode/vscode/vs/base/common/assert';
|
|
|
9
9
|
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
10
10
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
11
11
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
12
|
-
import { KeyChord
|
|
12
|
+
import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
13
13
|
import { Lazy } from 'vscode/vscode/vs/base/common/lazy';
|
|
14
14
|
import { Disposable, DisposableStore, toDisposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
15
15
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
16
|
-
import
|
|
16
|
+
import 'vscode/vscode/vs/base/common/event';
|
|
17
17
|
import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
18
|
+
import { derived } from 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
18
19
|
import { observableFromEvent } from 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
19
20
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
20
21
|
import { isUriComponents, URI } from 'vscode/vscode/vs/base/common/uri';
|
|
21
|
-
import {
|
|
22
|
+
import { isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
22
23
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
23
|
-
import { EditorOption } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
24
24
|
import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
25
25
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
26
26
|
import { InjectedTextCursorStops } from 'vscode/vscode/vs/editor/common/model';
|
|
@@ -33,25 +33,22 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
|
|
|
33
33
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
34
34
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
35
35
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
36
|
-
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
37
36
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
38
37
|
import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
39
38
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
40
39
|
import { labels, getLabelForItem } from './codeCoverageDisplayUtils.js';
|
|
41
40
|
import { testingCoverageMissingBranch, testingCoverageReport, testingFilterIcon, testingRerunIcon } from './icons.js';
|
|
42
41
|
import { ManagedTestCoverageBars } from './testCoverageBars.js';
|
|
43
|
-
import {
|
|
44
|
-
import { TestCommandId } from 'vscode/vscode/vs/workbench/contrib/testing/common/constants';
|
|
42
|
+
import { getTestingConfiguration } from '../common/configuration.js';
|
|
45
43
|
import { FileCoverage } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverage';
|
|
46
44
|
import { ITestCoverageService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverageService.service';
|
|
47
45
|
import { TestId } from 'vscode/vscode/vs/workbench/contrib/testing/common/testId';
|
|
48
46
|
import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService.service';
|
|
49
|
-
import { DetailType } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
|
|
50
47
|
import { TestingContextKeys } from '../common/testingContextKeys.js';
|
|
51
48
|
|
|
52
49
|
const CLASS_HIT = 'coverage-deco-hit';
|
|
53
50
|
const CLASS_MISS = 'coverage-deco-miss';
|
|
54
|
-
const TOGGLE_INLINE_COMMAND_TEXT = ( localize(
|
|
51
|
+
const TOGGLE_INLINE_COMMAND_TEXT = ( localize(8285, 'Toggle Inline'));
|
|
55
52
|
const TOGGLE_INLINE_COMMAND_ID = 'testing.toggleInlineCoverage';
|
|
56
53
|
const BRANCH_MISS_INDICATOR_CHARS = 4;
|
|
57
54
|
let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
@@ -93,7 +90,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
93
90
|
this.clear();
|
|
94
91
|
}
|
|
95
92
|
}));
|
|
96
|
-
const toolbarEnabled = observableConfigValue(
|
|
93
|
+
const toolbarEnabled = observableConfigValue("testing.coverageToolbarEnabled" , true, configurationService);
|
|
97
94
|
this._register(autorun(reader => {
|
|
98
95
|
const c = fileCoverage.read(reader);
|
|
99
96
|
if (c && toolbarEnabled.read(reader)) {
|
|
@@ -107,17 +104,17 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
107
104
|
const c = fileCoverage.read(reader);
|
|
108
105
|
if (c) {
|
|
109
106
|
const evt = configObs.read(reader);
|
|
110
|
-
if (evt?.hasChanged(
|
|
107
|
+
if (evt?.hasChanged(69 ) !== false) {
|
|
111
108
|
this.updateEditorStyles();
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
}));
|
|
115
112
|
this._register(editor.onMouseMove(e => {
|
|
116
113
|
const model = editor.getModel();
|
|
117
|
-
if (e.target.type ===
|
|
118
|
-
this.hoverLineNumber(editor.getModel()
|
|
114
|
+
if (e.target.type === 3 && model) {
|
|
115
|
+
this.hoverLineNumber(editor.getModel());
|
|
119
116
|
}
|
|
120
|
-
else if (coverage.showInline.get() && e.target.type ===
|
|
117
|
+
else if (coverage.showInline.get() && e.target.type === 6 && model) {
|
|
121
118
|
this.hoverInlineDecoration(model, e.target.position);
|
|
122
119
|
}
|
|
123
120
|
else {
|
|
@@ -138,7 +135,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
138
135
|
}));
|
|
139
136
|
}
|
|
140
137
|
updateEditorStyles() {
|
|
141
|
-
const lineHeight = this.editor.getOption(
|
|
138
|
+
const lineHeight = this.editor.getOption(69 );
|
|
142
139
|
const { style } = this.editor.getContainerDomNode();
|
|
143
140
|
style.setProperty('--vscode-testing-coverage-lineHeight', `${lineHeight}px`);
|
|
144
141
|
}
|
|
@@ -166,57 +163,28 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
166
163
|
});
|
|
167
164
|
}));
|
|
168
165
|
}
|
|
169
|
-
hoverLineNumber(model
|
|
170
|
-
if (
|
|
166
|
+
hoverLineNumber(model) {
|
|
167
|
+
if (this.hoveredSubject === 'lineNo' || !this.details || this.coverage.showInline.get()) {
|
|
171
168
|
return;
|
|
172
169
|
}
|
|
173
170
|
this.hoveredStore.clear();
|
|
174
|
-
this.hoveredSubject =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (!( (ranges.some(r => r.startLineNumber <= line && r.endLineNumber >= line)))) {
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
let found = false;
|
|
185
|
-
for (const decoration of model.getLineDecorations(line)) {
|
|
186
|
-
if (( (this.decorationIds.has(decoration.id)))) {
|
|
187
|
-
toEnable.add(decoration.id);
|
|
188
|
-
found = true;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (found) {
|
|
192
|
-
if (dir <= 0) {
|
|
193
|
-
todo.push({ line: line - 1, dir: -1 });
|
|
194
|
-
}
|
|
195
|
-
if (dir >= 0) {
|
|
196
|
-
todo.push({ line: line + 1, dir: 1 });
|
|
197
|
-
}
|
|
198
|
-
}
|
|
171
|
+
this.hoveredSubject = 'lineNo';
|
|
172
|
+
model.changeDecorations(e => {
|
|
173
|
+
for (const [id, decoration] of this.decorationIds) {
|
|
174
|
+
const { applyHoverOptions, options } = decoration;
|
|
175
|
+
const dup = { ...options };
|
|
176
|
+
applyHoverOptions(dup);
|
|
177
|
+
e.changeDecorationOptions(id, dup);
|
|
199
178
|
}
|
|
200
|
-
|
|
201
|
-
for (const id of toEnable) {
|
|
202
|
-
const { applyHoverOptions, options } = this.decorationIds.get(id);
|
|
203
|
-
const dup = { ...options };
|
|
204
|
-
applyHoverOptions(dup);
|
|
205
|
-
e.changeDecorationOptions(id, dup);
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}
|
|
179
|
+
});
|
|
209
180
|
this.hoveredStore.add(this.editor.onMouseLeave(() => {
|
|
210
181
|
this.hoveredStore.clear();
|
|
211
182
|
}));
|
|
212
183
|
this.hoveredStore.add(toDisposable(() => {
|
|
213
184
|
this.hoveredSubject = undefined;
|
|
214
185
|
model.changeDecorations(e => {
|
|
215
|
-
for (const id of
|
|
216
|
-
|
|
217
|
-
if (deco) {
|
|
218
|
-
e.changeDecorationOptions(id, deco.options);
|
|
219
|
-
}
|
|
186
|
+
for (const [id, decoration] of this.decorationIds) {
|
|
187
|
+
e.changeDecorationOptions(id, decoration.options);
|
|
220
188
|
}
|
|
221
189
|
});
|
|
222
190
|
}));
|
|
@@ -230,7 +198,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
230
198
|
model.changeDecorations(e => {
|
|
231
199
|
for (const detailRange of details.ranges) {
|
|
232
200
|
const { metadata: { detail, description }, range, primary } = detailRange;
|
|
233
|
-
if (detail.type ===
|
|
201
|
+
if (detail.type === 2 ) {
|
|
234
202
|
const hits = detail.detail.branches[detail.branch].count;
|
|
235
203
|
const cls = hits ? CLASS_HIT : CLASS_MISS;
|
|
236
204
|
const showMissIndicator = !hits && range.isEmpty() && ( (detail.detail.branches.some(b => b.count)));
|
|
@@ -261,7 +229,7 @@ let CodeCoverageDecorations = class CodeCoverageDecorations extends Disposable {
|
|
|
261
229
|
}
|
|
262
230
|
this.decorationIds.set(e.addDecoration(range, options), { options, applyHoverOptions, detail: detailRange });
|
|
263
231
|
}
|
|
264
|
-
else if (detail.type ===
|
|
232
|
+
else if (detail.type === 1 ) {
|
|
265
233
|
const cls = detail.count ? CLASS_HIT : CLASS_MISS;
|
|
266
234
|
const options = {
|
|
267
235
|
showIfCollapsed: false,
|
|
@@ -344,9 +312,9 @@ class CoverageDetailsModel {
|
|
|
344
312
|
metadata: { detail, description: this.describe(detail, textModel) }
|
|
345
313
|
}))));
|
|
346
314
|
for (const { range, metadata: { detail } } of detailRanges) {
|
|
347
|
-
if (detail.type ===
|
|
315
|
+
if (detail.type === 1 && detail.branches) {
|
|
348
316
|
for (let i = 0; i < detail.branches.length; i++) {
|
|
349
|
-
const branch = { type:
|
|
317
|
+
const branch = { type: 2 , branch: i, detail };
|
|
350
318
|
detailRanges.push({
|
|
351
319
|
range: tidyLocation(detail.branches[i].location || Range.fromPositions(range.getEndPosition())),
|
|
352
320
|
primary: true,
|
|
@@ -396,15 +364,15 @@ class CoverageDetailsModel {
|
|
|
396
364
|
}
|
|
397
365
|
}
|
|
398
366
|
describe(detail, model) {
|
|
399
|
-
if (detail.type ===
|
|
367
|
+
if (detail.type === 0 ) {
|
|
400
368
|
return namedDetailLabel(detail.name, detail);
|
|
401
369
|
}
|
|
402
|
-
else if (detail.type ===
|
|
370
|
+
else if (detail.type === 1 ) {
|
|
403
371
|
const text = wrapName(model.getValueInRange(tidyLocation(detail.location)).trim() || `<empty statement>`);
|
|
404
372
|
if (detail.branches?.length) {
|
|
405
373
|
const covered = detail.branches.filter(b => !!b.count).length;
|
|
406
374
|
return ( (new MarkdownString())).appendMarkdown(( localize(
|
|
407
|
-
|
|
375
|
+
8286,
|
|
408
376
|
'{0} of {1} of branches in {2} were covered.',
|
|
409
377
|
covered,
|
|
410
378
|
detail.branches.length,
|
|
@@ -415,18 +383,18 @@ class CoverageDetailsModel {
|
|
|
415
383
|
return namedDetailLabel(text, detail);
|
|
416
384
|
}
|
|
417
385
|
}
|
|
418
|
-
else if (detail.type ===
|
|
386
|
+
else if (detail.type === 2 ) {
|
|
419
387
|
const text = wrapName(model.getValueInRange(tidyLocation(detail.detail.location)).trim() || `<empty statement>`);
|
|
420
388
|
const { count, label } = detail.detail.branches[detail.branch];
|
|
421
389
|
const label2 = label ? wrapInBackticks(label) : `#${detail.branch + 1}`;
|
|
422
390
|
if (!count) {
|
|
423
|
-
return ( (new MarkdownString())).appendMarkdown(( localize(
|
|
391
|
+
return ( (new MarkdownString())).appendMarkdown(( localize(8287, 'Branch {0} in {1} was not covered.', label2, text)));
|
|
424
392
|
}
|
|
425
393
|
else if (count === true) {
|
|
426
|
-
return ( (new MarkdownString())).appendMarkdown(( localize(
|
|
394
|
+
return ( (new MarkdownString())).appendMarkdown(( localize(8288, 'Branch {0} in {1} was executed.', label2, text)));
|
|
427
395
|
}
|
|
428
396
|
else {
|
|
429
|
-
return ( (new MarkdownString())).appendMarkdown(( localize(
|
|
397
|
+
return ( (new MarkdownString())).appendMarkdown(( localize(8289, 'Branch {0} in {1} was executed {2} time(s).', label2, text, count)));
|
|
430
398
|
}
|
|
431
399
|
}
|
|
432
400
|
assertNever();
|
|
@@ -434,10 +402,10 @@ class CoverageDetailsModel {
|
|
|
434
402
|
}
|
|
435
403
|
function namedDetailLabel(name, detail) {
|
|
436
404
|
return ( (new MarkdownString())).appendMarkdown(!detail.count
|
|
437
|
-
? ( localize(
|
|
405
|
+
? ( localize(8290, '`{0}` was not executed.', name))
|
|
438
406
|
: typeof detail.count === 'number'
|
|
439
|
-
? ( localize(
|
|
440
|
-
: ( localize(
|
|
407
|
+
? ( localize(8291, '`{0}` was executed {1} time(s).', name, detail.count))
|
|
408
|
+
: ( localize(8292, '`{0}` was executed.', name)));
|
|
441
409
|
}
|
|
442
410
|
function tidyLocation(location) {
|
|
443
411
|
if (location instanceof Position) {
|
|
@@ -479,7 +447,7 @@ let CoverageToolbarWidget = class CoverageToolbarWidget extends Disposable {
|
|
|
479
447
|
container: this._domNode.bars,
|
|
480
448
|
}));
|
|
481
449
|
this.actionBar = this._register(instaService.createInstance(ActionBar, this._domNode.toolbar, {
|
|
482
|
-
orientation:
|
|
450
|
+
orientation: 0 ,
|
|
483
451
|
actionViewItemProvider: (action, options) => {
|
|
484
452
|
const vm = ( (new CodiconActionViewItem(undefined, action, options)));
|
|
485
453
|
if (action instanceof ActionWithIcon) {
|
|
@@ -507,7 +475,7 @@ let CoverageToolbarWidget = class CoverageToolbarWidget extends Disposable {
|
|
|
507
475
|
}
|
|
508
476
|
getPosition() {
|
|
509
477
|
return {
|
|
510
|
-
preference:
|
|
478
|
+
preference: 2 ,
|
|
511
479
|
stackOridinal: 9,
|
|
512
480
|
};
|
|
513
481
|
}
|
|
@@ -534,8 +502,8 @@ let CoverageToolbarWidget = class CoverageToolbarWidget extends Disposable {
|
|
|
534
502
|
return;
|
|
535
503
|
}
|
|
536
504
|
const toggleAction = ( (new ActionWithIcon('toggleInline', this.coverage.showInline.get()
|
|
537
|
-
? ( localize(
|
|
538
|
-
: ( localize(
|
|
505
|
+
? ( localize(8293, 'Hide Inline Coverage'))
|
|
506
|
+
: ( localize(8294, 'Show Inline Coverage')), testingCoverageReport, undefined, () => this.coverage.showInline.set(!this.coverage.showInline.get(), undefined))));
|
|
539
507
|
const kb = this.keybindingService.lookupKeybinding(TOGGLE_INLINE_COMMAND_ID);
|
|
540
508
|
if (kb) {
|
|
541
509
|
toggleAction.tooltip = `${TOGGLE_INLINE_COMMAND_TEXT} (${kb.getLabel()})`;
|
|
@@ -549,17 +517,17 @@ let CoverageToolbarWidget = class CoverageToolbarWidget extends Disposable {
|
|
|
549
517
|
labels.showingFilterFor(testItem.label),
|
|
550
518
|
testingFilterIcon,
|
|
551
519
|
undefined,
|
|
552
|
-
() => this.commandService.executeCommand(
|
|
520
|
+
() => this.commandService.executeCommand("testing.coverageFilterToTestInEditor" , this.current, this.editor)
|
|
553
521
|
))));
|
|
554
522
|
}
|
|
555
523
|
else if (current.coverage.perTestData?.size) {
|
|
556
524
|
this.actionBar.push(( (new ActionWithIcon('perTestFilter', ( localize(
|
|
557
|
-
|
|
525
|
+
8295,
|
|
558
526
|
"{0} test(s) ran code in this file",
|
|
559
527
|
current.coverage.perTestData.size
|
|
560
|
-
)), testingFilterIcon, undefined, () => this.commandService.executeCommand(
|
|
528
|
+
)), testingFilterIcon, undefined, () => this.commandService.executeCommand("testing.coverageFilterToTestInEditor" , this.current, this.editor)))));
|
|
561
529
|
}
|
|
562
|
-
this.actionBar.push(( (new ActionWithIcon('rerun', ( localize(
|
|
530
|
+
this.actionBar.push(( (new ActionWithIcon('rerun', ( localize(8296, 'Rerun')), testingRerunIcon, !this.isRunning, () => this.rerunTest()))));
|
|
563
531
|
}
|
|
564
532
|
show() {
|
|
565
533
|
if (this.registered) {
|
|
@@ -586,7 +554,7 @@ let CoverageToolbarWidget = class CoverageToolbarWidget extends Disposable {
|
|
|
586
554
|
});
|
|
587
555
|
}));
|
|
588
556
|
ds.add(this.configurationService.onDidChangeConfiguration(e => {
|
|
589
|
-
if (this.current && (e.affectsConfiguration(
|
|
557
|
+
if (this.current && (e.affectsConfiguration("testing.coverageBarThresholds" ) || e.affectsConfiguration("testing.displayedCoveragePercent" ))) {
|
|
590
558
|
this.setCoverage(this.current.coverage, this.current.testId);
|
|
591
559
|
}
|
|
592
560
|
}));
|
|
@@ -619,15 +587,15 @@ registerAction2(class ToggleInlineCoverage extends Action2 {
|
|
|
619
587
|
constructor() {
|
|
620
588
|
super({
|
|
621
589
|
id: TOGGLE_INLINE_COMMAND_ID,
|
|
622
|
-
title: ( localize2(
|
|
590
|
+
title: ( localize2(8297, "Toggle Inline Coverage")),
|
|
623
591
|
category: Categories.Test,
|
|
624
592
|
keybinding: {
|
|
625
|
-
weight:
|
|
626
|
-
primary: KeyChord(
|
|
593
|
+
weight: 200 ,
|
|
594
|
+
primary: KeyChord(2048 | 85 , 2048 | 1024 | 39 ),
|
|
627
595
|
},
|
|
628
596
|
toggled: {
|
|
629
597
|
condition: TestingContextKeys.inlineCoverageEnabled,
|
|
630
|
-
title: ( localize(
|
|
598
|
+
title: ( localize(8298, "Hide Inline Coverage")),
|
|
631
599
|
},
|
|
632
600
|
icon: testingCoverageReport,
|
|
633
601
|
menu: [
|
|
@@ -647,10 +615,10 @@ registerAction2(class ToggleInlineCoverage extends Action2 {
|
|
|
647
615
|
registerAction2(class ToggleCoverageToolbar extends Action2 {
|
|
648
616
|
constructor() {
|
|
649
617
|
super({
|
|
650
|
-
id:
|
|
651
|
-
title: ( localize2(
|
|
618
|
+
id: "testing.coverageToggleToolbar" ,
|
|
619
|
+
title: ( localize2(8299, "Test Coverage Toolbar")),
|
|
652
620
|
metadata: {
|
|
653
|
-
description: ( localize2(
|
|
621
|
+
description: ( localize2(8300, 'Toggle the sticky coverage bar in the editor.'))
|
|
654
622
|
},
|
|
655
623
|
category: Categories.Test,
|
|
656
624
|
toggled: {
|
|
@@ -665,15 +633,15 @@ registerAction2(class ToggleCoverageToolbar extends Action2 {
|
|
|
665
633
|
}
|
|
666
634
|
run(accessor) {
|
|
667
635
|
const config = accessor.get(IConfigurationService);
|
|
668
|
-
const value = getTestingConfiguration(config,
|
|
669
|
-
config.updateValue(
|
|
636
|
+
const value = getTestingConfiguration(config, "testing.coverageToolbarEnabled" );
|
|
637
|
+
config.updateValue("testing.coverageToolbarEnabled" , !value);
|
|
670
638
|
}
|
|
671
639
|
});
|
|
672
640
|
registerAction2(class FilterCoverageToTestInEditor extends Action2 {
|
|
673
641
|
constructor() {
|
|
674
642
|
super({
|
|
675
|
-
id:
|
|
676
|
-
title: ( localize2(
|
|
643
|
+
id: "testing.coverageFilterToTestInEditor" ,
|
|
644
|
+
title: ( localize2(8301, "Filter Coverage to Test")),
|
|
677
645
|
category: Categories.Test,
|
|
678
646
|
icon: Codicon.filter,
|
|
679
647
|
toggled: {
|
|
@@ -691,7 +659,7 @@ registerAction2(class FilterCoverageToTestInEditor extends Action2 {
|
|
|
691
659
|
run(accessor, coverageOrUri, editor) {
|
|
692
660
|
const testCoverageService = accessor.get(ITestCoverageService);
|
|
693
661
|
const quickInputService = accessor.get(IQuickInputService);
|
|
694
|
-
const activeEditor = editor
|
|
662
|
+
const activeEditor = isCodeEditor(editor) ? editor : accessor.get(ICodeEditorService).getActiveCodeEditor();
|
|
695
663
|
let coverage;
|
|
696
664
|
if (coverageOrUri instanceof FileCoverage) {
|
|
697
665
|
coverage = coverageOrUri;
|
|
@@ -729,7 +697,7 @@ registerAction2(class FilterCoverageToTestInEditor extends Action2 {
|
|
|
729
697
|
else {
|
|
730
698
|
const cts = revealScrollCts.value = ( (new CancellationTokenSource()));
|
|
731
699
|
coverage.detailsForTest(entry.testId, cts.token).then(details => {
|
|
732
|
-
const first = details.find(d => d.type ===
|
|
700
|
+
const first = details.find(d => d.type === 1 );
|
|
733
701
|
if (!cts.token.isCancellationRequested && first) {
|
|
734
702
|
activeEditor?.revealLineNearTop(first.location instanceof Position ? first.location.lineNumber : first.location.startLineNumber);
|
|
735
703
|
}
|
|
@@ -12,7 +12,6 @@ import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
|
12
12
|
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
13
13
|
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
14
14
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
15
|
-
import { TestingDisplayedCoveragePercent } from '../common/configuration.js';
|
|
16
15
|
import { getTotalCoveragePercent } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverage';
|
|
17
16
|
|
|
18
17
|
const percent = (cc) => clamp(cc.total === 0 ? 1 : cc.covered / cc.total, 0, 1);
|
|
@@ -43,9 +42,9 @@ const displayPercent = (value, precision = 2) => {
|
|
|
43
42
|
};
|
|
44
43
|
const calculateDisplayedStat = (coverage, method) => {
|
|
45
44
|
switch (method) {
|
|
46
|
-
case
|
|
45
|
+
case "statement" :
|
|
47
46
|
return percent(coverage.statement);
|
|
48
|
-
case
|
|
47
|
+
case "minimum" : {
|
|
49
48
|
let value = percent(coverage.statement);
|
|
50
49
|
if (coverage.branch) {
|
|
51
50
|
value = Math.min(value, percent(coverage.branch));
|
|
@@ -55,7 +54,7 @@ const calculateDisplayedStat = (coverage, method) => {
|
|
|
55
54
|
}
|
|
56
55
|
return value;
|
|
57
56
|
}
|
|
58
|
-
case
|
|
57
|
+
case "totalCoverage" :
|
|
59
58
|
return getTotalCoveragePercent(coverage.statement, coverage.branch, coverage.declaration);
|
|
60
59
|
default:
|
|
61
60
|
assertNever();
|
|
@@ -74,11 +73,11 @@ function getLabelForItem(result, testId, commonPrefixLen) {
|
|
|
74
73
|
}
|
|
75
74
|
var labels;
|
|
76
75
|
( ((function(labels) {
|
|
77
|
-
labels.showingFilterFor = (label) => ( localize(
|
|
78
|
-
labels.clickToChangeFiltering = ( localize(
|
|
79
|
-
labels.percentCoverage = (percent, precision) => ( localize(
|
|
80
|
-
labels.allTests = ( localize(
|
|
81
|
-
labels.pickShowCoverage = ( localize(
|
|
76
|
+
labels.showingFilterFor = (label) => ( localize(10898, "Showing \"{0}\"", label));
|
|
77
|
+
labels.clickToChangeFiltering = ( localize(10899, 'Click to view coverage for a single test'));
|
|
78
|
+
labels.percentCoverage = (percent, precision) => ( localize(10900, '{0} Coverage', displayPercent(percent, precision)));
|
|
79
|
+
labels.allTests = ( localize(10901, 'All tests'));
|
|
80
|
+
labels.pickShowCoverage = ( localize(10902, 'Pick a test to show coverage for'));
|
|
82
81
|
})(labels || (labels = {}))));
|
|
83
82
|
|
|
84
83
|
export { calculateDisplayedStat, displayPercent, getCoverageColor, getLabelForItem, labels, percent };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ObjectTreeElementCollapseState } from 'vscode/vscode/vs/base/browser/ui/tree/tree';
|
|
2
2
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
3
|
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
4
|
-
import { MarshalledId } from 'vscode/vscode/vs/base/common/marshallingIds';
|
|
5
4
|
import { isCollapsedInSerializedTestTree } from './testingViewState.js';
|
|
6
|
-
import {
|
|
5
|
+
import { InternalTestItem } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
|
|
7
6
|
|
|
8
7
|
let idCounter = 0;
|
|
9
8
|
const getId = () => String(idCounter++);
|
|
@@ -18,14 +17,14 @@ class TestItemTreeElement {
|
|
|
18
17
|
this.treeId = getId();
|
|
19
18
|
this.depth = this.parent ? this.parent.depth + 1 : 0;
|
|
20
19
|
this.retired = false;
|
|
21
|
-
this.state =
|
|
20
|
+
this.state = 0 ;
|
|
22
21
|
}
|
|
23
22
|
toJSON() {
|
|
24
23
|
if (this.depth === 0) {
|
|
25
24
|
return { controllerId: this.test.controllerId };
|
|
26
25
|
}
|
|
27
26
|
const context = {
|
|
28
|
-
$mid:
|
|
27
|
+
$mid: 16 ,
|
|
29
28
|
tests: [InternalTestItem.serialize(this.test)],
|
|
30
29
|
};
|
|
31
30
|
for (let p = this.parent; p && p.depth > 0; p = p.parent) {
|
|
@@ -49,7 +48,7 @@ const testIdentityProvider = {
|
|
|
49
48
|
getId(element) {
|
|
50
49
|
const expandComponent = element instanceof TestTreeErrorMessage
|
|
51
50
|
? 'error'
|
|
52
|
-
: element.test.expand ===
|
|
51
|
+
: element.test.expand === 0
|
|
53
52
|
? !!element.children.size
|
|
54
53
|
: element.test.expand;
|
|
55
54
|
return element.treeId + '\0' + expandComponent;
|
|
@@ -71,7 +70,7 @@ const getChildrenForParent = (serialized, rootsWithChildren, node) => {
|
|
|
71
70
|
? { element }
|
|
72
71
|
: {
|
|
73
72
|
element,
|
|
74
|
-
collapsible: element.test.expand !==
|
|
73
|
+
collapsible: element.test.expand !== 0 ,
|
|
75
74
|
collapsed: element.test.item.error
|
|
76
75
|
? ObjectTreeElementCollapseState.PreserveOrExpanded
|
|
77
76
|
: (isCollapsedInSerializedTestTree(serialized, element.test.item.extId) ?? element.depth > 0
|