Open per1234 opened 2 years ago
The editor tabs of
.ino
sketch files match their concatenation order.
Could you please help slightly generalize the expectation and help define the tab order for non .ino
and .pde
files? I want to tackle them together (also with #643).
The spec says:
No pre-processing is done to files in a sketch with any extension other than .ino or .pde.
What about the other files and their order?
IDE2 allows creating files with these extensions so that they can open up in an editor:
On the first sketch open, IDE2 opens the main sketch file (MainFile
) and the files in the root folder (RootFolderFiles
):
Is there any expectation of opening non-sketch-related editors in the main area? For example, when opening the Advanced Settings JSON or graphical editor?
Thank you!
Describe the problem
Arduino sketches may consist of multiple files, which are shown in the Arduino IDE as tabs when that sketch is open. All the
.ino
files of the sketch are concatenated before compiling, starting with the file that matches the sketch name, followed by the rest in lexicographical order:https://arduino.github.io/arduino-cli/dev/sketch-build-process/#pre-processing
The resulting program structure is conveyed to the user in an intuitive manner by the order of the
.ino
sketch tabs in the IDE reflecting their concatenation order.🐛 Tabs of newly added files follow the order of addition rather than the order of sketch concatenation. The concatenation behavior for these files will not be intuitive to a user unfamiliar with the obscure low level details of sketch pre-processing.
To reproduce
b.ino
a.ino
🐛 The "a.ino" tab is added to the right of the "b.ino" tab.
Expected behavior
The editor tabs of
.ino
sketch files match their concatenation order.Arduino IDE version
Original report
2.0.0-rc6-snapshot-289f9d7
Last verified with
51f69f6a5930ed1c947ac708b2d7280ea3e0cd57
Operating system
Windows
Operating system version
10
Additional context
The bug also occurs when files are added to the sketch externally
The bug also occurs when files are renamed.
Arduino IDE 1.x handles ordering of tabs for added sketch files as expected.
Additional reports
Issue checklist