Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Fix #1215 Output sketch memory usage in non-verbose mode #1383

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/arduino/arduino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,15 @@ export class ArduinoApp {
// return VscodeSettings.getInstance().useArduinoCli;
}

/**
* Checks if the line contains memory usage information
* @param line output line to check
* @returns {bool} true if line contains memory usage information
*/
private isMemoryUsageInformation(line: string) {
return line.startsWith("Sketch uses ") || line.startsWith("Global variables use ");
}

/**
* Private implementation. Not to be called directly. The wrapper build()
* manages the build state.
Expand Down Expand Up @@ -732,6 +741,11 @@ export class ArduinoApp {
}
if (verbose) {
arduinoChannel.channel.append(line);
} else {
// Output sketch memory usage in non-verbose mode
if (this.isMemoryUsageInformation(line)) {
arduinoChannel.channel.append(line);
}
}
}
const stderrcb = (line: string) => {
Expand Down