Skip to content

Display code errors in red in real time #1712

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

Closed
3 tasks done
JulienLecoq opened this issue Nov 27, 2022 · 2 comments
Closed
3 tasks done

Display code errors in red in real time #1712

JulienLecoq opened this issue Nov 27, 2022 · 2 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@JulienLecoq
Copy link

Describe the request

I would like to have code errors appears in real time on screen (before compilation as does other IDEs)

Describe the current behavior

Code errors are only printed inside the Output section of the IDE on Verify/Upload buttons click.

Arduino IDE version

2.0.2

Operating system

Linux

Operating system version

I'm using Garuda Linux, according to lsb_release -a : "Talon"

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@JulienLecoq JulienLecoq added the type: enhancement Proposed improvement label Nov 27, 2022
@per1234
Copy link
Contributor

per1234 commented Nov 27, 2022

Hi @JulienLecoq. Thanks for your suggestion.

I'm happy to tell you Arduino IDE already has this capability. It can be enabled via the advanced settings:

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
  3. A "Preferences" tab will now open in the Arduino IDE main panel. In the "Search Settings" field, type arduino.language.realTimeDiagnostics
  4. Check the checkbox under the "Arduino › Language: Real Time Diagnostics" setting.
  5. Close the Preferences tab by clicking its X icon.

It is important to understand the reason why it was decided to have this setting off by default. Library discovery is a convenient feature of the Arduino build system. It allows you to use any library in your sketch simply by adding an #include directive for a header file. In order to accomplish that, the Arduino IDE must search through all the library locations.

Previously, Arduino IDE 2.x triggered the library discovery process on every change to the sketch code. In order to reduce the resource usage, the IDE has now been changed to use only the following events as library discovery triggers (#1107):

  • Opening a sketch.
  • Changing the board selection.
  • Compiling the sketch

For this reason, the language server features will not work for sketch code that uses a library during the interval between when its #include directive was added to the sketch and when the library discovery is next triggered.

The deferred library discovery technique described above results in spurious problem detection for uses of the library in the sketch code before a discovery process is triggered.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2022
@per1234 per1234 self-assigned this Nov 27, 2022
@per1234 per1234 added conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself labels Nov 27, 2022
@JulienLecoq
Copy link
Author

Oh okay, thanks for your very detailed response @per1234 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants