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 highlights in ¿purple? the packages imported, and lightblue for classes while VS code just don't.

-
You can take a look at color schemes.willeM_ Van Onsem– willeM_ Van Onsem2017-07-24 23:57:31 +00:00Commented Jul 24, 2017 at 23:57
-
1thanks @WillemVanOnsem, but I don't think those support python or even vs code.alete– alete2017-07-25 01:02:08 +00:00Commented Jul 25, 2017 at 1:02
8 Answers
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.
3 Comments
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:
5 Comments
new SomeClass() with a different color. I agree with you on the unbelievableness of this missing feature. Thanks!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:
1 Comment
Try MagicPython systax highlighter from extensions.
1 Comment
I was facing the same issue. I used the Chromodynamics theme which is compatible with MagicPython. You can find it here or install directly in the VS-CODE
Comments
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",
}


