Hi @cinerobert. As you probably guessed already, the information you found was all written for Arduino IDE 1.x. Arduino IDE 2.x has a completely different keyword highlighting system and doesn't support custom keyword definitions via the keywords.txt
file as Arduino IDE 1.x did.
Arduino IDE 2.x uses a high quality C++ syntax highlighting system (the same one as is built-in to the VS Code editor). This system automatically processes your sketch code and highlights it according to the C++ language structure. So it does a pretty good job of understanding and highlighting the code in general, but it doesn't have any mechanism for defining custom keywords to be highlighted in some special way.
Although the custom keyword system of Arduino IDE 1.x might seem like a useful feature at a glance, in practice I'm not sure it was in the end.
One problem is that the library authors are very inconsistent in defining keywords. Some library authors defined keywords comprehensively and correctly. Other library authors defined some keywords, but forgot to keep the keywords.txt
file updated as new API elements were added to the library. Some library authors made an attempt to define the keywords, but didn't format the keywords.txt
file correctly, so the IDE didn't recognize them. Some library authors didn't bother with keywords at all.
Another problem was that Arduino IDE 1.x's handling of these keywords is very crude. All keywords of all installed libraries were highlighted, regardless of whether the library was used in the sketch or if the specific occurrence of the keyword was actually a refence to the library code.
So between these two things, once you had a decent collection of libraries installed you would find the highlighting of your code was very patchy, with missing highlighting in some places and unexpected highlighting in other places.
I think the whole manual keywords definition system was created at a time when the IDE was not sophisticated enough to understand the code at all, meaning that automated syntax highlighting was not possible.