@codingame/monaco-vscode-testing-service-override 1.83.16

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/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
  2. package/external/tslib/tslib.es6.js +11 -0
  3. package/index.d.ts +1 -0
  4. package/index.js +1 -0
  5. package/package.json +30 -0
  6. package/testing.d.ts +5 -0
  7. package/testing.js +28 -0
  8. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/display.js +3 -0
  9. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/index.js +76 -0
  10. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/listProjection.js +186 -0
  11. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testItemContextOverlay.js +18 -0
  12. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testingObjectTree.js +46 -0
  13. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testingViewState.js +17 -0
  14. package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.js +220 -0
  15. package/vscode/src/vs/workbench/contrib/testing/browser/icons.js +149 -0
  16. package/vscode/src/vs/workbench/contrib/testing/browser/media/testing.css.js +6 -0
  17. package/vscode/src/vs/workbench/contrib/testing/browser/testExplorerActions.js +1427 -0
  18. package/vscode/src/vs/workbench/contrib/testing/browser/testing.contribution.js +178 -0
  19. package/vscode/src/vs/workbench/contrib/testing/browser/testingDecorations.js +879 -0
  20. package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.js +237 -0
  21. package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerView.js +1225 -0
  22. package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.css.js +6 -0
  23. package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.js +1991 -0
  24. package/vscode/src/vs/workbench/contrib/testing/browser/testingProgressUiService.js +142 -0
  25. package/vscode/src/vs/workbench/contrib/testing/browser/testingViewPaneContainer.js +47 -0
  26. package/vscode/src/vs/workbench/contrib/testing/browser/theme.js +130 -0
  27. package/vscode/src/vs/workbench/contrib/testing/common/configuration.js +213 -0
  28. package/vscode/src/vs/workbench/contrib/testing/common/constants.js +59 -0
  29. package/vscode/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.js +129 -0
  30. package/vscode/src/vs/workbench/contrib/testing/common/testExclusions.js +48 -0
  31. package/vscode/src/vs/workbench/contrib/testing/common/testServiceImpl.js +293 -0
  32. package/vscode/src/vs/workbench/contrib/testing/common/testingContentProvider.js +125 -0
  33. package/vscode/src/vs/workbench/contrib/testing/common/testingUri.js +67 -0
@@ -0,0 +1,237 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
3
+ import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
4
+ import { BaseActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
5
+ import { DropdownMenuActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js';
6
+ import { Action, Separator } from 'monaco-editor/esm/vs/base/common/actions.js';
7
+ import { Delayer } from 'monaco-editor/esm/vs/base/common/async.js';
8
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
9
+ import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
10
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
11
+ import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
12
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
13
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
14
+ import { ContextScopedSuggestEnabledInputWithHistory } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
15
+ import { testingFilterIcon } from './icons.js';
16
+ import { StoredValue } from 'vscode/vscode/vs/workbench/contrib/testing/common/storedValue';
17
+ import { ITestExplorerFilterState } from 'vscode/vscode/vs/workbench/contrib/testing/common/testExplorerFilterState';
18
+ import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService';
19
+ import { denamespaceTestTag } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
20
+
21
+ const testFilterDescriptions = {
22
+ ["@failed" ]: ( localizeWithPath(
23
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
24
+ 'testing.filters.showOnlyFailed',
25
+ "Show Only Failed Tests"
26
+ )),
27
+ ["@executed" ]: ( localizeWithPath(
28
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
29
+ 'testing.filters.showOnlyExecuted',
30
+ "Show Only Executed Tests"
31
+ )),
32
+ ["@doc" ]: ( localizeWithPath(
33
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
34
+ 'testing.filters.currentFile',
35
+ "Show in Active File Only"
36
+ )),
37
+ ["@hidden" ]: ( localizeWithPath(
38
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
39
+ 'testing.filters.showExcludedTests',
40
+ "Show Hidden Tests"
41
+ )),
42
+ };
43
+ let TestingExplorerFilter = class TestingExplorerFilter extends BaseActionViewItem {
44
+ constructor(action, state, instantiationService, testService) {
45
+ super(null, action);
46
+ this.state = state;
47
+ this.instantiationService = instantiationService;
48
+ this.testService = testService;
49
+ this.focusEmitter = this._register(( new Emitter()));
50
+ this.onDidFocus = this.focusEmitter.event;
51
+ this.history = this._register(this.instantiationService.createInstance(StoredValue, {
52
+ key: 'testing.filterHistory2',
53
+ scope: 1 ,
54
+ target: 1
55
+ }));
56
+ this.filtersAction = ( new Action('markersFiltersAction', ( localizeWithPath(
57
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
58
+ 'testing.filters.menu',
59
+ "More Filters..."
60
+ )), 'testing-filter-button ' + ThemeIcon.asClassName(testingFilterIcon)));
61
+ this.updateFilterActiveState();
62
+ this._register(testService.excluded.onTestExclusionsChanged(this.updateFilterActiveState, this));
63
+ }
64
+ render(container) {
65
+ container.classList.add('testing-filter-action-item');
66
+ const updateDelayer = this._register(( new Delayer(400)));
67
+ const wrapper = this.wrapper = dom.$('.testing-filter-wrapper');
68
+ container.appendChild(wrapper);
69
+ let history = this.history.get({ lastValue: '', values: [] });
70
+ if (history instanceof Array) {
71
+ history = { lastValue: '', values: history };
72
+ }
73
+ if (history.lastValue) {
74
+ this.state.setText(history.lastValue);
75
+ }
76
+ const input = this.input = this._register(this.instantiationService.createInstance(ContextScopedSuggestEnabledInputWithHistory, {
77
+ id: 'testing.explorer.filter',
78
+ ariaLabel: ( localizeWithPath(
79
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
80
+ 'testExplorerFilterLabel',
81
+ "Filter text for tests in the explorer"
82
+ )),
83
+ parent: wrapper,
84
+ suggestionProvider: {
85
+ triggerCharacters: ['@'],
86
+ provideResults: () => [
87
+ ...( Object.entries(testFilterDescriptions).map(([label, detail]) => ({ label, detail }))),
88
+ ...( Iterable.map(( this.testService.collection.tags.values()), tag => {
89
+ const { ctrlId, tagId } = denamespaceTestTag(tag.id);
90
+ const insertText = `@${ctrlId}:${tagId}`;
91
+ return ({
92
+ label: `@${ctrlId}:${tagId}`,
93
+ detail: this.testService.collection.getNodeById(ctrlId)?.item.label,
94
+ insertText: tagId.includes(' ') ? `@${ctrlId}:"${tagId.replace(/(["\\])/g, '\\$1')}"` : insertText
95
+ });
96
+ })),
97
+ ].filter(r => !this.state.text.value.includes(r.label)),
98
+ },
99
+ resourceHandle: 'testing:filter',
100
+ suggestOptions: {
101
+ value: this.state.text.value,
102
+ placeholderText: ( localizeWithPath(
103
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
104
+ 'testExplorerFilter',
105
+ "Filter (e.g. text, !exclude, @tag)"
106
+ )),
107
+ },
108
+ history: history.values
109
+ }));
110
+ this._register(this.state.text.onDidChange(newValue => {
111
+ if (input.getValue() !== newValue) {
112
+ input.setValue(newValue);
113
+ }
114
+ }));
115
+ this._register(this.state.onDidRequestInputFocus(() => {
116
+ input.focus();
117
+ }));
118
+ this._register(input.onDidFocus(() => {
119
+ this.focusEmitter.fire();
120
+ }));
121
+ this._register(input.onInputDidChange(() => updateDelayer.trigger(() => {
122
+ input.addToHistory();
123
+ this.state.setText(input.getValue());
124
+ })));
125
+ const actionbar = this._register(( new ActionBar(container, {
126
+ actionViewItemProvider: action => {
127
+ if (action.id === this.filtersAction.id) {
128
+ return this.instantiationService.createInstance(FiltersDropdownMenuActionViewItem, action, this.state, this.actionRunner);
129
+ }
130
+ return undefined;
131
+ },
132
+ })));
133
+ actionbar.push(this.filtersAction, { icon: true, label: false });
134
+ this.layout(this.wrapper.clientWidth);
135
+ }
136
+ layout(width) {
137
+ this.input.layout(new dom.Dimension(width - 24 - 8 - 22, 20));
138
+ }
139
+ focus() {
140
+ this.input.focus();
141
+ }
142
+ saveState() {
143
+ this.history.store({ lastValue: this.input.getValue(), values: this.input.getHistory() });
144
+ }
145
+ dispose() {
146
+ this.saveState();
147
+ super.dispose();
148
+ }
149
+ updateFilterActiveState() {
150
+ this.filtersAction.checked = this.testService.excluded.hasAny;
151
+ }
152
+ };
153
+ TestingExplorerFilter = ( __decorate([
154
+ ( __param(1, ITestExplorerFilterState)),
155
+ ( __param(2, IInstantiationService)),
156
+ ( __param(3, ITestService))
157
+ ], TestingExplorerFilter));
158
+ let FiltersDropdownMenuActionViewItem = class FiltersDropdownMenuActionViewItem extends DropdownMenuActionViewItem {
159
+ constructor(action, filters, actionRunner, contextMenuService, testService) {
160
+ super(action, { getActions: () => this.getActions() }, contextMenuService, {
161
+ actionRunner,
162
+ classNames: action.class,
163
+ anchorAlignmentProvider: () => 1 ,
164
+ menuAsChild: true
165
+ });
166
+ this.filters = filters;
167
+ this.testService = testService;
168
+ }
169
+ render(container) {
170
+ super.render(container);
171
+ this.updateChecked();
172
+ }
173
+ getActions() {
174
+ return [
175
+ ...( ["@failed" , "@executed" , "@doc" ].map(term => ({
176
+ checked: this.filters.isFilteringFor(term),
177
+ class: undefined,
178
+ enabled: true,
179
+ id: term,
180
+ label: testFilterDescriptions[term],
181
+ run: () => this.filters.toggleFilteringFor(term),
182
+ tooltip: '',
183
+ dispose: () => null
184
+ }))),
185
+ ( new Separator()),
186
+ {
187
+ checked: this.filters.fuzzy.value,
188
+ class: undefined,
189
+ enabled: true,
190
+ id: 'fuzzy',
191
+ label: ( localizeWithPath(
192
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
193
+ 'testing.filters.fuzzyMatch',
194
+ "Fuzzy Match"
195
+ )),
196
+ run: () => this.filters.fuzzy.value = !this.filters.fuzzy.value,
197
+ tooltip: ''
198
+ },
199
+ ( new Separator()),
200
+ {
201
+ checked: this.filters.isFilteringFor("@hidden" ),
202
+ class: undefined,
203
+ enabled: this.testService.excluded.hasAny,
204
+ id: 'showExcluded',
205
+ label: ( localizeWithPath(
206
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
207
+ 'testing.filters.showExcludedTests',
208
+ "Show Hidden Tests"
209
+ )),
210
+ run: () => this.filters.toggleFilteringFor("@hidden" ),
211
+ tooltip: ''
212
+ },
213
+ {
214
+ checked: false,
215
+ class: undefined,
216
+ enabled: this.testService.excluded.hasAny,
217
+ id: 'removeExcluded',
218
+ label: ( localizeWithPath(
219
+ 'vs/workbench/contrib/testing/browser/testingExplorerFilter',
220
+ 'testing.filters.removeTestExclusions',
221
+ "Unhide All Tests"
222
+ )),
223
+ run: async () => this.testService.excluded.clear(),
224
+ tooltip: ''
225
+ }
226
+ ];
227
+ }
228
+ updateChecked() {
229
+ this.element.classList.toggle('checked', this._action.checked);
230
+ }
231
+ };
232
+ FiltersDropdownMenuActionViewItem = ( __decorate([
233
+ ( __param(3, IContextMenuService)),
234
+ ( __param(4, ITestService))
235
+ ], FiltersDropdownMenuActionViewItem));
236
+
237
+ export { TestingExplorerFilter };