I would like to know how to enable the highlighting of function call in VS Code with python. See the following example where function call is blank, as other part of the code:

See the theming docs and the Developer: Inspect Editor Tokens and Scopes command in the command palette. Ex.
Semantic highlighting customization route (requires a language extension that provides semantic highlighting support for Python) (highlights both function definitions and calls):
"editor.semanticTokenColorCustomizations": {
"[Theme Name Goes Here]": { // remove this wrapper to apply to all themes
"rules": {
"function:python": { // remove ":python" to apply to all languages
"foreground": "#FF0000", // TODO
// "fontStyle": "" // optional
}
}
}
}
^the :python part will make the colour customization only apply to functions for the Python language.
If you want the call for function declarations to be different, then write another similar rule, but use the declaration modifier. Ex. function.declaration:python.
Token colour customization route (works without any extensions, since VS Code bundles TextMate grammar support for Python) (may require disabling extensions that provide semantic highlighting support for Python):
"editor.tokenColorCustomizations": {
"[Theme Name Goes Here]": { // remove this wrapper to apply to all themes
"textMateRules": [
{
"scope": "meta.function-call.python",
"settings": {
"foreground": "#FF0000", // TODO
// "fontStyle": "" // optional
}
}
]
}
},
See also the scopes support.function.builtin.python, meta.function-call.generic.python, and meta.member.access.python, meta.function-call.python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With