Skip to content

Intermittent availability of error line navigation features for additional sketch files #2433

Open
@per1234

Description

@per1234

Describe the problem

Arduino IDE has features to facilitate navigation in the editor to the code lines associated with a compilation error:

🐛 These features work only intermittently for errors associated with sketch files other than the primary .ino file.

To reproduce

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Add the following line to the sketch code:
    #error
  3. Select any board from the Tools > Board menu.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to fail.
  6. Note that the path:line number reference in the error message in the "Output" panel is underlined to indicate it is a link.
  7. 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.
  8. Remove the #error directive from the sketch code.
  9. Click the ●●● at the right side of the main panel toolbar.
    A menu will open.
  10. Select "New Tab" from the menu.
    The "Name for new file" dialog will open.
  11. Type Foo in the field in the dialog.
  12. Click the "OK" button.
    The dialog will close and a "Foo.ino" tab will be added to the main panel.
  13. Add the following line to the "Foo.ino" tab:
    #error
  14. Select the leftmost tab in the main panel.
  15. Select Sketch > Verify/Compile from the Arduino IDE menus.
  16. 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.
  17. 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

aa9b10d

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions