mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-09 21:56:32 +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 { 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 { OutputChannelManager } from "@theia/output/lib/common/output-channel";
|
||||||
|
import { OutputContribution } from "@theia/output/lib/browser/output-contribution";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
||||||
@ -8,9 +9,15 @@ export class ToolOutputServiceClientImpl implements ToolOutputServiceClient {
|
|||||||
@inject(OutputChannelManager)
|
@inject(OutputChannelManager)
|
||||||
protected readonly outputChannelManager: OutputChannelManager;
|
protected readonly outputChannelManager: OutputChannelManager;
|
||||||
|
|
||||||
|
@inject(OutputContribution)
|
||||||
|
protected readonly outputContribution: OutputContribution;
|
||||||
|
|
||||||
onNewOutput(tool: string, chunk: string): void {
|
onNewOutput(tool: string, chunk: string): void {
|
||||||
const channel = this.outputChannelManager.getChannel(`Arduino: ${tool}`);
|
this.outputContribution.openView({ reveal: true }).then(() => {
|
||||||
channel.append(chunk);
|
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) {
|
if (daemon.stdout) {
|
||||||
daemon.stdout.on('data', data => {
|
daemon.stdout.on('data', data => {
|
||||||
this.toolOutputService.publishNewOutput("daemon", data.toString());
|
this.toolOutputService.publishNewOutput('daemon', data.toString());
|
||||||
DaemonLog.log(this.logger, data.toString());
|
DaemonLog.log(this.logger, data.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (daemon.stderr) {
|
if (daemon.stderr) {
|
||||||
daemon.stderr.on('data', data => {
|
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());
|
DaemonLog.log(this.logger, data.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user