-
-
Notifications
You must be signed in to change notification settings - Fork 489
Closed
Labels
conclusion: off topicOff topic for this repositoryOff topic for this repositorytopic: CLIRelated to Arduino CLIRelated to Arduino CLItopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the bug
When compiling a sketch with unsaved changes, the code in the editor is compiled (good), but the code from the saved version of the sketch is used in the error message when there is a compilation failure (bad).
To Reproduce
Steps to reproduce the behavior:
- File > Preferences
- Uncheck the box next to "Auto save".
- Click the "OK" button.
- Open a sketch that will compile without errors (e.g., File > New).
- Make changes to the sketch code that would cause a compilation failure. Don't save.
- Sketch > Verify/Compile. The compilation fails.
- Check the error message in the output menu. The quoted line of code is from the saved version of the sketch, not the code that caused the error.
For example, if I have this sketch saved:
void setup() {}
void loop() {}
and this is the dirty version:
foovoid setup() {}
void loop() {}
The compilation error:
c:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2021112-12840-1u0f2iv.mccj\sketch_feb12a\sketch_feb12a.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
void setup() {}
^~~~~~~
void
c:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2021112-12840-1u0f2iv.mccj\sketch_feb12a\sketch_feb12a.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
void setup() {}
^~~~~~~
void
Compilation error: Error: 2 UNKNOWN: exit status 1
Expected behavior
The code of the sketch that was compiled should be shown in the error output:
c:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2021112-12840-1u0f2iv.mccj\sketch_feb12a\sketch_feb12a.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
foovoid setup() {}
^~~~~~~
Compilation error: Error: 2 UNKNOWN: exit status 1
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows 10
- Version: 2.0.0-beta.1-snapshot.9e35571
Date: 2021-02-12T08:28:48.914Z
CLI Version: nightly-20210212 alpha [560025a6]
Additional context
The compilation of the dirty sketch is a new behavior introduced by f53013b as a fix for https://github.com/arduino/arduino-pro-ide/issues/432
Metadata
Metadata
Assignees
Labels
conclusion: off topicOff topic for this repositoryOff topic for this repositorytopic: CLIRelated to Arduino CLIRelated to Arduino CLItopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project