Skip to content

Semantic & Linting Highlighting, Templates & RegEx support and more.

License

Notifications You must be signed in to change notification settings

Bobronium/vscode-pycharm-darcula-theme

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Darcula Theme from PyCharm for VS Code

Visual Studio Marketplace Downloads GitHub Repo stars

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

  1. Press P

  2. Search settings.json & Open

  3. 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 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.

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

  • __magic_methods__ decorated with functools.lru_cache (potentially some other decorators as well) are highlighted as functions microsoft/pylance-release#2816

About

Semantic & Linting Highlighting, Templates & RegEx support and more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published