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
- Linting highlighting
- Optimized for Python + support for many popular languages
- Support for MagicPython RegEx highlighting (install separately)
- Support for Python Sphinx Highlighter (install separately)
- Jinja & Django Template support (See Template Support)
- Overridable base highlight (See Customization)
- File status colors
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.
-
Press
⌘
⇧
P
-
Search settings.json & Open
-
Paste the following
"editor.semanticTokenColorCustomizations.enabled": true,
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 |
Use one of these plugins:
Until microsoft/vscode#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.
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
},
},
]
},
},
self
andcls
parameters highlighted as any function arguments in any positionsmcs
is not highlightedself
andcls
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)
__magic_methods__
decorated withfunctools.lru_cache
(potentially some other decorators as well) are highlighted as functions microsoft/pylance-release#2816