Open
Description
Describe the problem
The IDE uses a standard C++ syntax highlighting system. The result is that some keywords/types/CONSTANTS that are specific to the Arduino programming language do not get syntax highlighting in the Arduino IDE editor.
Examples include:
byte
OUTPUT
INPUT
INPUT_PULLUP
LOW
HIGH
To Reproduce
Steps to reproduce the behavior:
- Create a Sketch
- Replace its content with the following
byte myNumber = 0; void setup() { pinMode(LED_BUILTIN, OUTPUT); pinMode(3, INPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500); }
Expected behavior
Syntax highlighting is provided for all keywords of the Arduino programming language.
Arduino IDE version
2.0.0-beta.7
Operating system
All
Additional context
Note that highlighting for many of the Arduino language keywords are already provided by the C++ highlighter. No special treatment for those keywords is necessary.
Also reported at:
- Add syntax highlighting of constants/macros #1785
- some functions and constants doesn't colored like Arduino IDE 1.x #1485
- Byte type is not blue #890
- 'byte' not marked #108
- https://forum.arduino.cc/t/pinmode-output-input-and-input-pullup-do-not-change-color/861049/1
- https://forum.arduino.cc/t/pinmode-output-input-and-input-pullup-do-not-change-color/861049/3
- https://forum.arduino.cc/t/pinmode-output-input-and-input-pullup-do-not-change-color/861049/11
- https://forum.arduino.cc/t/code-colouring-boolean-vs-char/1033122
- https://forum.arduino.cc/t/arduino-ide-2-0-editor-text-color-mismatch-on-keyword-byte/1033975
- https://forum.arduino.cc/t/disimproved-editor-2-x/1049962
- https://forum.arduino.cc/t/ide-v2-0-2-program-interface-functions/1055809/3
- https://forum.arduino.cc/t/ide-2-1-1-colores-de-palabras-reservadas/1150024
- https://forum.arduino.cc/t/arduino-ide-2-2-1-vs-ide-1-8-13/1189218/5
- https://forum.arduino.cc/t/kodning-i-sketch/1212686
- https://forum.arduino.cc/t/pinmode-not-working/1244177
- https://forum.arduino.cc/t/arduino-ide-2-3-4-highlighting-keywords/1349225
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