IDE bug report and feature suggestion

My IDE version: 1.6.9
Number of tabs open in my project: 29
I’m not sure what to call this bug, but I’ve noticed that sometimes the IDE gets its knickers in a twist and won’t compile without errors even though the errors previously reported have been fixed. The last time this happened, I had added words like “PROGMEM” in the right spot in the code, and had deleted a line of code I had pasted in one spot as a template for writing a similar line of code. After numerous compile attempts, where I commented out some lines, or changed the order of some #include statements, all to no avail, I decided to shut the IDE down and restart it again.
Upon restarting and reloading my project, suddenly the template line I had previously deleted was there again! So I deleted that line again and recompiled, and this time it compiled without errors, but with a warning that dynamic memory was low and could result in instability. About 7k of dynamic memory had been allocated, where it was previous just under 1k. So I checked one of the files in my project and found that the “PROGMEM” word I had previously added was gone! No wonder my bitmap font file was ending up in dynamic memory rather than program memory. Anyway, fixed that, and then it was all good.
So… it appears the IDE sometimes pretends to save, and presents the file in the project tab as if it’s without error, but compiles a different file which still has the error in it.

OK, now the feature suggestionS:
The current project I’m working on has LOTS of files in various tabs. I’m doing this mostly because otherwise the main file would become huge, and certain functions within that file would become impossibly tedious to read and understand because they have switch statements with each case having lengthy bits of code. So certain sections of code within these switch statements are written in a separate file, which is #included at the right spot in the switch statement, almost looking like a function call but without the overhead. Other files contain various classes or fonts, etc.
It becomes kind of tedious to switch between tabs by having to use the downward triangle button on the right of the tabs.

Suggestion 1: It would be nice if the tabs would automatically re-arrange themselves, so that the main project tab is always the left-most one, and the ones next to that would be the most recently used tabs in descending order. This way, the tabs I’m most frequently (or currently) working with, would always be closest to hand right next to the main project tab. Less frequently accessed tabs can then still be accessed via the downward triangle button.

Suggestion 2: Currently there are “add a tab” and “delete a tab” functions. I’d like to see these supplemented with 2 additional functions: A way to add a tab for a file that already exists (rather than starting a tab with a blank file), and a way to remove a tab WITHOUT deleting the file associated with that tab.

Suggestion 3: In tandem with my suggestion for automatically-rearranging tabs, another hugely helpful feature would be something LIKE the current downward triangle button for selecting different tabs, but this one acting on information within each file, and having its activating button on the tab for that file. So, click on that button on the tab, and a drop-down menu appears listing major structures within the file, such as functions, class declarations, etc. So rather than having to scroll up and down through a file to find a certain function to modify, I can just select that function from a list (automatically and dynamically generated as I write the file) and the editor window immediately scrolls to the right spot within the file where that function is located.

Suggestion 4: Wow, I’m on a roll. I just remember a previous idea I had, which would make the file easier to read. It would be really useful if you could right-click on a function header (eg: void MyFunction(x,y) { ) and have the editor automatically collapse the text of the function body into a single line below the function header line, saying “click to expand function body”. Or it could be in the form of a [+] or [-] box next to the line numbers, to expand or collapse a branch just as in Windows Explorer. This feature, in addition to automating this for function bodies, should also allow the user to specify blocks of text for collapsing. (Nested even?) This way, one can make the code easier to read, so that, for instance, each CASE in a switch statement can be collapsed into a single line. If that single line is the first line in the collapsed block, one could make that first line a simple comment that explains the purpose of the collapsed block. So the switch structure, rather than being obscured among so much code spread over several pages worth of scrolling text, becomes easier to read like this:
switch (Mode) {
case 0:
[+] // draw the main info screen

case 1:
[+] // draw the settings screen

case 2:
[+] // do some other cool thing (each of these might expand into screeds of code)

default:
[-] // error condition
tft.println(“Debug: Mode variable was out of bounds!”);
tft.print("Mode was: "); tft.println(Mode);
while(1);
}

So, hopefully others will agree that these could be useful additional features to the IDE.

Oh bugger, all those little black square blocks should actually be square braces with a + sign between them. It seems they are automatically replaced with a different symbol.

I suspect if you need 29 tabs you have outgrown the Arduino IDE :slight_smile:

I use the Geany editor for creating my programs and I have written a Python program that allows me to verify or upload code directly from Geany

When using the IDE if you change the board (say from an Uno to a Mega) and try to verify the program it re-starts the complete compile process (don't worry if the verify fails). Then switch back to your intended board and verify again.

...R

technochicken:
Suggestion 4: Wow, I'm on a roll. I just remember a previous idea I had, which would make the file easier to read. It would be really useful if you could right-click on a function header (eg: void MyFunction(x,y) { ) and have the editor automatically collapse the text of the function body into a single line below the function header line, saying "click to expand function body". Or it could be in the form of a [+] or [-] box next to the line numbers, to expand or collapse a branch just as in Windows Explorer.

You can do that somewhat by selecting File > Preferences > Enable Code Folding but it has some bugs that make it almost useless.