It's not in the
.cwl file for some reason, you're gonna have to add it in manually. (I think(!) that's the only alternative. I'm happy to be proven wrong..)
Autocompletion and recognition of commands by TeXstudio is controlled by the
.cwl file, which can be found in your local directory. For Windows, it's in:
.cwl file autogenerated by TeXstudio looks like this:
The commands in the
.cwl file are in the format:
<command>[#classification], so note that there are no
\chemfig etc. commands in here, so that's why they are unrecognized.
Also note that the classification are
#S which means that they will not appear in the autocompleter tab when typing the command in TeXstudio.
Like I said in the short answer, you're probably gonna have to add the commands in manually if you don't want to see the 'warnings' by TeXstudio about unrecognised commands.
See my other answer here to find out how. But I have here something you can copy-paste for a quick fix. You just need to add this into your
chemfig.cwl file and restart your TeXstudio to see its effect. You will need to activate
chemfig.cwl in the
options -> completion tab from within TeXstudio as well.
Note: I chose to use
#n classification here so you will see it in the autocompleter.
Proof that it works:
Of course, there is always the less desirable, but still effective solution of just plain ignoring it.
You can simply turn off syntax highlighting for a wrong/unrecognized command by TeXstudio, by right-clicking on the background colour box to reset it to 'no colour'.