mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-23 11:16:42 +00:00
do not reveal the output for daemon messages
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
722f8d7534
commit
696048b5d9
@ -1,23 +1,19 @@
|
|||||||
import { ToolOutputServiceClient } from '../../common/protocol/tool-output-service';
|
import { ToolOutputServiceClient } from '../../common/protocol/tool-output-service';
|
||||||
import { injectable, inject } from 'inversify';
|
import { injectable, inject } from 'inversify';
|
||||||
import { OutputChannelManager } from '@theia/output/lib/common/output-channel';
|
import { CommandService } from '@theia/core/lib/common/command';
|
||||||
import { OutputContribution } from '@theia/output/lib/browser/output-contribution';
|
import { OutputCommands } from '@theia/output/lib/browser/output-contribution';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
||||||
|
|
||||||
@inject(OutputChannelManager)
|
@inject(CommandService)
|
||||||
protected readonly outputChannelManager: OutputChannelManager;
|
protected commandService: CommandService;
|
||||||
|
|
||||||
@inject(OutputContribution)
|
onNewOutput(tool: string, text: string): void {
|
||||||
protected readonly outputContribution: OutputContribution;
|
const name = `Arduino: ${tool}`;
|
||||||
|
// Zen-mode: we do not reveal the output for daemon messages.
|
||||||
onNewOutput(tool: string, chunk: string): void {
|
const show = tool === 'daemon' ? Promise.resolve() : this.commandService.executeCommand(OutputCommands.SHOW.id, { name, options: { preserveFocus: false } });
|
||||||
this.outputContribution.openView().then(() => {
|
show.then(() => this.commandService.executeCommand(OutputCommands.APPEND.id, { name, text }));
|
||||||
const channel = this.outputChannelManager.getChannel(`Arduino: ${tool}`);
|
|
||||||
channel.show();
|
|
||||||
channel.append(chunk);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user