Closed
Description
Describe the request
It would be great if the files drop down menu would allow to "add existing files"
Describe the current behavior
If I want to reuse some code I wrote earlier without creating a library, I manually copy those files to the sketch folder.
At the moment I have to restart the IDE to integrate them into the sketch. (tracked at #296)
Expected behavior
It is possible to add existing code files to a sketch via the Arduino IDE GUI.
Arduino IDE version
Operating system
Windows
Operating system version
10
Additional context
Additional reports:
- https://forum.arduino.cc/t/sketch-add-file/677557
- https://forum.arduino.cc/t/adding-files-change-of-behavior-bug-or-me-being-dumb/1068993
Issue checklist
- I searched for previous reports in the issue trackerI verified the problem still occurs when using the latest nightly buildMy report contains all necessary details
Activity
ubidefeo commentedon Mar 28, 2021
@per1234
This one is something I have also found myself in need of.
What's your opinion?
per1234 commentedon Mar 29, 2021
I don't think it would do any harm. This tabs menu is not something a beginner needs to use, so adding additional functionality to it doesn't add complexity to the beginner's UI.
ubidefeo commentedon Mar 30, 2021
thanks @per1234
let's create a task for this :)
per1234 commentedon Dec 24, 2022
Thanks to a forum user, I just discovered that Arduino IDE 1.x has this capability, so this is actually a matter of feature parity.
I remember that when the Sketch > Add File... capability was added to Arduino IDE 2.x, it was specified as a way to add supplemental files (e.g., documentation) to the
data
subfolder of the sketch. I never used this feature in Arduino IDE 1.x, but now that I try it out, I see the Arduino IDE 1.x behavior is more complex than what was specified for the Arduino IDE 2.x implementation:.ino
,.h
,.cpp
,.c
,.S
), add it to the the root of the sketch folder.data
subfolder of the sketch.Arduino IDE 2.x's Sketch > Add File... capability always does the second of these, even when adding a file with a supported sketch code file extension.
kittaakos commentedon Jan 6, 2023
And '.hpp', and '.hh'.
fix: aligned `Add File...` behavior with IDE 1.x
Add File...
behavior with IDE 1.x #1805fix: aligned `Add File...` behavior with IDE 1.x