mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-05 03:36:35 +00:00
[ui] Activate the Output
view.
- When new output arrives from the daemon. - Make sure, the current output channel is selected before appending any message to it. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
ab214f8426
commit
e14ac4a396
@ -1,6 +1,7 @@
|
||||
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";
|
||||
|
||||
@injectable()
|
||||
export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
||||
@ -8,9 +9,15 @@ export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
||||
@inject(OutputChannelManager)
|
||||
protected readonly outputChannelManager: OutputChannelManager;
|
||||
|
||||
@inject(OutputContribution)
|
||||
protected readonly outputContribution: OutputContribution;
|
||||
|
||||
onNewOutput(tool: string, chunk: string): void {
|
||||
const channel = this.outputChannelManager.getChannel(`Arduino: ${tool}`);
|
||||
channel.append(chunk);
|
||||
this.outputContribution.openView({ reveal: true }).then(() => {
|
||||
const channel = this.outputChannelManager.getChannel(`Arduino: ${tool}`);
|
||||
channel.setVisibility(true);
|
||||
channel.append(chunk);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
@ -33,13 +33,13 @@ export class ArduinoDaemon implements BackendApplicationContribution {
|
||||
});
|
||||
if (daemon.stdout) {
|
||||
daemon.stdout.on('data', data => {
|
||||
this.toolOutputService.publishNewOutput("daemon", data.toString());
|
||||
this.toolOutputService.publishNewOutput('daemon', data.toString());
|
||||
DaemonLog.log(this.logger, data.toString());
|
||||
});
|
||||
}
|
||||
if (daemon.stderr) {
|
||||
daemon.stderr.on('data', data => {
|
||||
this.toolOutputService.publishNewOutput("daemon error", data.toString());
|
||||
this.toolOutputService.publishNewOutput('daemon error', data.toString());
|
||||
DaemonLog.log(this.logger, data.toString());
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user