do not reveal the output for daemon messages

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2020-07-23 17:16:44 +02:00
parent 722f8d7534
commit 696048b5d9

View File

@ -1,23 +1,19 @@
import { ToolOutputServiceClient } from '../../common/protocol/tool-output-service';
import { injectable, inject } from 'inversify';
import { OutputChannelManager } from '@theia/output/lib/common/output-channel';
import { OutputContribution } from '@theia/output/lib/browser/output-contribution';
import { CommandService } from '@theia/core/lib/common/command';
import { OutputCommands } from '@theia/output/lib/browser/output-contribution';
@injectable()
export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
@inject(OutputChannelManager)
protected readonly outputChannelManager: OutputChannelManager;
@inject(CommandService)
protected commandService: CommandService;
@inject(OutputContribution)
protected readonly outputContribution: OutputContribution;
onNewOutput(tool: string, chunk: string): void {
this.outputContribution.openView().then(() => {
const channel = this.outputChannelManager.getChannel(`Arduino: ${tool}`);
channel.show();
channel.append(chunk);
});
onNewOutput(tool: string, text: string): void {
const name = `Arduino: ${tool}`;
// Zen-mode: we do not reveal the output for daemon messages.
const show = tool === 'daemon' ? Promise.resolve() : this.commandService.executeCommand(OutputCommands.SHOW.id, { name, options: { preserveFocus: false } });
show.then(() => this.commandService.executeCommand(OutputCommands.APPEND.id, { name, text }));
}
}