More gracefully handle the fact that Black does not support "Format Selection"
See original GitHub issueEnvironment 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,
Issue Analytics
- State:
- Created 5 years ago
- Reactions:52
- Comments:43 (16 by maintainers)
Top Results From Across the Web
Black does not support "Format Selection" command
In my situation (select black as the Python Formatting Provider in VS Code Settings), I encountered this warning everytime when I pasting ...
Read more >MapSource Updates & Downloads - Garmin
Fixed selection issue (waypoints were not de-selected when selecting a track before). Fixed an issue where MapSource did not remember the grid setting ......
Read more >IO tools (text, CSV, HDF5, …) - Pandas - PyData |
Some formats which encode all characters as multiple bytes, like UTF-16, won't parse correctly at all without specifying the encoding. Full list of...
Read more >Changelog - Cypress Documentation
Fixed a regression introduced in the Electron browser in Cypress 10.8.0 where the CYPRESS_EVERY_NTH_FRAME environment variable was not being set ...
Read more >RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)
RFC 7540 HTTP/2 May 2015 A server that does not support HTTP/2 can respond ... The "h2c" protocol identifier MUST NOT be sent...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I should also mention that to turn off any feature in VS Code just for Python, you can do:
@brettcannon Thanks for your answer but, please note that my original issue was not what this ticket has become now. I can see why Black does not want to do partial formatting. It would be nice if it allowed the option, but I can live with it.
My issue is with the Python Extension popping up an error window every single time I do a paste.
Also, the issue ticket is currently closed, so the re-orientation won’t lead to anything. Maybe either one of us should open a new ticket to address our respective problem.