@codingame/monaco-vscode-testing-service-override 3.2.3 → 4.1.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.
Files changed (33) hide show
  1. package/package.json +8 -8
  2. package/testing.js +5 -4
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/vscode/src/vs/workbench/contrib/testing/browser/codeCoverageDecorations.js +0 -567
  6. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/display.js +0 -3
  7. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/index.js +0 -83
  8. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/listProjection.js +0 -186
  9. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testItemContextOverlay.js +0 -18
  10. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testingObjectTree.js +0 -46
  11. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testingViewState.js +0 -17
  12. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.js +0 -225
  13. package/vscode/src/vs/workbench/contrib/testing/browser/icons.js +0 -174
  14. package/vscode/src/vs/workbench/contrib/testing/browser/media/testing.css.js +0 -6
  15. package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageBars.js +0 -227
  16. package/vscode/src/vs/workbench/contrib/testing/browser/testCoverageView.js +0 -545
  17. package/vscode/src/vs/workbench/contrib/testing/browser/testExplorerActions.js +0 -1662
  18. package/vscode/src/vs/workbench/contrib/testing/browser/testing.contribution.js +0 -219
  19. package/vscode/src/vs/workbench/contrib/testing/browser/testingDecorations.js +0 -970
  20. package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.js +0 -236
  21. package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerView.js +0 -1227
  22. package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.css.js +0 -6
  23. package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.js +0 -2091
  24. package/vscode/src/vs/workbench/contrib/testing/browser/testingProgressUiService.js +0 -142
  25. package/vscode/src/vs/workbench/contrib/testing/browser/testingViewPaneContainer.js +0 -47
  26. package/vscode/src/vs/workbench/contrib/testing/browser/theme.js +0 -259
  27. package/vscode/src/vs/workbench/contrib/testing/common/configuration.js +0 -273
  28. package/vscode/src/vs/workbench/contrib/testing/common/constants.js +0 -59
  29. package/vscode/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.js +0 -129
  30. package/vscode/src/vs/workbench/contrib/testing/common/testExclusions.js +0 -48
  31. package/vscode/src/vs/workbench/contrib/testing/common/testServiceImpl.js +0 -296
  32. package/vscode/src/vs/workbench/contrib/testing/common/testingContentProvider.js +0 -125
  33. package/vscode/src/vs/workbench/contrib/testing/common/testingUri.js +0 -67
@@ -1,174 +0,0 @@
1
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { registerIcon, spinningLoading } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
4
- import { registerThemingParticipant } from 'vscode/vscode/vs/platform/theme/common/themeService';
5
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
6
- import { testingColorRunAction, testStatesToIconColors } from './theme.js';
7
-
8
- const testingViewIcon = registerIcon('test-view-icon', Codicon.beaker, ( localizeWithPath(
9
- 'vs/workbench/contrib/testing/browser/icons',
10
- 'testViewIcon',
11
- 'View icon of the test view.'
12
- )));
13
- const testingResultsIcon = registerIcon('test-results-icon', Codicon.checklist, ( localizeWithPath(
14
- 'vs/workbench/contrib/testing/browser/icons',
15
- 'testingResultsIcon',
16
- 'Icons for test results.'
17
- )));
18
- const testingRunIcon = registerIcon('testing-run-icon', Codicon.run, ( localizeWithPath(
19
- 'vs/workbench/contrib/testing/browser/icons',
20
- 'testingRunIcon',
21
- 'Icon of the "run test" action.'
22
- )));
23
- const testingRerunIcon = registerIcon('testing-rerun-icon', Codicon.refresh, ( localizeWithPath(
24
- 'vs/workbench/contrib/testing/browser/icons',
25
- 'testingRerunIcon',
26
- 'Icon of the "rerun tests" action.'
27
- )));
28
- const testingRunAllIcon = registerIcon('testing-run-all-icon', Codicon.runAll, ( localizeWithPath(
29
- 'vs/workbench/contrib/testing/browser/icons',
30
- 'testingRunAllIcon',
31
- 'Icon of the "run all tests" action.'
32
- )));
33
- const testingDebugAllIcon = registerIcon('testing-debug-all-icon', Codicon.debugAltSmall, ( localizeWithPath(
34
- 'vs/workbench/contrib/testing/browser/icons',
35
- 'testingDebugAllIcon',
36
- 'Icon of the "debug all tests" action.'
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
- )))],
144
- [2 , spinningLoading],
145
- [5 , registerIcon('testing-skipped-icon', Codicon.debugStepOver, ( localizeWithPath(
146
- 'vs/workbench/contrib/testing/browser/icons',
147
- 'testingSkippedIcon',
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
- ]));
156
- registerThemingParticipant((theme, collector) => {
157
- for (const [state, icon] of testingStatesToIcons.entries()) {
158
- const color = testStatesToIconColors[state];
159
- if (!color) {
160
- continue;
161
- }
162
- collector.addRule(`.monaco-workbench ${ThemeIcon.asCSSSelector(icon)} {
163
- color: ${theme.getColor(color)} !important;
164
- }`);
165
- }
166
- collector.addRule(`
167
- .monaco-editor ${ThemeIcon.asCSSSelector(testingRunIcon)},
168
- .monaco-editor ${ThemeIcon.asCSSSelector(testingRunAllIcon)} {
169
- color: ${theme.getColor(testingColorRunAction)};
170
- }
171
- `);
172
- });
173
-
174
- export { testingCancelIcon, testingCancelRefreshTests, testingContinuousIsOn, testingCoverageAllIcon, testingCoverageIcon, testingCoverageMissingBranch, testingCoverageReport, testingDebugAllIcon, testingDebugIcon, testingFilterIcon, testingHiddenIcon, testingRefreshTests, testingRerunIcon, testingResultsIcon, testingRunAllIcon, testingRunIcon, testingStatesToIcons, testingTurnContinuousRunOff, testingTurnContinuousRunOn, testingUpdateProfiles, testingViewIcon, testingWasCovered };
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = ".monaco-workbench{.codicon-testing-error-icon{color:var(--vscode-testing-iconErrored)}.codicon-testing-failed-icon{color:var(--vscode-testing-iconFailed)}.codicon-testing-passed-icon{color:var(--vscode-testing-iconPassed)}.codicon-testing-queued-icon{color:var(--vscode-testing-iconQueued)}.codicon-testing-skipped-icon{color:var(--vscode-testing-iconSkipped)}.codicon-testing-unset-icon{color:var(--vscode-testing-iconUnset)}}.test-explorer{display:flex;flex-direction:column}.test-explorer>.test-explorer-tree{flex-grow:1;height:0;position:relative}.test-coverage-list-item .name,.test-coverage-list-item-label,.test-explorer .test-item .label,.test-output-peek-tree .test-peek-item .name{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:0}.test-explorer .test-item .label .codicon,.test-output-peek-tree .test-peek-item .name .codicon{font-size:1em;margin:0 .125em;transform:scale(1.25);vertical-align:middle}.test-explorer .test-item,.test-output-peek-tree .test-peek-item{align-items:center;display:flex}.test-output-peek-tree{border-left:1px solid var(--vscode-panelSection-border);color:var(--vscode-editor-foreground)}.test-explorer .monaco-list-row .codicon-testing-hidden,.test-explorer .monaco-list-row .monaco-action-bar,.test-output-peek-tree .monaco-list-row .monaco-action-bar{display:none;flex-shrink:0;margin-right:.8em}.test-explorer .monaco-list-row .monaco-action-bar .codicon-testing-continuous-is-on{background:var(--vscode-inputOption-activeBackground);border-color:var(--vscode-inputOption-activeBorder);border:1px solid var(--vscode-inputOption-activeBorder);border-radius:3px;color:var(--vscode-inputOption-activeForeground)}.test-explorer .monaco-list-row:not(.focused,:hover) .monaco-action-bar.testing-is-continuous-run .action-item{display:none}.test-explorer .monaco-list-row .monaco-action-bar.testing-is-continuous-run .action-item:last-child{display:block!important}.test-explorer .monaco-list-row .monaco-action-bar.testing-is-continuous-run,.test-explorer .monaco-list-row.focused .monaco-action-bar,.test-explorer .monaco-list-row:hover .monaco-action-bar,.test-output-peek-tree .monaco-list-row.focused .monaco-action-bar,.test-output-peek-tree .monaco-list-row:hover .monaco-action-bar{display:initial}.test-explorer .monaco-list-row .test-is-hidden .codicon-testing-hidden{display:block;margin-right:9px}.test-explorer .monaco-list-row.focused .codicon-testing-hidden,.test-explorer .monaco-list-row:hover .codicon-testing-hidden{display:none}.test-explorer .monaco-list-row .error{background:var(--vscode-inputValidation-errorBackground);border-radius:2px;font-size:12px;height:17px;line-height:17px;margin:3px 12px 3px 3px;outline:1px solid var(--vscode-inputValidation-errorBorder);overflow:hidden;padding:2px 4px}.test-explorer .monaco-list-row .error p{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.test-explorer .monaco-list-row .error a{color:var(--vscode-textLink-foreground)}.test-explorer .monaco-list-row .error a:hover{color:var(--vscode-textLink-activeForeground)}.test-explorer .computed-state,.test-output-peek-tree .computed-state{margin-right:.25em}.test-explorer .computed-state.retired,.testing-run-glyph.retired{opacity:.7!important}.test-explorer .test-is-hidden{opacity:.8}.test-explorer .result-summary-container{box-sizing:border-box;font-variant-numeric:tabular-nums;height:27px;padding:0 12px 8px}.test-explorer .result-summary{align-items:center;display:flex;gap:2px}.test-explorer .result-summary>span{flex-grow:1}.monaco-workbench .test-explorer .monaco-action-bar .action-item>.action-label{margin-right:2px;padding:1px 2px}.monaco-workbench .part>.title>.title-actions .action-label.codicon-testing-autorun:after{border-radius:100%;content:\"\";display:none;height:.4em;left:50%;margin:.1em 0 0 .05em;position:absolute;top:50%;width:.4em}.monaco-workbench .part>.title>.title-actions .action-label.codicon-testing-autorun.checked:after{display:block}.codicon-testing-loading-icon:before{animation:codicon-spin 1.25s steps(30) infinite}.testing-no-test-placeholder{display:none;left:0;padding:0 20px;position:absolute;right:0;top:0;z-index:1}.testing-no-test-placeholder.visible{display:block}.monaco-editor .zone-widget.test-output-peek .zone-widget-container.peekview-widget{border-bottom-width:2px;border-top-width:2px}.monaco-editor .zone-widget.test-output-peek .type-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .zone-widget.test-output-peek .monaco-editor .inputarea.ime-input,.monaco-editor .zone-widget.test-output-peek .monaco-editor .monaco-editor-background,.monaco-editor .zone-widget.test-output-peek .test-output-peek-message-container{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .zone-widget.test-output-peek .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.test-output-peek-message-container{overflow:hidden}.test-output-peek-message-container .floating-click-widget{bottom:10px;position:absolute;right:20px}.test-output-peek-message-container,.test-output-peek-tree{height:100%}.test-output-peek-message-container .preview-text{height:calc(100% - 16px);padding:8px 12px 8px 20px}.test-output-peek-message-container .preview-text p:first-child{margin-top:0}.test-output-peek-message-container .preview-text p:last-child{margin-bottom:0}.test-output-peek-message-container .preview-text a{cursor:pointer}.monaco-action-bar.testing-filter-action-bar{flex-shrink:0;height:auto;margin:4px 12px}.testing-filter-action-item{align-items:center;display:flex!important;flex-grow:1;max-width:400px}.testing-filter-action-item>.monaco-action-bar .testing-filter-button.checked{background-color:var(--vscode-inputOption-activeBackground);border-color:var(--vscode-inputOption-activeBorder);color:var(--vscode-inputOption-activeForeground)}.testing-filter-action-bar .testing-filter-action-item{max-width:none}.testing-filter-action-item .testing-filter-wrapper{flex-grow:1}.testing-filter-action-item .testing-filter-wrapper input{padding-right:30px!important}.testing-filter-action-item .monaco-action-bar{align-items:center;bottom:0;display:flex;position:absolute;right:3px;top:0}.monaco-editor .testing-run-glyph{cursor:pointer}.testing-diff-title-widget{display:inline-block;font-size:12px;line-height:19px;overflow:hidden;padding-right:6px;text-overflow:ellipsis;white-space:nowrap}.test-message-inline-content{font-family:var(--testMessageDecorationFontFamily);font-size:var(--testMessageDecorationFontSize)}.test-message-inline-content-clickable{cursor:pointer}.test-label-description{font-size:.9em;margin-left:.5em;opacity:.7;white-space:pre}.testing-diff-lens-widget{color:var(--vscode-editorCodeLens-foreground)}.test-message-inline-content-s0{color:var(--vscode-testing-message-error-decorationForeground)!important}.test-message-inline-content-s1{color:var(--vscode-testing-message-info-decorationForeground)!important}.monaco-editor .testing-inline-message-severity-0{color:var(--vscode-testing-message-error-decorationForeground)!important}.monaco-editor .testing-inline-message-severity-1{color:var(--vscode-testing-message-info-decorationForeground)!important}.test-coverage-bars,.test-coverage-list-item{align-items:center;display:flex}.test-coverage-bars{font-size:11px;gap:4px;margin-right:.8em}.test-coverage-bars .bar{border:1px solid;border-radius:2px;height:8px;overflow:hidden;position:relative}.test-coverage-bars .bar:before{background:currentColor;content:\"\";height:100%;opacity:.7;position:absolute;width:var(--test-bar-width)}.test-coverage-list-item .icon{margin-right:.2em}.test-coverage-list-item.not-covered .name{opacity:.7}.explorer-item-with-test-coverage{display:flex}.explorer-item-with-test-coverage .explorer-item{flex-grow:1}.explorer-item-with-test-coverage .monaco-icon-label:after{margin-right:12px}.coverage-deco-gutter{z-index:0}.coverage-deco-gutter:before{content:\"\";inset:0;position:absolute;z-index:-1}.coverage-deco-gutter.coverage-deco-hit:before{background:var(--vscode-testing-coveredGutterBackground);border-color:var(--vscode-testing-coveredGutterBackground)}.coverage-deco-gutter.coverage-deco-miss:before{background:var(--vscode-testing-uncoveredGutterBackground);border-color:var(--vscode-testing-uncoveredGutterBackground)}.hc-black .coverage-deco-gutter:before,.hc-light .coverage-deco-gutter:before{background:none;border-style:solid;border-width:3px 0 3px 5px}.coverage-deco-gutter.coverage-deco-miss.coverage-deco-hit:before{background-color:transparent;background-image:linear-gradient(45deg,var(--vscode-testing-coveredGutterBackground) 25%,var(--vscode-testing-uncoveredGutterBackground) 25%,var(--vscode-testing-uncoveredGutterBackground) 50%,var(--vscode-testing-coveredGutterBackground) 50%,75%,var(--vscode-testing-uncoveredGutterBackground) 75%,var(--vscode-testing-uncoveredGutterBackground) 100%);background-size:6px 6px}.coverage-deco-inline{outline-offset:-1px}.coverage-deco-inline.coverage-deco-hit{background:var(--vscode-testing-coveredBackground);outline:1px solid var(--vscode-testing-coveredBorder)}.coverage-deco-inline.coverage-deco-miss{background:var(--vscode-testing-uncoveredBackground);outline:1px solid var(--vscode-testing-uncoveredBorder)}.hc-black .coverage-deco-inline.coverage-deco-hit,.hc-light .coverage-deco-inline.coverage-deco-hit{outline-style:dashed}.coverage-deco-branch-miss-indicator{display:inline-block;font:inherit!important;height:100%;position:relative;width:4ch}.coverage-deco-branch-miss-indicator:before{border:1px solid;border-radius:2px;font:normal normal normal calc(var(--vscode-testing-coverage-lineHeight)/2)/1 codicon;left:50%;padding:calc(var(--vscode-testing-coverage-lineHeight)/10);position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%)}.coverage-deco-inline-count{background:var(--vscode-testing-coverCountBadgeBackground);border-bottom-left-radius:2px;border-top-left-radius:2px;color:var(--vscode-testing-coverCountBadgeForeground);font-size:.7em;margin:0 .7em 0 .4em;padding:.2em 0 .2em .2em;position:relative}.coverage-deco-inline-count:after{background-image:linear-gradient(to bottom left,transparent 50%,var(--vscode-testing-coverCountBadgeBackground) 0),linear-gradient(to bottom right,var(--vscode-testing-coverCountBadgeBackground) 50%,transparent 0);background-position:top,bottom;background-repeat:no-repeat;background-size:100% 50%;bottom:0;content:\"\";display:block;left:100%;position:absolute;top:0;width:.5em}";
4
- n(css,{});
5
-
6
- export { css, css as default };
@@ -1,227 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { h } from 'vscode/vscode/vs/base/browser/dom';
3
- import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegate';
4
- import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabelHover';
5
- import { assertNever } from 'vscode/vscode/vs/base/common/assert';
6
- import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
7
- import { Lazy } from 'vscode/vscode/vs/base/common/lazy';
8
- import { Disposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
- import { clamp } from 'vscode/vscode/vs/base/common/numbers';
10
- import { isDefined } from 'vscode/vscode/vs/base/common/types';
11
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
12
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
13
- import { asCssVariableName, chartsRed, chartsYellow, chartsGreen } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
14
- import { getTestingConfiguration, observeTestingConfiguration } from '../common/configuration.js';
15
- import { getTotalCoveragePercent } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverage';
16
- import { ITestCoverageService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverageService';
17
- import { observableValue } from 'vscode/vscode/vs/base/common/observableInternal/base';
18
- import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
19
-
20
- let ManagedTestCoverageBars = class ManagedTestCoverageBars extends Disposable {
21
- get visible() {
22
- return !!this._coverage;
23
- }
24
- constructor(options, configurationService) {
25
- super();
26
- this.options = options;
27
- this.configurationService = configurationService;
28
- this.el = ( new Lazy(() => {
29
- if (this.options.compact) {
30
- const el = h('.test-coverage-bars.compact', [
31
- h('.tpc@overall'),
32
- h('.bar@tpcBar'),
33
- ]);
34
- this.attachHover(el.tpcBar, getOverallHoverText);
35
- return el;
36
- }
37
- else {
38
- const el = h('.test-coverage-bars', [
39
- h('.tpc@overall'),
40
- h('.bar@statement'),
41
- h('.bar@function'),
42
- h('.bar@branch'),
43
- ]);
44
- this.attachHover(el.statement, stmtCoverageText);
45
- this.attachHover(el.function, fnCoverageText);
46
- this.attachHover(el.branch, branchCoverageText);
47
- return el;
48
- }
49
- }));
50
- this.visibleStore = this._register(( new DisposableStore()));
51
- this.customHovers = [];
52
- }
53
- attachHover(target, factory) {
54
- this._register(setupCustomHover(getDefaultHoverDelegate('element'), target, () => this._coverage && factory(this._coverage)));
55
- }
56
- setCoverageInfo(coverage) {
57
- const ds = this.visibleStore;
58
- if (!coverage) {
59
- if (this._coverage) {
60
- this._coverage = undefined;
61
- this.customHovers.forEach(c => c.hide());
62
- ds.clear();
63
- }
64
- return;
65
- }
66
- if (!this._coverage) {
67
- const root = this.el.value.root;
68
- ds.add(toDisposable(() => this.options.container.removeChild(root)));
69
- this.options.container.appendChild(root);
70
- ds.add(this.configurationService.onDidChangeConfiguration(c => {
71
- if (!this._coverage) {
72
- return;
73
- }
74
- if (c.affectsConfiguration("testing.displayedCoveragePercent" ) || c.affectsConfiguration("testing.coverageBarThresholds" )) {
75
- this.doRender(this._coverage);
76
- }
77
- }));
78
- }
79
- this._coverage = coverage;
80
- this.doRender(coverage);
81
- }
82
- doRender(coverage) {
83
- const el = this.el.value;
84
- const precision = this.options.compact ? 0 : 2;
85
- const thresholds = getTestingConfiguration(this.configurationService, "testing.coverageBarThresholds" );
86
- const overallStat = calculateDisplayedStat(coverage, getTestingConfiguration(this.configurationService, "testing.displayedCoveragePercent" ));
87
- el.overall.textContent = displayPercent(overallStat, precision);
88
- if ('tpcBar' in el) {
89
- renderBar(el.tpcBar, overallStat, false, thresholds);
90
- }
91
- else {
92
- renderBar(el.statement, percent(coverage.statement), coverage.statement.total === 0, thresholds);
93
- renderBar(el.function, coverage.declaration && percent(coverage.declaration), coverage.declaration?.total === 0, thresholds);
94
- renderBar(el.branch, coverage.branch && percent(coverage.branch), coverage.branch?.total === 0, thresholds);
95
- }
96
- }
97
- };
98
- ManagedTestCoverageBars = ( __decorate([
99
- ( __param(1, IConfigurationService))
100
- ], ManagedTestCoverageBars));
101
- const percent = (cc) => clamp(cc.total === 0 ? 1 : cc.covered / cc.total, 0, 1);
102
- const epsilon = 10e-8;
103
- const barWidth = 16;
104
- const renderBar = (bar, pct, isZero, thresholds) => {
105
- if (pct === undefined) {
106
- bar.style.display = 'none';
107
- return;
108
- }
109
- bar.style.display = 'block';
110
- bar.style.width = `${barWidth}px`;
111
- bar.style.setProperty('--test-bar-width', `${Math.floor(pct * 16)}px`);
112
- if (isZero) {
113
- bar.style.color = 'currentColor';
114
- bar.style.opacity = '0.5';
115
- return;
116
- }
117
- let best = colorThresholds[0].color;
118
- let distance = pct;
119
- for (const { key, color } of colorThresholds) {
120
- const t = thresholds[key] / 100;
121
- if (t && pct >= t && pct - t < distance) {
122
- best = color;
123
- distance = pct - t;
124
- }
125
- }
126
- bar.style.color = best;
127
- bar.style.opacity = '1';
128
- };
129
- const colorThresholds = [
130
- { color: `var(${asCssVariableName(chartsRed)})`, key: 'red' },
131
- { color: `var(${asCssVariableName(chartsYellow)})`, key: 'yellow' },
132
- { color: `var(${asCssVariableName(chartsGreen)})`, key: 'green' },
133
- ];
134
- const calculateDisplayedStat = (coverage, method) => {
135
- switch (method) {
136
- case "statement" :
137
- return percent(coverage.statement);
138
- case "minimum" : {
139
- let value = percent(coverage.statement);
140
- if (coverage.branch) {
141
- value = Math.min(value, percent(coverage.branch));
142
- }
143
- if (coverage.declaration) {
144
- value = Math.min(value, percent(coverage.declaration));
145
- }
146
- return value;
147
- }
148
- case "totalCoverage" :
149
- return getTotalCoveragePercent(coverage.statement, coverage.branch, coverage.declaration);
150
- default:
151
- assertNever();
152
- }
153
- };
154
- const displayPercent = (value, precision = 2) => {
155
- const display = (value * 100).toFixed(precision);
156
- if (value < 1 - epsilon && display === '100') {
157
- return `${100 - (10 ** -precision)}%`;
158
- }
159
- return `${display}%`;
160
- };
161
- const nf = new Intl.NumberFormat();
162
- const stmtCoverageText = (coverage) => ( localizeWithPath(
163
- 'vs/workbench/contrib/testing/browser/testCoverageBars',
164
- 'statementCoverage',
165
- '{0}/{1} statements covered ({2})',
166
- nf.format(coverage.statement.covered),
167
- nf.format(coverage.statement.total),
168
- displayPercent(percent(coverage.statement))
169
- ));
170
- const fnCoverageText = (coverage) => coverage.declaration && ( localizeWithPath(
171
- 'vs/workbench/contrib/testing/browser/testCoverageBars',
172
- 'functionCoverage',
173
- '{0}/{1} functions covered ({2})',
174
- nf.format(coverage.declaration.covered),
175
- nf.format(coverage.declaration.total),
176
- displayPercent(percent(coverage.declaration))
177
- ));
178
- const branchCoverageText = (coverage) => coverage.branch && ( localizeWithPath(
179
- 'vs/workbench/contrib/testing/browser/testCoverageBars',
180
- 'branchCoverage',
181
- '{0}/{1} branches covered ({2})',
182
- nf.format(coverage.branch.covered),
183
- nf.format(coverage.branch.total),
184
- displayPercent(percent(coverage.branch))
185
- ));
186
- const getOverallHoverText = (coverage) => {
187
- const str = [
188
- stmtCoverageText(coverage),
189
- fnCoverageText(coverage),
190
- branchCoverageText(coverage),
191
- ].filter(isDefined).join('\n\n');
192
- return {
193
- markdown: ( new MarkdownString()).appendText(str),
194
- markdownNotSupportedFallback: str
195
- };
196
- };
197
- let ExplorerTestCoverageBars = class ExplorerTestCoverageBars extends ManagedTestCoverageBars {
198
- constructor(options, configurationService, testCoverageService) {
199
- super(options, configurationService);
200
- this.resource = observableValue(this, undefined);
201
- const isEnabled = observeTestingConfiguration(configurationService, "testing.showCoverageInExplorer" );
202
- this._register(autorun(async (reader) => {
203
- let info;
204
- const coverage = testCoverageService.selected.read(reader);
205
- if (coverage && isEnabled.read(reader)) {
206
- const resource = this.resource.read(reader);
207
- if (resource) {
208
- info = coverage.getComputedForUri(resource);
209
- }
210
- }
211
- this.setCoverageInfo(info);
212
- }));
213
- }
214
- setResource(resource, transaction) {
215
- this.resource.set(resource, transaction);
216
- }
217
- setCoverageInfo(coverage) {
218
- super.setCoverageInfo(coverage);
219
- this.options.container?.classList.toggle('explorer-item-with-test-coverage', this.visible);
220
- }
221
- };
222
- ExplorerTestCoverageBars = ( __decorate([
223
- ( __param(1, IConfigurationService)),
224
- ( __param(2, ITestCoverageService))
225
- ], ExplorerTestCoverageBars));
226
-
227
- export { ExplorerTestCoverageBars, ManagedTestCoverageBars };