Skip to content

More gracefully handle the fact that Black does not support "Format Selection" #176

@egabrum

Description

@egabrum

Environment data

  • VS Code version: 1.23.1
  • Extension version (available under the Extensions sidebar): 2018.5.0
  • OS and version: Windows 10 x64
  • Python version (& distribution if applicable, e.g. Anaconda): python 3.6.3 x64
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): n/a
  • Relevant/affected Python packages and their versions: black 18.6b1

Actual behavior

Every single time a paste a piece of code, I get the error message:
"Black does not support the "Format Selection" command"

Expected behavior

No error message pop-ups.

    "editor.formatOnPaste": true,
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "editor.tabSize": 3,
    "python.formatting.autopep8Args": [
        "--indent_size=3"
    ],
    //"python.formatting.blackArgs": [
    //    "--indent_size=3"
    //],
    "python.formatting.provider": "black",
    "python.linting.pep8Enabled": false,
    "python.linting.pep8Args": [
        "--ignore=E111,E114,E121,E126,E127,E128,E265,E231,E303,E501,W291,W293,W503",
        "--max-line-length=89"
    ],
    //"python.linting.pylintArgs" If you don't use the pylintrc config file:
    //"python.linting.pylintArgs": ["--disable=C0303,W0311,E1101"],
    "python.linting.pylintEnabled": true,
    "python.linting.pydocstyleEnabled": false,

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions