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

Commit d87402d

Browse files
elektronikworkshopadiazulay
authored andcommitted
Fix regression and improve regex matching
* Fixed regression introduced with adaptions to latest version of cocopa * Made compile command regex match more stringent
1 parent 39c3f79 commit d87402d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/arduino/arduino.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -838,14 +838,24 @@ export class ArduinoApp {
838838
}
839839
};
840840

841+
/**
842+
*
843+
* @param dc
844+
*/
841845
private makeCompilerParserEngines(dc: DeviceContext) {
846+
847+
let sketch = path.basename(dc.sketch);
848+
const dotcpp = sketch.endsWith(".ino") ? ".cpp" : "";
849+
sketch = `-o\\s+\\S*${ccp.regExEscape(sketch)}${dotcpp}\\.o`;
850+
842851
const matchPattern = [
843852
// trigger parser when compiling the main sketch
844-
` ${path.basename(dc.sketch)}.cpp.o`,
853+
RegExp(sketch),
845854
];
855+
846856
const dontMatchPattern = [
847857
// make sure Arduino's not testing libraries
848-
/-o\s\/dev\/null/,
858+
/-o\s+\/dev\/null/,
849859
];
850860

851861
// setup the parser with its engines

0 commit comments

Comments
 (0)