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

Builder supports sketch subfolders, but IDE editor does not #4821

Closed
PaulStoffregen opened this issue Apr 5, 2016 · 6 comments
Closed

Builder supports sketch subfolders, but IDE editor does not #4821

PaulStoffregen opened this issue Apr 5, 2016 · 6 comments
Assignees
Labels
Component: IDE user interface The Arduino IDE's user interface Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)

Comments

@PaulStoffregen
Copy link
Contributor

Recent versions of Arduino with the new builder support recursive building, where subfolders are scanned and all files found are compiled. Perhaps this was meant only for libraries, but it's also being done for sketches.

However, the IDE editor does not support files in subfolders. If you create a subfolder in a sketch folder, and place code within it, this code will be built as part of the sketch. But the user can't edit it, or even see any visual indication Arduino is building other code.

This can be problem for examples, written before the new builder, which placed PC-based example code in subfolders. Because there's no visual indication other code is being compiled, this leads to very confusing errors.

@lmihalkovic
Copy link

This is where other people have also commented about the absence of file management capability in the editor. This is actually an easy thing to add (the first change I made to my own codebase). Done reasonably well it is also a big help for integrating a debugger.

@per1234
Copy link
Collaborator

per1234 commented Jul 4, 2017

.ino files were excluded from recursive compilation in arduino/arduino-builder@54e0a8f, which goes a long way towards solving this.

I believe recursive compilation in sketch folders was also limited the src folder, which makes it much less likely that a user will inadvertently run into problems by putting source files in a subfolder of their sketch folder.

The downside to always showing the contents of the src folder in the IDE as tabs would be that it clutters things up significantly. Often libraries are bundled with a sketch specifically so that it can be provided to the end user as a complete package and they will not need to worry about installing libraries. It's this sort of user who would be the least likely to need to access the contents of the bundled libraries from the IDE and the most likely to be confused by them.

I do think it would be nice for the ability to open those files in the IDE to be a non-default option, which would be sensible to do in combination with #3512.

@per1234 per1234 added Component: IDE The Arduino IDE Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix) labels Sep 25, 2020
@per1234
Copy link
Collaborator

per1234 commented Sep 27, 2020

Please see #7609 for additional discussion on this topic.

@TCB13
Copy link

TCB13 commented Mar 10, 2024

.ino files were excluded from recursive compilation in arduino/arduino-builder@54e0a8f, which goes a long way towards solving this.

I don't get it. This has nothing to do with the way compilation is handled. The IDE just needs to do what VSCode does, show a sidebar with all the folders bellow the folder where the root .ino file sits and that's it.

The downside to always showing the contents of the src folder in the IDE as tabs would be that it clutters things up significantly.

That's because the Arduino IDE decided to show everything as tabs instead of a sidebar. Tabs should be open files like in any IDE and the sidebar should show everything.

I frankly don't understand why the Arduino IDE was made like this. It was based on Eclipse Theia that supports a sidebar and behaves like any other IDE, why mess with something that was already there?

@per1234
Copy link
Collaborator

per1234 commented Mar 10, 2024

The IDE just needs to do what VSCode does, show a sidebar with all the folders bellow the folder where the root .ino file sits and that's it.

This is now done in Arduino IDE 2.x:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show files inside Sketches".
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Click the icon that looks like a folder in the activity bar on the left side of the Arduino IDE window.
    The "SKETCHBOOK" view will open.
  5. You will see the contents of the sketch folder. Click the icon to expand the src subfolder.
  6. Click on the file under the src subfolder that you would like to edit.

The file will now open in an Arduino IDE editor tab.

@per1234
Copy link
Collaborator

per1234 commented Mar 10, 2024

Since the recursive compilation is now controlled and the IDE allows the user to see and edit the contents of the src subfolder, I will close this as resolved.

@per1234 per1234 closed this as completed Mar 10, 2024
@per1234 per1234 self-assigned this Mar 10, 2024
@arduino arduino locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: IDE user interface The Arduino IDE's user interface Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

No branches or pull requests

4 participants