Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to add existing files to a sketch #284

Closed
3 tasks done
Lorandil opened this issue Mar 28, 2021 · 5 comments · Fixed by #1805
Closed
3 tasks done

Option to add existing files to a sketch #284

Lorandil opened this issue Mar 28, 2021 · 5 comments · Fixed by #1805
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@Lorandil
Copy link

Lorandil commented Mar 28, 2021

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

76f9f63

Operating system

Windows

Operating system version

10

Additional context

Additional reports:

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
@Lorandil Lorandil added the type: enhancement Proposed improvement label Mar 28, 2021
@ubidefeo
Copy link

@per1234
This one is something I have also found myself in need of.
What's your opinion?

@per1234
Copy link
Contributor

per1234 commented 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
Copy link

thanks @per1234

let's create a task for this :)

@per1234
Copy link
Contributor

per1234 commented 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:

  • If the selected file has a supported sketch code file extension (e.g., .ino, .h, .cpp, .c, .S), add it to the the root of the sketch folder.
  • If the selected file has any other file extension, add it to the 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 kittaakos self-assigned this Dec 25, 2022
@kittaakos
Copy link
Contributor

  • If the selected file has a supported sketch code file extension (e.g., .ino, .h, .cpp, .c, .S), add it to the the root of the sketch folder.

And '.hpp', and '.hh'.

kittaakos pushed a commit that referenced this issue Jan 6, 2023
 - code files will be copied to sketch folder root
 - other files go under the `data` folder in the sketch folder root

Closes #284

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jan 11, 2023
 - code files will be copied to sketch folder root
 - other files go under the `data` folder in the sketch folder root

Closes #284

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants