Description
Describe the problem
An Arduino sketch is a folder. This folder must contain an .ino
file matching the folder name:
Foo/
└── Foo.ino
Users who have only worked with the single file sketches common in introductory tutorials and examples may have the impression that the file is the sketch. Sketch authors may distribute sketches as a file or inline code for convenience. Some distribution methods (e.g., GitHub's automatically generated ZIP files) may alter the name of the sketch folder. Any of these things may result in an invalid sketch due to the lack of alignment between folder and .ino
file name.
For example:
Foo/
└── Bar.ino
If I start the Arduino IDE by opening a sketch that does not contain a .ino
file matching the folder name (which is required for it to be considered valid), the IDE opens with the same behavior as it would without a sketch argument (last loaded sketches are opened).
To reproduce
- Create a sketch that does not meet the naming requirements.
For example:Foo/ └── Bar.ino
- Open the sketch directly, either from Windows "File Explorer" if you have
.ino
file association configured, or by running the IDE from the command line with the sketch path as an argument.& ".\Arduino IDE" "C:\Users\per\Documents\Arduino\Foo\Bar.ino"
🐛 The IDE does not communicate the problem to the user. The user is more likely to think something is wrong with the IDE than with the sketch.
🐛 The IDE does not offer to move the sketch file to an appropriately named folder
Expected behavior
The same behavior as when opening the file via File > Open in the Arduino IDE, as it works in Arduino IDE 1.x.
Arduino IDE version
Original report
2.0.0-rc6-nightly-20220422
Last verified with
2.0.1-snapshot-8380c82
Operating system
Windows
Operating system version
10.0.19044
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details