Open
Description
Describe the problem
Arduino IDE has features to facilitate navigation in the editor to the code lines associated with a compilation error:
- Editor tab for file associated with error automatically selected and editor view scrolled to make associated line visible (#608, #229 Reveal the error location after the failed verify #1064).
- Path/line number reference in error messages displayed in "Output" panel are linked ("Reveal Error"): #118, #1154 Link compiler errors to editor. #1275
- If multiple errors occurred and
arduino.compile.experimental
setting is enabled, "Previous Error" and "Next Error" links are shown above the code line when the cursor is placed at the line associated with an error (#608, #229 Reveal the error location after the failed verify #1064).
🐛 These features work only intermittently for errors associated with sketch files other than the primary .ino
file.
To reproduce
- Select File > New Sketch from the Arduino IDE menus.
- Add the following line to the sketch code:
#error
- Select any board from the Tools > Board menu.
- Select Sketch > Verify/Compile from the Arduino IDE menus.
- Wait for the compilation to fail.
- Note that the path:line number reference in the error message in the "Output" panel is underlined to indicate it is a link.
- Hover the mouse pointer over the path:line number reference in the error message in the "Output" panel.
🙂 A UI element appears with a "Reveal Error" link, as expected. - Remove the
#error
directive from the sketch code. - Click the ●●● at the right side of the main panel toolbar.
A menu will open. - Select "New Tab" from the menu.
The "Name for new file" dialog will open. - Type
Foo
in the field in the dialog. - Click the "OK" button.
The dialog will close and a "Foo.ino" tab will be added to the main panel. - Add the following line to the "Foo.ino" tab:
#error
- Select the leftmost tab in the main panel.
- Select Sketch > Verify/Compile from the Arduino IDE menus.
- Wait for the compilation to fail.
🐛 The "Foo.ino" tab was not selected.
🐛 The path:line number reference in the error message in the "Output" panel is not underlined. - Hover the mouse pointer over the path:line number reference in the error message in the "Output" panel.
🐛 "Reveal Error" UI element does not appear.
Expected behavior
Error line navigation features work reliably for all code files.
Arduino IDE version
Operating system
- Windows
- Linux
- macOS
Operating system version
- Windows 11
- Ubuntu 22.04
- macOS 14.4.1
Additional context
I have found the instructions provided above to reliably produce the fault, but during other experiments I found that the features do work intermittently with additional sketch files (including those with non-.ino
file extensions). So this is not a matter of a complete lack of support for additional files in these features.
Originally reported at https://forum.arduino.cc/t/go-with-cursor-to-file-line-when-click-on-error-in-outpput-view/1258215
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