Darcula Theme from PyCharm for VS Code
Fork of Darcula PyCharm Theme with several fixes and support for semantic highlighting, including Python 3.10 Structural Pattern Matching (match:
case:
syntax), docstring highlighting and more.
Semantic Highlighting
From Semantic Highlighting Overview
Semantic highlighting enriches the syntax coloring based on symbol information from a language service that has the full understanding of the project.
Enabling semantic highlighting
Press ⌘
⇧
P
Search settings.json & Open
Paste the following
"editor.semanticTokenColorCustomizations.enabled": true,
Semantic Highlight Guide
Linting highlighting
To better match PyCharm highlighting, put this in settings.json:
"python.analysis.diagnosticSeverityOverrides": {
"reportUndefinedVariable": "error",
"reportImportCycles": "error",
"reportMissingImports": "error",
"reportMissingModuleSource": "error",
},
"python.linting.flake8CategorySeverity.F": "Warning",
"python.linting.flake8CategorySeverity.E": "Information",
"python.linting.flake8CategorySeverity.W": "Information",
"python.linting.mypyCategorySeverity.note": "Information",
"python.linting.mypyCategorySeverity.error": "Information",
"python.linting.pycodestyleCategorySeverity.E": "Information",
Then adjust to your liking.
Colours match with PyCharm according to scheme:
PyCharm |
VSCode |
Error |
Error |
Warning |
Warning |
Weak Warning |
Information |
Template Support
Use one of these plugins:
Fils Status Colors
Until https://github.com/microsoft/vscode/issues/119023 is resolved, I'd recommend to add this to settings.json
"problems.decorations.enabled": false,
Otherwise, VSCode will override file color with red if it has any problems. In the meanwhile, you can use Problems panel instead.
Syntax Customization
To change the base text color, use a snippet like this in your settings.json
"editor.tokenColorCustomizations": {
"[PyCharm Darcula Theme]": { // Targets dark GUI
"textMateRules": [
{
"name": "Foreground base syntax",
"scope": [
"text", // For markup, config, etc.
"source", // For code
],
"settings": {
"foreground": "#FF0000" // Bright red
},
},
]
},
},
Known issues and inconsistencies
Limitations of current syntax scopes in VSCode
self
and cls
parameters highlighted as any function arguments in any positions
mcs
is not highlighted
self
and cls
are highlighted even when overwritten
- in comments containing codetags (
# TODO ...
) only codetags themselves are highlighted, as opposed to PyCharm where the whole line is highlighted
- methods decorated with
@property
highlighted as properties instead of functions (which might be considered improvement)
- in typehints enclosed in string literal, only resolved names are highlighted, as source, as opposed to PyCharm, where everything, including string literals highlighted as source
__class__
attribute highlighted as magic, as opposed to PyCharm when it highlighted as source (though I have no idea why pycharm does so in the first place)
Bugs