@opensumi/ide-testing 2.21.13-rc-1673418254.0 → 2.21.13
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/lib/browser/components/testing.explorer.tree.d.ts.map +1 -1
- package/lib/browser/components/testing.explorer.tree.js +5 -7
- package/lib/browser/components/testing.explorer.tree.js.map +1 -1
- package/lib/browser/components/testing.view.js +1 -1
- package/lib/browser/components/testing.view.js.map +1 -1
- package/lib/browser/icons/icons.d.ts +0 -1
- package/lib/browser/icons/icons.d.ts.map +1 -1
- package/lib/browser/icons/icons.js +14 -15
- package/lib/browser/icons/icons.js.map +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/outputPeek/test-output-peek.js +9 -9
- package/lib/browser/outputPeek/test-output-peek.js.map +1 -1
- package/lib/browser/outputPeek/test-peek-message.service.js.map +1 -1
- package/lib/browser/outputPeek/test-peek-opener.service.js +1 -1
- package/lib/browser/outputPeek/test-peek-opener.service.js.map +1 -1
- package/lib/browser/outputPeek/test-peek-widget.js +1 -1
- package/lib/browser/outputPeek/test-peek-widget.js.map +1 -1
- package/lib/browser/outputPeek/test-tree-container.js +2 -2
- package/lib/browser/outputPeek/test-tree-container.js.map +1 -1
- package/lib/browser/test-contextkey.service.js.map +1 -1
- package/lib/browser/test-decorations.js +19 -19
- package/lib/browser/test-decorations.js.map +1 -1
- package/lib/browser/test-profile.service.js.map +1 -1
- package/lib/browser/test-tree-view.model.d.ts +0 -1
- package/lib/browser/test-tree-view.model.d.ts.map +1 -1
- package/lib/browser/test-tree-view.model.js +10 -13
- package/lib/browser/test-tree-view.model.js.map +1 -1
- package/lib/browser/test.result.service.d.ts +1 -1
- package/lib/browser/test.result.service.d.ts.map +1 -1
- package/lib/browser/test.result.service.js +5 -5
- package/lib/browser/test.result.service.js.map +1 -1
- package/lib/browser/test.service.d.ts +0 -4
- package/lib/browser/test.service.d.ts.map +1 -1
- package/lib/browser/test.service.js +4 -31
- package/lib/browser/test.service.js.map +1 -1
- package/lib/browser/testing.contribution.d.ts.map +1 -1
- package/lib/browser/testing.contribution.js +9 -20
- package/lib/browser/testing.contribution.js.map +1 -1
- package/lib/common/commands.d.ts +0 -1
- package/lib/common/commands.d.ts.map +1 -1
- package/lib/common/commands.js +1 -6
- package/lib/common/commands.js.map +1 -1
- package/lib/common/constants.js +12 -12
- package/lib/common/constants.js.map +1 -1
- package/lib/common/getComputedState.d.ts +1 -1
- package/lib/common/getComputedState.d.ts.map +1 -1
- package/lib/common/getComputedState.js +1 -1
- package/lib/common/getComputedState.js.map +1 -1
- package/lib/common/index.d.ts +0 -5
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js.map +1 -1
- package/lib/common/test-result.d.ts +2 -2
- package/lib/common/test-result.d.ts.map +1 -1
- package/lib/common/test-result.js +19 -19
- package/lib/common/test-result.js.map +1 -1
- package/lib/common/testCollection.d.ts +8 -9
- package/lib/common/testCollection.d.ts.map +1 -1
- package/lib/common/testCollection.js +27 -27
- package/lib/common/testCollection.js.map +1 -1
- package/lib/common/testId.js +21 -21
- package/lib/common/testId.js.map +1 -1
- package/lib/common/testingStates.js +11 -11
- package/lib/common/testingStates.js.map +1 -1
- package/lib/common/testingUri.d.ts +1 -1
- package/lib/common/testingUri.d.ts.map +1 -1
- package/lib/common/testingUri.js +16 -16
- package/lib/common/testingUri.js.map +1 -1
- package/package.json +13 -14
- package/lib/common/observableValue.d.ts +0 -14
- package/lib/common/observableValue.d.ts.map +0 -1
- package/lib/common/observableValue.js +0 -23
- package/lib/common/observableValue.js.map +0 -1
- package/src/browser/components/testing.explorer.tree.tsx +0 -129
- package/src/browser/components/testing.module.less +0 -26
- package/src/browser/components/testing.view.tsx +0 -35
- package/src/browser/icons/icons.less +0 -31
- package/src/browser/icons/icons.ts +0 -31
- package/src/browser/index.ts +0 -51
- package/src/browser/outputPeek/test-message-container.tsx +0 -183
- package/src/browser/outputPeek/test-output-peek.ts +0 -282
- package/src/browser/outputPeek/test-peek-message.service.ts +0 -15
- package/src/browser/outputPeek/test-peek-opener.service.ts +0 -131
- package/src/browser/outputPeek/test-peek-widget.less +0 -86
- package/src/browser/outputPeek/test-peek-widget.tsx +0 -127
- package/src/browser/outputPeek/test-tree-container.tsx +0 -171
- package/src/browser/test-contextkey.service.ts +0 -24
- package/src/browser/test-decorations.ts +0 -567
- package/src/browser/test-profile.service.ts +0 -66
- package/src/browser/test-tree-view.model.ts +0 -304
- package/src/browser/test.result.service.ts +0 -193
- package/src/browser/test.service.ts +0 -190
- package/src/browser/testing.contribution.ts +0 -470
- package/src/browser/theme.less +0 -6
- package/src/common/commands.ts +0 -78
- package/src/common/constants.ts +0 -57
- package/src/common/contextKeys.ts +0 -0
- package/src/common/getComputedState.ts +0 -136
- package/src/common/index.ts +0 -55
- package/src/common/observableValue.ts +0 -27
- package/src/common/test-profile.ts +0 -25
- package/src/common/test-result.ts +0 -328
- package/src/common/testCollection.ts +0 -680
- package/src/common/testId.ts +0 -191
- package/src/common/testing-view.ts +0 -28
- package/src/common/testingPeekOpener.ts +0 -31
- package/src/common/testingStates.ts +0 -92
- package/src/common/testingUri.ts +0 -101
- package/src/common/tree-view.model.ts +0 -41
- package/src/index.ts +0 -1
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
import { Injectable, Autowired, INJECTOR_TOKEN, Injector } from '@opensumi/di';
|
|
2
|
-
import {
|
|
3
|
-
ClientAppContribution,
|
|
4
|
-
CommandContribution,
|
|
5
|
-
CommandRegistry,
|
|
6
|
-
CommandService,
|
|
7
|
-
ComponentContribution,
|
|
8
|
-
ComponentRegistry,
|
|
9
|
-
Domain,
|
|
10
|
-
EDITOR_COMMANDS,
|
|
11
|
-
Event,
|
|
12
|
-
FileType,
|
|
13
|
-
getIcon,
|
|
14
|
-
KeybindingContribution,
|
|
15
|
-
KeybindingRegistry,
|
|
16
|
-
MaybePromise,
|
|
17
|
-
TabBarToolbarContribution,
|
|
18
|
-
ToolbarRegistry,
|
|
19
|
-
URI,
|
|
20
|
-
} from '@opensumi/ide-core-browser';
|
|
21
|
-
import { TestingCanRefreshTests, TestingIsPeekVisible } from '@opensumi/ide-core-browser/lib/contextkey/testing';
|
|
22
|
-
import { IMenuRegistry, MenuContribution, MenuId } from '@opensumi/ide-core-browser/lib/menu/next';
|
|
23
|
-
import { Emitter, IMarkdownString } from '@opensumi/ide-core-common';
|
|
24
|
-
import {
|
|
25
|
-
BrowserEditorContribution,
|
|
26
|
-
IEditorFeatureRegistry,
|
|
27
|
-
IEditorDocumentModelContentRegistry,
|
|
28
|
-
IEditorDocumentModelContentProvider,
|
|
29
|
-
WorkbenchEditorService,
|
|
30
|
-
EditorComponentRegistry,
|
|
31
|
-
ResourceService,
|
|
32
|
-
IResource,
|
|
33
|
-
} from '@opensumi/ide-editor/lib/browser';
|
|
34
|
-
import { IEditor } from '@opensumi/ide-editor/lib/common';
|
|
35
|
-
import { IFileServiceClient } from '@opensumi/ide-file-service';
|
|
36
|
-
import { MARKDOWN_EDITOR_COMPONENT_ID } from '@opensumi/ide-markdown/lib/browser/contribution';
|
|
37
|
-
import { MarkdownEditorComponent } from '@opensumi/ide-markdown/lib/browser/editor.markdown';
|
|
38
|
-
|
|
39
|
-
import { TestServiceToken } from '../common';
|
|
40
|
-
import {
|
|
41
|
-
ClearTestResults,
|
|
42
|
-
ClosePeekTest,
|
|
43
|
-
DebugAllTestCommand,
|
|
44
|
-
DebugTestCommand,
|
|
45
|
-
GoToNextMessage,
|
|
46
|
-
GoToPreviousMessage,
|
|
47
|
-
GoToTestCommand,
|
|
48
|
-
OpenMessageInEditor,
|
|
49
|
-
PeekTestError,
|
|
50
|
-
RefreshTestsCommand,
|
|
51
|
-
RuntAllTestCommand,
|
|
52
|
-
RuntTestCommand,
|
|
53
|
-
TestingDebugCurrentFile,
|
|
54
|
-
TestingRunCurrentFile,
|
|
55
|
-
} from '../common/commands';
|
|
56
|
-
import { Testing } from '../common/constants';
|
|
57
|
-
import { TestResultServiceToken } from '../common/test-result';
|
|
58
|
-
import { TestRunProfileBitset } from '../common/testCollection';
|
|
59
|
-
import { TestingPeekOpenerServiceToken } from '../common/testingPeekOpener';
|
|
60
|
-
import { ITestTreeViewModel, TestTreeViewModelToken } from '../common/tree-view.model';
|
|
61
|
-
|
|
62
|
-
import { TEST_DATA_SCHEME } from './../common/testingUri';
|
|
63
|
-
import { TestOutputPeekContribution } from './outputPeek/test-output-peek';
|
|
64
|
-
import { TestingPeekOpenerServiceImpl } from './outputPeek/test-peek-opener.service';
|
|
65
|
-
import { TestDecorationsContribution } from './test-decorations';
|
|
66
|
-
import { TestResultServiceImpl } from './test.result.service';
|
|
67
|
-
import { TestServiceImpl } from './test.service';
|
|
68
|
-
|
|
69
|
-
@Injectable()
|
|
70
|
-
export class TestingOutputPeekDocumentProvider implements IEditorDocumentModelContentProvider {
|
|
71
|
-
@Autowired(TestResultServiceToken)
|
|
72
|
-
private readonly testResultService: TestResultServiceImpl;
|
|
73
|
-
|
|
74
|
-
private _onDidChangeContent = new Emitter<URI>();
|
|
75
|
-
|
|
76
|
-
onDidChangeContent: Event<URI> = this._onDidChangeContent.event;
|
|
77
|
-
|
|
78
|
-
provideEditorDocumentModelContent(uri: URI, encoding?: string): MaybePromise<string> {
|
|
79
|
-
const dto = this.testResultService.retrieveTest(uri);
|
|
80
|
-
if (!dto) {
|
|
81
|
-
return '';
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const message = dto.messages[dto.messageIndex];
|
|
85
|
-
|
|
86
|
-
if (dto.isDiffable || typeof message.message === 'string') {
|
|
87
|
-
return '';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const mdStr = message.message;
|
|
91
|
-
const content = mdStr ? (mdStr as IMarkdownString).value.replace(/\t/g, '') : '';
|
|
92
|
-
|
|
93
|
-
return content;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
isReadonly(uri: URI): MaybePromise<boolean> {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
handlesScheme(scheme: string) {
|
|
101
|
-
return scheme === TEST_DATA_SCHEME;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@Injectable()
|
|
106
|
-
@Domain(
|
|
107
|
-
ClientAppContribution,
|
|
108
|
-
ComponentContribution,
|
|
109
|
-
CommandContribution,
|
|
110
|
-
BrowserEditorContribution,
|
|
111
|
-
MenuContribution,
|
|
112
|
-
KeybindingContribution,
|
|
113
|
-
TabBarToolbarContribution,
|
|
114
|
-
)
|
|
115
|
-
export class TestingContribution
|
|
116
|
-
implements
|
|
117
|
-
ClientAppContribution,
|
|
118
|
-
ComponentContribution,
|
|
119
|
-
CommandContribution,
|
|
120
|
-
BrowserEditorContribution,
|
|
121
|
-
MenuContribution,
|
|
122
|
-
KeybindingContribution,
|
|
123
|
-
TabBarToolbarContribution
|
|
124
|
-
{
|
|
125
|
-
@Autowired(TestTreeViewModelToken)
|
|
126
|
-
private readonly testTreeViewModel: ITestTreeViewModel;
|
|
127
|
-
|
|
128
|
-
@Autowired(IFileServiceClient)
|
|
129
|
-
protected readonly filesystem: IFileServiceClient;
|
|
130
|
-
|
|
131
|
-
@Autowired(CommandService)
|
|
132
|
-
private readonly commandService: CommandService;
|
|
133
|
-
|
|
134
|
-
@Autowired(INJECTOR_TOKEN)
|
|
135
|
-
private readonly injector: Injector;
|
|
136
|
-
|
|
137
|
-
@Autowired(TestingPeekOpenerServiceToken)
|
|
138
|
-
private readonly testingPeekOpenerService: TestingPeekOpenerServiceImpl;
|
|
139
|
-
|
|
140
|
-
@Autowired()
|
|
141
|
-
private readonly testingOutputPeekDocumentProvider: TestingOutputPeekDocumentProvider;
|
|
142
|
-
|
|
143
|
-
@Autowired(WorkbenchEditorService)
|
|
144
|
-
private readonly editorService: WorkbenchEditorService;
|
|
145
|
-
|
|
146
|
-
@Autowired(TestServiceToken)
|
|
147
|
-
private readonly testService: TestServiceImpl;
|
|
148
|
-
|
|
149
|
-
@Autowired(TestResultServiceToken)
|
|
150
|
-
private readonly testResultService: TestResultServiceImpl;
|
|
151
|
-
|
|
152
|
-
initialize(): void {
|
|
153
|
-
this.testTreeViewModel.initTreeModel();
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
registerComponent(registry: ComponentRegistry): void {}
|
|
157
|
-
|
|
158
|
-
registerCommands(commands: CommandRegistry): void {
|
|
159
|
-
commands.registerCommand(RuntTestCommand, {
|
|
160
|
-
execute: async (extId: string) => {
|
|
161
|
-
const test = this.testTreeViewModel.getTestItem(extId);
|
|
162
|
-
if (!test) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
await this.testService.runTests({
|
|
167
|
-
group: TestRunProfileBitset.Run,
|
|
168
|
-
tests: [test],
|
|
169
|
-
});
|
|
170
|
-
},
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
commands.registerCommand(DebugTestCommand, {
|
|
174
|
-
execute: async (extId: string) => {
|
|
175
|
-
const test = this.testTreeViewModel.getTestItem(extId);
|
|
176
|
-
if (!test) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
await this.testService.runTests({
|
|
181
|
-
group: TestRunProfileBitset.Debug,
|
|
182
|
-
tests: [test],
|
|
183
|
-
});
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
commands.registerCommand(GoToTestCommand, {
|
|
188
|
-
execute: async (extId: string) => {
|
|
189
|
-
const test = this.testTreeViewModel.getTestItem(extId);
|
|
190
|
-
if (!test) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
const { range, uri } = test.item;
|
|
195
|
-
if (!uri) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const fileStat = await this.filesystem.getFileStat(uri.toString());
|
|
200
|
-
|
|
201
|
-
if (!fileStat) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (fileStat.type === FileType.Directory) {
|
|
206
|
-
// ** filetree 未实现文件夹的 focus , 只能是将窗口切到资源管理器但无法选中文件夹 **
|
|
207
|
-
this.commandService.executeCommand('revealInExplorer', uri);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (fileStat.type === FileType.File) {
|
|
212
|
-
this.commandService.executeCommand(EDITOR_COMMANDS.OPEN_RESOURCE.id, URI.parse(uri.toString()), {
|
|
213
|
-
range,
|
|
214
|
-
focus: true,
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
isVisible: () => false,
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
commands.registerCommand(PeekTestError, {
|
|
222
|
-
execute: async (extId: string) => {
|
|
223
|
-
this.testingPeekOpenerService.open();
|
|
224
|
-
},
|
|
225
|
-
isVisible: () => false,
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
commands.registerCommand(ClosePeekTest, {
|
|
229
|
-
execute: async (uri: string | undefined) => {
|
|
230
|
-
uri = uri ?? this.editorService.currentEditor?.currentUri?.toString();
|
|
231
|
-
|
|
232
|
-
if (!uri) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const ctor = this.testingPeekOpenerService.peekControllerMap.get(uri);
|
|
237
|
-
if (ctor) {
|
|
238
|
-
ctor.removePeek();
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
isVisible: () => false,
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
commands.registerCommand(TestingRunCurrentFile, {
|
|
245
|
-
execute: async () => {
|
|
246
|
-
executeTestsInCurrentFile(TestRunProfileBitset.Run);
|
|
247
|
-
},
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
commands.registerCommand(TestingDebugCurrentFile, {
|
|
251
|
-
execute: async () => {
|
|
252
|
-
executeTestsInCurrentFile(TestRunProfileBitset.Debug);
|
|
253
|
-
},
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
const executeTestsInCurrentFile = (group: TestRunProfileBitset) => {
|
|
257
|
-
const currentEditor = this.editorService.currentEditor;
|
|
258
|
-
const monacoEditor = currentEditor?.monacoEditor;
|
|
259
|
-
const position = monacoEditor?.getPosition();
|
|
260
|
-
const model = monacoEditor?.getModel();
|
|
261
|
-
|
|
262
|
-
if (!position || !model || !('uri' in model)) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
const demandedUri = model.uri.toString();
|
|
267
|
-
for (const test of this.testService.collection.all) {
|
|
268
|
-
if (test.item.uri?.toString() === demandedUri) {
|
|
269
|
-
this.testService.runTests({
|
|
270
|
-
tests: [test],
|
|
271
|
-
group,
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
commands.registerCommand(GoToPreviousMessage, {
|
|
278
|
-
execute: async (uri: string | undefined) => {
|
|
279
|
-
uri = uri ?? this.editorService.currentEditor?.currentUri?.toString();
|
|
280
|
-
|
|
281
|
-
if (!uri) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const ctor = this.testingPeekOpenerService.peekControllerMap.get(uri);
|
|
286
|
-
if (ctor) {
|
|
287
|
-
ctor.previous();
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
commands.registerCommand(GoToNextMessage, {
|
|
293
|
-
execute: async (uri: string | undefined) => {
|
|
294
|
-
uri = uri ?? this.editorService.currentEditor?.currentUri?.toString();
|
|
295
|
-
|
|
296
|
-
if (!uri) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
const ctor = this.testingPeekOpenerService.peekControllerMap.get(uri);
|
|
301
|
-
if (ctor) {
|
|
302
|
-
ctor.next();
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
commands.registerCommand(ClearTestResults, {
|
|
308
|
-
execute: async (uri: string | undefined) => {
|
|
309
|
-
this.testResultService.clear();
|
|
310
|
-
this.commandService.executeCommand(ClosePeekTest.id, uri);
|
|
311
|
-
},
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
commands.registerCommand(OpenMessageInEditor, {
|
|
315
|
-
execute: async (uri: string | undefined) => {
|
|
316
|
-
uri = uri ?? this.editorService.currentEditor?.currentUri?.toString();
|
|
317
|
-
|
|
318
|
-
if (!uri) {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const ctor = this.testingPeekOpenerService.peekControllerMap.get(uri);
|
|
323
|
-
if (ctor) {
|
|
324
|
-
ctor.openCurrentInEditor();
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
const runOrDebugAllTestsAction = async (group: TestRunProfileBitset) => {
|
|
330
|
-
const roots = [...this.testService.collection.rootItems];
|
|
331
|
-
if (!roots.length) {
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
await this.testService.runTests({ tests: roots, group });
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
commands.registerCommand(RefreshTestsCommand, {
|
|
339
|
-
execute: async () => {
|
|
340
|
-
await this.testService.refreshTests();
|
|
341
|
-
},
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
commands.registerCommand(RuntAllTestCommand, {
|
|
345
|
-
execute: async () => {
|
|
346
|
-
await runOrDebugAllTestsAction(TestRunProfileBitset.Run);
|
|
347
|
-
},
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
commands.registerCommand(DebugAllTestCommand, {
|
|
351
|
-
execute: async () => {
|
|
352
|
-
await runOrDebugAllTestsAction(TestRunProfileBitset.Debug);
|
|
353
|
-
},
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
registerKeybindings(keybindings: KeybindingRegistry): void {
|
|
358
|
-
keybindings.registerKeybinding({
|
|
359
|
-
command: ClosePeekTest.id,
|
|
360
|
-
keybinding: 'esc',
|
|
361
|
-
when: TestingIsPeekVisible.equalsTo(true),
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
registerMenus(menuRegistry: IMenuRegistry) {
|
|
366
|
-
/** glyph margin start */
|
|
367
|
-
menuRegistry.registerMenuItem(MenuId.TestingGlyphMarginContext, {
|
|
368
|
-
command: RuntTestCommand.id,
|
|
369
|
-
group: '1_has_decoration',
|
|
370
|
-
order: 1,
|
|
371
|
-
});
|
|
372
|
-
menuRegistry.registerMenuItem(MenuId.TestingGlyphMarginContext, {
|
|
373
|
-
command: DebugTestCommand.id,
|
|
374
|
-
group: '1_has_decoration',
|
|
375
|
-
order: 2,
|
|
376
|
-
});
|
|
377
|
-
/** glyph margin end */
|
|
378
|
-
|
|
379
|
-
/** output peek view actions start */
|
|
380
|
-
menuRegistry.registerMenuItem(MenuId.TestPeekTitleContext, {
|
|
381
|
-
command: GoToPreviousMessage.id,
|
|
382
|
-
iconClass: GoToPreviousMessage.iconClass,
|
|
383
|
-
group: 'navigation',
|
|
384
|
-
order: 5,
|
|
385
|
-
});
|
|
386
|
-
menuRegistry.registerMenuItem(MenuId.TestPeekTitleContext, {
|
|
387
|
-
command: GoToNextMessage.id,
|
|
388
|
-
iconClass: GoToNextMessage.iconClass,
|
|
389
|
-
group: 'navigation',
|
|
390
|
-
order: 6,
|
|
391
|
-
});
|
|
392
|
-
menuRegistry.registerMenuItem(MenuId.TestPeekTitleContext, {
|
|
393
|
-
command: ClearTestResults.id,
|
|
394
|
-
iconClass: ClearTestResults.iconClass,
|
|
395
|
-
group: 'navigation',
|
|
396
|
-
order: 7,
|
|
397
|
-
});
|
|
398
|
-
menuRegistry.registerMenuItem(MenuId.TestPeekTitleContext, {
|
|
399
|
-
command: OpenMessageInEditor.id,
|
|
400
|
-
iconClass: OpenMessageInEditor.iconClass,
|
|
401
|
-
group: 'navigation',
|
|
402
|
-
order: 9,
|
|
403
|
-
});
|
|
404
|
-
/** output peek view actions end */
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
registerToolbarItems(registry: ToolbarRegistry): void {
|
|
408
|
-
registry.registerItem({
|
|
409
|
-
id: RefreshTestsCommand.id,
|
|
410
|
-
command: RefreshTestsCommand.id,
|
|
411
|
-
viewId: Testing.ExplorerViewId,
|
|
412
|
-
when: TestingCanRefreshTests.equalsTo(true),
|
|
413
|
-
});
|
|
414
|
-
registry.registerItem({
|
|
415
|
-
id: RuntAllTestCommand.id,
|
|
416
|
-
command: RuntAllTestCommand.id,
|
|
417
|
-
viewId: Testing.ExplorerViewId,
|
|
418
|
-
});
|
|
419
|
-
registry.registerItem({
|
|
420
|
-
id: DebugAllTestCommand.id,
|
|
421
|
-
command: DebugAllTestCommand.id,
|
|
422
|
-
viewId: Testing.ExplorerViewId,
|
|
423
|
-
});
|
|
424
|
-
registry.registerItem({
|
|
425
|
-
id: ClearTestResults.id,
|
|
426
|
-
command: ClearTestResults.id,
|
|
427
|
-
viewId: Testing.ExplorerViewId,
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
registerEditorFeature(registry: IEditorFeatureRegistry) {
|
|
432
|
-
registry.registerEditorFeatureContribution({
|
|
433
|
-
contribute: (editor: IEditor) => this.injector.get(TestDecorationsContribution, [editor]).contribute(),
|
|
434
|
-
});
|
|
435
|
-
registry.registerEditorFeatureContribution({
|
|
436
|
-
contribute: (editor: IEditor) => this.injector.get(TestOutputPeekContribution, [editor]).contribute(),
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
registerEditorDocumentModelContentProvider(registry: IEditorDocumentModelContentRegistry) {
|
|
441
|
-
registry.registerEditorDocumentModelContentProvider(this.testingOutputPeekDocumentProvider);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
registerEditorComponent(componentRegistry: EditorComponentRegistry) {
|
|
445
|
-
componentRegistry.registerEditorComponent({
|
|
446
|
-
uid: MARKDOWN_EDITOR_COMPONENT_ID,
|
|
447
|
-
component: MarkdownEditorComponent,
|
|
448
|
-
scheme: TEST_DATA_SCHEME,
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
componentRegistry.registerEditorComponentResolver(TEST_DATA_SCHEME, (_, results) => {
|
|
452
|
-
results.push({
|
|
453
|
-
type: 'component',
|
|
454
|
-
componentId: MARKDOWN_EDITOR_COMPONENT_ID,
|
|
455
|
-
weight: 10,
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
registerResource(service: ResourceService) {
|
|
461
|
-
service.registerResourceProvider({
|
|
462
|
-
scheme: TEST_DATA_SCHEME,
|
|
463
|
-
provideResource: async (uri: URI): Promise<IResource<Partial<{ [prop: string]: any }>>> => ({
|
|
464
|
-
uri,
|
|
465
|
-
icon: getIcon('file-text'),
|
|
466
|
-
name: `Preview ${uri.displayName}`,
|
|
467
|
-
}),
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
}
|
package/src/browser/theme.less
DELETED
package/src/common/commands.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Command, getExternalIcon, getIcon } from '@opensumi/ide-core-browser';
|
|
2
|
-
|
|
3
|
-
export const RuntTestCommand: Command = {
|
|
4
|
-
id: 'testing.run.test',
|
|
5
|
-
label: 'Run Test',
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const DebugTestCommand: Command = {
|
|
9
|
-
id: 'testing.debug.test',
|
|
10
|
-
label: 'Debug Test',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const GoToTestCommand: Command = {
|
|
14
|
-
id: 'testing.goto.test',
|
|
15
|
-
label: 'Go To Test',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const TestingRunCurrentFile: Command = {
|
|
19
|
-
id: 'testing.runCurrentFile',
|
|
20
|
-
label: 'Run Tests in Current File',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const TestingDebugCurrentFile: Command = {
|
|
24
|
-
id: 'testing.debugCurrentFile',
|
|
25
|
-
label: 'Debug Tests in Current File',
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const PeekTestError: Command = {
|
|
29
|
-
id: 'testing.peek.test.error',
|
|
30
|
-
label: 'Peek Output',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const ClosePeekTest: Command = {
|
|
34
|
-
id: 'testing.peek.test.close',
|
|
35
|
-
label: 'Close Peek Output',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const GoToPreviousMessage: Command = {
|
|
39
|
-
id: 'testing.goToPreviousMessage',
|
|
40
|
-
label: 'Go to Previous Test Failure',
|
|
41
|
-
iconClass: getIcon('arrowup'),
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const GoToNextMessage: Command = {
|
|
45
|
-
id: 'testing.goToNextMessage',
|
|
46
|
-
label: 'Go to Next Test Failure',
|
|
47
|
-
iconClass: getIcon('arrowdown'),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const ClearTestResults: Command = {
|
|
51
|
-
id: 'testing.clearTestResults',
|
|
52
|
-
label: 'Clear All Results',
|
|
53
|
-
iconClass: getExternalIcon('clear-all'),
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const OpenMessageInEditor: Command = {
|
|
57
|
-
id: 'testing.openMessageInEditor',
|
|
58
|
-
label: 'Open in Editor',
|
|
59
|
-
iconClass: getExternalIcon('link-external'),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const RuntAllTestCommand: Command = {
|
|
63
|
-
id: 'testing.runAll',
|
|
64
|
-
label: 'Run All Test',
|
|
65
|
-
iconClass: getExternalIcon('run-all'),
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const DebugAllTestCommand: Command = {
|
|
69
|
-
id: 'testing.debugAll',
|
|
70
|
-
label: 'Debug All Test',
|
|
71
|
-
iconClass: getIcon('debug-alt-small'),
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const RefreshTestsCommand: Command = {
|
|
75
|
-
id: 'testing.refresshTests',
|
|
76
|
-
label: 'Refresh Tests',
|
|
77
|
-
iconClass: getIcon('refresh'),
|
|
78
|
-
};
|
package/src/common/constants.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* ---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import { localize } from '@opensumi/ide-core-common';
|
|
7
|
-
|
|
8
|
-
import { TestMessageType, TestResultState, TestRunProfileBitset } from './testCollection';
|
|
9
|
-
|
|
10
|
-
export const enum Testing {
|
|
11
|
-
// marked as "extension" so that any existing test extensions are assigned to it.
|
|
12
|
-
ViewletId = 'workbench.view.extension.test',
|
|
13
|
-
ExplorerViewId = 'workbench.view.testing',
|
|
14
|
-
OutputPeekContributionId = 'editor.contrib.testingOutputPeek',
|
|
15
|
-
DecorationsContributionId = 'editor.contrib.testingDecorations',
|
|
16
|
-
FilterActionId = 'workbench.actions.treeView.testExplorer.filter',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const enum TestExplorerViewMode {
|
|
20
|
-
List = 'list',
|
|
21
|
-
Tree = 'true',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const enum TestExplorerViewSorting {
|
|
25
|
-
ByLocation = 'location',
|
|
26
|
-
ByStatus = 'status',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const enum TestExplorerStateFilter {
|
|
30
|
-
OnlyFailed = 'failed',
|
|
31
|
-
OnlyExecuted = 'excuted',
|
|
32
|
-
All = 'all',
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const testStateNames: { [K in TestResultState]: string } = {
|
|
36
|
-
[TestResultState.Errored]: localize('testState.errored', 'Errored'),
|
|
37
|
-
[TestResultState.Failed]: localize('testState.failed', 'Failed'),
|
|
38
|
-
[TestResultState.Passed]: localize('testState.passed', 'Passed'),
|
|
39
|
-
[TestResultState.Queued]: localize('testState.queued', 'Queued'),
|
|
40
|
-
[TestResultState.Running]: localize('testState.running', 'Running'),
|
|
41
|
-
[TestResultState.Skipped]: localize('testState.skipped', 'Skipped'),
|
|
42
|
-
[TestResultState.Unset]: localize('testState.unset', 'Not yet run'),
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const labelForTestInState = (label: string, state: TestResultState) =>
|
|
46
|
-
'label then the unit tests state, for example "Addition Tests (Running)"';
|
|
47
|
-
|
|
48
|
-
export const testConfigurationGroupNames: { [K in TestRunProfileBitset]: string } = {
|
|
49
|
-
[TestRunProfileBitset.Debug]: localize('testGroup.debug', 'Debug'),
|
|
50
|
-
[TestRunProfileBitset.Run]: localize('testGroup.run', 'Run'),
|
|
51
|
-
[TestRunProfileBitset.Coverage]: localize('testGroup.coverage', 'Coverage'),
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const testMessageSeverityColors = {
|
|
55
|
-
[TestMessageType.Error]: '#F14C4C',
|
|
56
|
-
[TestMessageType.Info]: '#33333380', // --> #333333 透明度 0.5 的结果
|
|
57
|
-
};
|
|
File without changes
|