I was quite disappointed to discover that functions calls were not highlighted using Pygments.
See it online (I tested it with all available styles)
Builtin functions are highlighted but not mine.
I looked at the tokens list but there is no reference to "function call" or "object attribute" for example.
I have considered extending the lexer by adding a regex rule like \w+\(.*?\)
. But I am afraid to multiply the errors because of edge cases I did not think of.
Do you know why this feature is not implemented directly inside Pygments?
If you have a specific list of functions you want highlighted, you can add a custom highlighter like the builtin
NumPyLexer
: