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

Commit c5b03c9

Browse files
authored
Merge pull request #1383 from AlexIII/fix_no_verbose_sketch_stats_output
Fix #1215 Output sketch memory usage in non-verbose mode
2 parents 849de32 + aa4910b commit c5b03c9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/arduino/arduino.ts

+14
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,15 @@ export class ArduinoApp {
495495
// return VscodeSettings.getInstance().useArduinoCli;
496496
}
497497

498+
/**
499+
* Checks if the line contains memory usage information
500+
* @param line output line to check
501+
* @returns {bool} true if line contains memory usage information
502+
*/
503+
private isMemoryUsageInformation(line: string) {
504+
return line.startsWith("Sketch uses ") || line.startsWith("Global variables use ");
505+
}
506+
498507
/**
499508
* Private implementation. Not to be called directly. The wrapper build()
500509
* manages the build state.
@@ -732,6 +741,11 @@ export class ArduinoApp {
732741
}
733742
if (verbose) {
734743
arduinoChannel.channel.append(line);
744+
} else {
745+
// Output sketch memory usage in non-verbose mode
746+
if (this.isMemoryUsageInformation(line)) {
747+
arduinoChannel.channel.append(line);
748+
}
735749
}
736750
}
737751
const stderrcb = (line: string) => {

0 commit comments

Comments
 (0)