Ardunio IDE and orange colour of class methods or properties

Status
Not open for further replies.

TelephoneBill

Well-known member
I have been digging into the class methods and properties of "SdFile" within Bill Greiman's SdFat library.

The Arduino IDE appears to recognize some methods/properties as "keywords" and colours them orange to indicate that they have been acknowledged. But some it does not.

For example, if I define "SdFile myFile;" and then I type the line "myFile.rewind();" it gets the "rewind" wording coloured orange. But if I type the line "myFile.seekSet(13);" then although this works perfectly well, the "seekSet" part does not change to orange colour.

Is this telling me that the orange words are also part of Arduino standard, and that the SdFat library is overriding that definition - in which case the ones not coloured orange are new class definitions that are not Arduino standard?

I'm curious to find out because I often rely on the orange to tell me that I'm entering correct code.
 
Each library has a keywords.txt file which tells Arduino which words to color. It's a very simple approach without any sophisticated awareness of the language. If the library author forgets to update keyword.txt (which I've personally done many times) Arduino doesn't turns the keywords orange or blue as it should.

The keywords.txt file format is also sensitive to white space. It expects a single character between fields. If the keywords.txt file is edited to have multiple spaces so things line up nicely, or if tabs are turned into spaces, it breaks. This is one of the many ways the Arduino IDE could be so much better, but isn't.
 
Status
Not open for further replies.
Back
Top