It seems like VS Community with python tools has a better syntax highlighting than VS Code with \"Python\" by Don Jayamanne. As you can see in the picture attached, VS Community
Looks like this issue has been bouncing around between maintainers of VSCode, MagicPython, and the Python extension
A quick workaround is to simply override your color theme as instructed here. For example, if you are using Default Dark+
color theme, you can add this to settings.json
:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#DCDCAA"
}
}
]
},
Now callables are highlighted correctly as seen below:
Try MagicPython systax highlighter from extensions.
I've tried some workarounds, but the one that worked for me was installing: Python extension for Visual Studio Code
It comes with much more than you need, but solves the issue without patchwork.
VS Code About: Version: 1.52.1 (system setup)
settings.json
:
{
"window.zoomLevel": 0,
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"git.ignoreMissingGitWarning": true,
"workbench.colorTheme": "Default Dark+",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.languageServer": "Microsoft",
}
What did the trick for me, was to keep the Window: Auto Detect Color Scheme disabled. Attaching a picture of this checkbox in my answer:
I ran into the same issue and some VS Code themes are not supporting syntax highlighting atleast for me. I tried with Ruby and Python and the theme I was using was Dark(Visual Studio).
Changing to Dark+ (Default Dark) did the trick for me.
Goto Preferences -> Color Themes and choose Dark+(Default Dark) or something similar.
Hope it helps.
I had problems with syntax highlighting with python in vs code and the solution was that my file name did not end with ".py"