@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.
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +30 -0
- package/testing.d.ts +5 -0
- package/testing.js +28 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/display.js +3 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/index.js +76 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/listProjection.js +186 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testItemContextOverlay.js +18 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testingObjectTree.js +46 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/testingViewState.js +17 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.js +220 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/icons.js +149 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/media/testing.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testExplorerActions.js +1427 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testing.contribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingDecorations.js +879 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.js +237 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingExplorerView.js +1225 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingOutputPeek.js +1991 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingProgressUiService.js +142 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/testingViewPaneContainer.js +47 -0
- package/vscode/src/vs/workbench/contrib/testing/browser/theme.js +130 -0
- package/vscode/src/vs/workbench/contrib/testing/common/configuration.js +213 -0
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +59 -0
- package/vscode/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.js +129 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testExclusions.js +48 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testServiceImpl.js +293 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingContentProvider.js +125 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingUri.js +67 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { registerEditorContribution } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { registerAction2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
4
|
+
import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
5
|
+
import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
6
|
+
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
7
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
8
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
9
|
+
import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
10
|
+
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
11
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
12
|
+
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
13
|
+
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
14
|
+
import { Extensions, IViewsService } from 'vscode/vscode/vs/workbench/common/views';
|
|
15
|
+
import { REVEAL_IN_EXPLORER_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
16
|
+
import { testingViewIcon, testingResultsIcon } from './icons.js';
|
|
17
|
+
import { TestingDecorations } from './testingDecorations.js';
|
|
18
|
+
import { TestingExplorerView } from './testingExplorerView.js';
|
|
19
|
+
import { TestResultsView, OpenMessageInEditorAction, GoToPreviousMessageAction, GoToNextMessageAction, CloseTestPeek, ToggleTestingPeekHistory, TestingPeekOpener, TestingOutputPeekController } from './testingOutputPeek.js';
|
|
20
|
+
import { TestingProgressTrigger } from './testingProgressUiService.js';
|
|
21
|
+
import { TestingViewPaneContainer } from './testingViewPaneContainer.js';
|
|
22
|
+
import { testingConfiguration } from '../common/configuration.js';
|
|
23
|
+
import { ITestExplorerFilterState } from 'vscode/vscode/vs/workbench/contrib/testing/common/testExplorerFilterState';
|
|
24
|
+
import { TestId } from 'vscode/vscode/vs/workbench/contrib/testing/common/testId';
|
|
25
|
+
import { ITestResultService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResultService';
|
|
26
|
+
import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService';
|
|
27
|
+
import { TestingContentProvider } from '../common/testingContentProvider.js';
|
|
28
|
+
import { TestingContextKeys } from 'vscode/vscode/vs/workbench/contrib/testing/common/testingContextKeys';
|
|
29
|
+
import { ITestingDecorationsService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testingDecorations';
|
|
30
|
+
import { ITestingPeekOpener } from 'vscode/vscode/vs/workbench/contrib/testing/common/testingPeekOpener';
|
|
31
|
+
import { allTestActions, discoverAndRunTests } from './testExplorerActions.js';
|
|
32
|
+
|
|
33
|
+
const viewContainer = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
|
|
34
|
+
id: "workbench.view.extension.test" ,
|
|
35
|
+
title: { value: ( localizeWithPath(
|
|
36
|
+
'vs/workbench/contrib/testing/browser/testing.contribution',
|
|
37
|
+
'test',
|
|
38
|
+
"Testing"
|
|
39
|
+
)), original: 'Testing' },
|
|
40
|
+
ctorDescriptor: ( new SyncDescriptor(TestingViewPaneContainer)),
|
|
41
|
+
icon: testingViewIcon,
|
|
42
|
+
alwaysUseContainerInfo: true,
|
|
43
|
+
order: 6,
|
|
44
|
+
openCommandActionDescriptor: {
|
|
45
|
+
id: "workbench.view.extension.test" ,
|
|
46
|
+
mnemonicTitle: ( localizeWithPath(
|
|
47
|
+
'vs/workbench/contrib/testing/browser/testing.contribution',
|
|
48
|
+
{ key: 'miViewTesting', comment: ['&& denotes a mnemonic'] },
|
|
49
|
+
"T&&esting"
|
|
50
|
+
)),
|
|
51
|
+
order: 4,
|
|
52
|
+
},
|
|
53
|
+
hideIfEmpty: true,
|
|
54
|
+
}, 0 );
|
|
55
|
+
const testResultsViewContainer = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
|
|
56
|
+
id: "workbench.panel.testResults" ,
|
|
57
|
+
title: { value: ( localizeWithPath(
|
|
58
|
+
'vs/workbench/contrib/testing/browser/testing.contribution',
|
|
59
|
+
'testResultsPanelName',
|
|
60
|
+
"Test Results"
|
|
61
|
+
)), original: 'Test Results' },
|
|
62
|
+
icon: testingResultsIcon,
|
|
63
|
+
ctorDescriptor: ( new SyncDescriptor(
|
|
64
|
+
ViewPaneContainer,
|
|
65
|
+
["workbench.panel.testResults" , { mergeViewWithContainerWhenSingleView: true }]
|
|
66
|
+
)),
|
|
67
|
+
hideIfEmpty: true,
|
|
68
|
+
order: 3,
|
|
69
|
+
}, 1 , { doNotRegisterOpenCommand: true });
|
|
70
|
+
const viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
|
|
71
|
+
viewsRegistry.registerViews([{
|
|
72
|
+
id: "workbench.panel.testResults.view" ,
|
|
73
|
+
name: ( localizeWithPath(
|
|
74
|
+
'vs/workbench/contrib/testing/browser/testing.contribution',
|
|
75
|
+
'testResultsPanelName',
|
|
76
|
+
"Test Results"
|
|
77
|
+
)),
|
|
78
|
+
containerIcon: testingResultsIcon,
|
|
79
|
+
canToggleVisibility: false,
|
|
80
|
+
canMoveView: true,
|
|
81
|
+
when: ( TestingContextKeys.hasAnyResults.isEqualTo(true)),
|
|
82
|
+
ctorDescriptor: ( new SyncDescriptor(TestResultsView)),
|
|
83
|
+
}], testResultsViewContainer);
|
|
84
|
+
viewsRegistry.registerViews([{
|
|
85
|
+
id: "workbench.view.testing" ,
|
|
86
|
+
name: ( localizeWithPath(
|
|
87
|
+
'vs/workbench/contrib/testing/browser/testing.contribution',
|
|
88
|
+
'testExplorer',
|
|
89
|
+
"Test Explorer"
|
|
90
|
+
)),
|
|
91
|
+
ctorDescriptor: ( new SyncDescriptor(TestingExplorerView)),
|
|
92
|
+
canToggleVisibility: true,
|
|
93
|
+
canMoveView: true,
|
|
94
|
+
weight: 80,
|
|
95
|
+
order: -999,
|
|
96
|
+
containerIcon: testingViewIcon,
|
|
97
|
+
when: ContextKeyExpr.greater(TestingContextKeys.providerCount.key, 0),
|
|
98
|
+
}], viewContainer);
|
|
99
|
+
allTestActions.forEach(registerAction2);
|
|
100
|
+
registerAction2(OpenMessageInEditorAction);
|
|
101
|
+
registerAction2(GoToPreviousMessageAction);
|
|
102
|
+
registerAction2(GoToNextMessageAction);
|
|
103
|
+
registerAction2(CloseTestPeek);
|
|
104
|
+
registerAction2(ToggleTestingPeekHistory);
|
|
105
|
+
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(TestingContentProvider, 3 );
|
|
106
|
+
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(TestingPeekOpener, 4 );
|
|
107
|
+
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(TestingProgressTrigger, 4 );
|
|
108
|
+
registerEditorContribution("editor.contrib.testingOutputPeek" , TestingOutputPeekController, 1 );
|
|
109
|
+
registerEditorContribution("editor.contrib.testingDecorations" , TestingDecorations, 1 );
|
|
110
|
+
CommandsRegistry.registerCommand({
|
|
111
|
+
id: '_revealTestInExplorer',
|
|
112
|
+
handler: async (accessor, testId, focus) => {
|
|
113
|
+
accessor.get(ITestExplorerFilterState).reveal.value = typeof testId === 'string' ? testId : testId.extId;
|
|
114
|
+
accessor.get(IViewsService).openView("workbench.view.testing" , focus);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
CommandsRegistry.registerCommand({
|
|
118
|
+
id: 'vscode.peekTestError',
|
|
119
|
+
handler: async (accessor, extId) => {
|
|
120
|
+
const lookup = accessor.get(ITestResultService).getStateById(extId);
|
|
121
|
+
if (!lookup) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const [result, ownState] = lookup;
|
|
125
|
+
const opener = accessor.get(ITestingPeekOpener);
|
|
126
|
+
if (opener.tryPeekFirstError(result, ownState)) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
for (const test of result.tests) {
|
|
130
|
+
if (TestId.compare(ownState.item.extId, test.item.extId) === 2 && opener.tryPeekFirstError(result, test)) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
CommandsRegistry.registerCommand({
|
|
138
|
+
id: 'vscode.revealTest',
|
|
139
|
+
handler: async (accessor, extId) => {
|
|
140
|
+
const test = accessor.get(ITestService).collection.getNodeById(extId);
|
|
141
|
+
if (!test) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const commandService = accessor.get(ICommandService);
|
|
145
|
+
const fileService = accessor.get(IFileService);
|
|
146
|
+
const openerService = accessor.get(IOpenerService);
|
|
147
|
+
const { range, uri } = test.item;
|
|
148
|
+
if (!uri) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const position = accessor.get(ITestingDecorationsService).getDecoratedTestPosition(uri, extId) || range?.getStartPosition();
|
|
152
|
+
accessor.get(ITestExplorerFilterState).reveal.value = extId;
|
|
153
|
+
accessor.get(ITestingPeekOpener).closeAllPeeks();
|
|
154
|
+
let isFile = true;
|
|
155
|
+
try {
|
|
156
|
+
if (!(await fileService.stat(uri)).isFile) {
|
|
157
|
+
isFile = false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
}
|
|
162
|
+
if (!isFile) {
|
|
163
|
+
await commandService.executeCommand(REVEAL_IN_EXPLORER_COMMAND_ID, uri);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
await openerService.open(position
|
|
167
|
+
? uri.with({ fragment: `L${position.lineNumber}:${position.column}` })
|
|
168
|
+
: uri);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
CommandsRegistry.registerCommand({
|
|
172
|
+
id: 'vscode.runTestsById',
|
|
173
|
+
handler: async (accessor, group, ...testIds) => {
|
|
174
|
+
const testService = accessor.get(ITestService);
|
|
175
|
+
await discoverAndRunTests(accessor.get(ITestService).collection, accessor.get(IProgressService), testIds, tests => testService.runTests({ group, tests }));
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
( Registry.as(Extensions$2.Configuration)).registerConfiguration(testingConfiguration);
|