Parenthesis wrapping after `raise` is wrong
See original GitHub issueEnvironment data
- VS Code version: 1.43.0
- Extension version (available under the Extensions sidebar): 2020.2.64397
- OS and version: Ubuntu Linux 16.04 LTS
- Python version: Python 3
- Type of virtual environment used: n/a
- Jedi or Language Server?: jedi
- Value of the
python.languageServer
setting: Microsoft
Expected behaviour
Given code like this:
if False:
raise Thing(|)
Then pressing return with the cursor between the parentheses should wrap the code as so:
if False:
raise Thing(
|
)
This is what you get if either there isn’t a raise
keyword present or if it is return
instead
Actual behaviour
Given code like this:
if False:
raise Thing(|)
Then pressing return with the cursor between the parentheses actually wraps to:
if False:
raise Thing(
|)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Why wrap Arrow function body in parentheses - Stack Overflow
Without parenthesis, the object declaration brackets {} are considered as the arrow function body which will lead a logic error. @Rajesh that ...
Read more >Why are there parentheses wrapping the brackets? - Reddit
The problem with returning objects that way is that the brackets are treated as the opening and closing brackets of a function.
Read more >Resolving that final pesky wrapped stitch! - YouTube
In this knitting tutorial I demonstrate how to resolve a stitch that was wrapped on the wrong side for a short row, while...
Read more >PEP 8 – Style Guide for Python Code
Continuation lines should align wrapped elements either vertically using ... Between a trailing comma and a following close parenthesis:.
Read more >Finish Strong: 5 Mistakes To Avoid As You're Wrapping Up ...
As you near the end of the year, chances are you're clearing the decks and preparing for some much-needed time off. But as...
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 FreeTop 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
Top GitHub Comments
@PeterJCLaw I talked to the team and everyone was ok with a PR for the change for raise 😊
@luabud thanks! I’ve raised https://github.com/microsoft/vscode-python/pull/15516, which I’ve manually checked has the expected behaviour. I’ve gone with keeping this really simple for now (i.e: not attempt to handle
raise Foo()|
specially), but I’m happy to explore that if you feel it’s needed.