-
-
Notifications
You must be signed in to change notification settings - Fork 436
/
Copy pathoutput-channel-registry-main.ts
46 lines (40 loc) · 1.55 KB
/
output-channel-registry-main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { injectable, inject } from '@theia/core/shared/inversify';
import { CommandService } from '@theia/core/lib/common/command';
import { OutputCommands } from '@theia/output/lib/browser/output-commands';
import { PluginInfo } from '@theia/plugin-ext/lib/common/plugin-api-rpc';
import { OutputChannelRegistryMainImpl as TheiaOutputChannelRegistryMainImpl } from '@theia/plugin-ext/lib/main/browser/output-channel-registry-main';
@injectable()
export class OutputChannelRegistryMainImpl extends TheiaOutputChannelRegistryMainImpl {
@inject(CommandService)
protected override readonly commandService: CommandService;
override $append(
name: string,
text: string,
pluginInfo: PluginInfo
): PromiseLike<void> {
this.commandService.executeCommand(OutputCommands.APPEND.id, {
name,
text,
});
return Promise.resolve();
}
override $clear(name: string): PromiseLike<void> {
this.commandService.executeCommand(OutputCommands.CLEAR.id, { name });
return Promise.resolve();
}
override $dispose(name: string): PromiseLike<void> {
this.commandService.executeCommand(OutputCommands.DISPOSE.id, { name });
return Promise.resolve();
}
override async $reveal(name: string, preserveFocus: boolean): Promise<void> {
const options = { preserveFocus };
this.commandService.executeCommand(OutputCommands.SHOW.id, {
name,
options,
});
}
override $close(name: string): PromiseLike<void> {
this.commandService.executeCommand(OutputCommands.HIDE.id, { name });
return Promise.resolve();
}
}