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

Allow editing of files in subdirectories from the IDE #7609

Closed
Pharap opened this issue May 19, 2018 · 7 comments
Closed

Allow editing of files in subdirectories from the IDE #7609

Pharap opened this issue May 19, 2018 · 7 comments
Labels
Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix) Type: Duplicate Another item already exists for this topic

Comments

@Pharap
Copy link

Pharap commented May 19, 2018

Currently the IDE does not count files within subdirectories as part of the sketch and won't open tabs for them when a sketch is opened.
(It will however include them when compiling.)

It would be very useful if code files from subdirectories were counted as part of the sketch and opened in tabs when the main .ino file is opened.
This would encourage better structuring of program code and would remove one of the issues that people sometimes cite as a reason for avoiding the IDE.

@per1234
Copy link
Collaborator

per1234 commented May 19, 2018

I'm not trying to argue against this but I would like to point out that some projects benefit from the Arduino IDE not opening files in subdirectories. The most noteworthy is Marlin. The latest release of Marlin has 276 tabs. Most Marlin users only need access to Configuration.h and Configuration_adv.h, the files that allow them to configure the firmware. All those other tabs only make it difficult to use. Marlin 2.0.0 moves all source files to a subdirectory so when you open it with the Arduino IDE you have only 3 tabs: Marlin.ino (which only contains some comments), Configuration.h, and Configuration_adv.h.

I sometimes like to bundle library dependencies with a sketch. This allows me to send it to someone as a self-contained package so there is no need for the user to go through the extra complication of installing libraries before using the sketch. I only want to expose the simple sketch code to the sort of person I do that for. They can easily get started studying that sketch code and experimenting with modifying it. If all the library code was shoved in their face right from the start they would be very overwhelmed.

So if this is done I'd like to see some sort of UI where the files in subdirectories are not just dumped in as tabs. Instead, there should be some way to selectively expand/collapse subdirectories as needed. Maybe the subdirectory name would be presented as a tab, then when you click on that tab it adds a new tab bar row that contains the subdirectory's files/folders as tabs.

@lmihalkovic
Copy link

lmihalkovic commented May 19, 2018

Marlin is what i took as my ‘test lab’ for improving the ide. My goals were:

aside from cleaning the 1.9.x codebase, i also added a file browser as i did 2y ago. In the end, i like the result... and i can look at marlin semi-comfortably (much more than before)

For situations like marlin, it would be nice to remember whats open/closed and support reordering the tabs manually.. but i didnt care enough yet to do it

PS: the way i handled the folders 2y ago was that when opening a folder, u only saw the source files for that folder.. then u could select another folder for another set of tabs.. or the root folder for the top level files. this time the limitation is removed

@Pharap
Copy link
Author

Pharap commented May 19, 2018

@per1234 That's a fair point.

Ideally it would be good to perhaps have a sort of collapsable directory tree navigator or something on the left or right, like other IDEs often have, and then if tabs are closable it would be possible to open/close files as needed, and as you say, only open the top level by default.

I have no idea how difficult that would be to pull off because I don't know what the UI is based on (e.g. AWT, Swing).

@lmihalkovic
Copy link

lmihalkovic commented May 19, 2018

@Pharap from experience.. takes much longer the first time you do it than the second time around.

the first version looked like:
Navigation

but it could not close tabs. now it is the first thing i wrote

@lmihalkovic
Copy link

lmihalkovic commented May 19, 2018

@per1234 although your ‘meta tab’ idea is a clever trick, an implementation on the 1.8.xx or 1.9.xx (i have not looked at the changes in the last 2 weeks) codebase is not just a walk in the park. If you go down that path, you might as well do a file browser on the side (yes, u need extra code for handling the tree, but in the end that also opens other doors - like direct link to the cache for flushing, or link to the build folder itself ... blah blah blah)
as always, this is just an opinion.. based on doing these things, but just an opinion nonetheless

@lmihalkovic
Copy link

Lazy open.. and close. works even with file explorer disabled.

screen shot 2018-05-21 at 6 22 04 pm

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

per1234 commented Sep 27, 2020

I'm closing this as a duplicate of #4821, but I'll add a link back in a comment over there to make sure this nice discussion won't be forgotten.

@per1234 per1234 closed this as completed Sep 27, 2020
@per1234 per1234 added the Type: Duplicate Another item already exists for this topic label Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix) Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

No branches or pull requests

3 participants