8000 Improved error messages for .cpp/.h file in the sketch (#1224) · arduino/arduino-cli@ab58758 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab58758

Browse files
cmaglieOliver Schönrock
and
Oliver Schönrock
authored
Improved error messages for .cpp/.h file in the sketch (#1224)
Add #line tags to AdditionalFiles when copying to build directory Co-authored-by: Oliver Schönrock <oliver@openbrackets.net>
1 parent df03ad7 commit ab58758

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arduino/builder/sketch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ func SketchCopyAdditionalFiles(sketch *sketch.Sketch, destPath string, overrides
289289
sourceBytes = s
290290
}
291291

292+
// tag each addtional file with the filename of the source it was copied from
293+
sourceBytes = append([]byte("#line 1 "+QuoteCppString(item.Path)+"\n"), sourceBytes...)
294+
292295
err = writeIfDifferent(sourceBytes, targetPath)
293296
if err != nil {
294297
return errors.Wrap(err, "unable to write to destination file")

0 commit comments

Comments
 (0)
0