Skip to content

Commit ec8df37

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Fixed the output channel registry for extensions.
See: eclipse-theia/theia#8122 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent cb24571 commit ec8df37

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ import { LibraryServiceProvider } from './library/library-service-provider';
124124
import { IncludeLibrary } from './contributions/include-library';
125125
import { OutputChannelManager as TheiaOutputChannelManager } from '@theia/output/lib/common/output-channel';
126126
import { OutputChannelManager } from './theia/output/output-channel';
127+
import { OutputChannelRegistryMainImpl as TheiaOutputChannelRegistryMainImpl, OutputChannelRegistryMainImpl } from './theia/plugin-ext/output-channel-registry-main';
127128

128129
const ElementQueries = require('css-element-queries/src/ElementQueries');
129130

@@ -314,6 +315,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
314315
rebind(TheiaOutputWidget).toService(OutputWidget);
315316
bind(OutputChannelManager).toSelf().inSingletonScope();
316317
rebind(TheiaOutputChannelManager).toService(OutputChannelManager);
318+
bind(OutputChannelRegistryMainImpl).toSelf().inTransientScope();
319+
rebind(TheiaOutputChannelRegistryMainImpl).toService(OutputChannelRegistryMainImpl);
317320

318321
// Show a disconnected status bar, when the daemon is not available
319322
bind(ApplicationConnectionStatusContribution).toSelf().inSingletonScope();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { injectable, inject } from 'inversify';
2+
import { CommandService } from '@theia/core/lib/common/command';
3+
import { OutputCommands } from '@theia/output/lib/browser/output-commands';
4+
import { PluginInfo } from '@theia/plugin-ext/lib/common/plugin-api-rpc';
5+
import { OutputChannelRegistryMainImpl as TheiaOutputChannelRegistryMainImpl } from '@theia/plugin-ext/lib/main/browser/output-channel-registry-main';
6+
7+
@injectable()
8+
export class OutputChannelRegistryMainImpl extends TheiaOutputChannelRegistryMainImpl {
9+
10+
@inject(CommandService)
11+
protected readonly commandService: CommandService;
12+
13+
$append(name: string, text: string, pluginInfo: PluginInfo): PromiseLike<void> {
14+
this.commandService.executeCommand(OutputCommands.APPEND.id, { name, text });
15+
return Promise.resolve();
16+
}
17+
18+
$clear(name: string): PromiseLike<void> {
19+
this.commandService.executeCommand(OutputCommands.CLEAR.id, { name });
20+
return Promise.resolve();
21+
}
22+
23+
$dispose(name: string): PromiseLike<void> {
24+
this.commandService.executeCommand(OutputCommands.DISPOSE.id, { name });
25+
return Promise.resolve();
26+
}
27+
28+
async $reveal(name: string, preserveFocus: boolean): Promise<void> {
29+
const options = { preserveFocus };
30+
this.commandService.executeCommand(OutputCommands.SHOW.id, { name, options });
31+
}
32+
33+
$close(name: string): PromiseLike<void> {
34+
this.commandService.executeCommand(OutputCommands.HIDE.id, { name });
35+
return Promise.resolve();
36+
}
37+
38+
}

0 commit comments

Comments
 (0)