Here a bracket is missing, but ide does not show the red wavy line,How to enable syntax checking?
Hi @qaz17229796. This can be enabled in the Arduino IDE advanced settings. I'll provide instructions:
- Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
A menu will appear on the editor toolbar:
- Select the "Preferences: Open Settings (UI)" command from the menu.
ⓘ You can scroll down through the list of commands to find it or type the name in the field.
A "Preferences" tab will open in the Arduino IDE main panel. - Type
arduino.language.realTimeDiagnostics
in the "Search Settings" field of the "Preferences" tab. - Check the box under the "Arduino › Language: Real Time Diagnostics" setting.
- Close the Preferences tab by clicking its X icon.
The reason this setting is disabled by default is because it is prone to false positives. An experienced user should be able to interpret the results to differentiate a false positive from a real problem in the sketch, but during the beta phase of the IDE development we found that these false positives caused a bad experience for beginners, who assume every red squiggle is a real problem in their code and get sidetracked by following these "red herrings".
The primary cause of false positives is that the "context-aware" features (e.g., autocomplete, "IntelliSense", suggestions, "Go to Definition") only work for objects from a library after one of these events occurs following the time of the addition of the #include
directive for a library's header file in a sketch:
- The sketch is opened in Arduino IDE
- A different board is selected in the Arduino IDE menus
- The sketch is compiled
The reason for the deferred awareness of objects from libraries compared to the awareness of other objects in the sketch (which is updated after every edit to the code) is that the awareness of library objects is dependent on a process known as "library discovery", where Arduino IDE scans all installed libraries for a header files matching the #include
directives of the sketch program and picks which libraries to add to the compiler's "search path". That "library discovery" process is somewhat resource intensive. The overhead of that resource usage is insignificant when it is done as part of the occasional manually triggered compile operation, but more significant when it comes to the continuous processing that is done to support the "context-aware" features. The developers decided to change to this "deferred discovery" approach for the "context-aware" feature support in response to user complaints that the previous approach was too heavy for lower spec PCs.
So this means you will see the squiggles on all references to objects from a library during that period before a library discovery is triggered.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.