vsc-python-indent icon indicating copy to clipboard operation
vsc-python-indent copied to clipboard

Feature Request: option to dedent the ending bracket when splitting a function call/dict/etc. across multiple lines

Open coredumperror opened this issue 8 months ago • 3 comments

What the code looks like before pressing enter:

print(
    "Hello world!"|)
{
    "foo": "bar"|}

What I want the code to look like after pressing enter:

 print(
     "Hello world!"
|)
 {
     "foo": "bar"
|}

What the code actually looks like after pressing enter:

print(
    "Hello world!"
   |)
{
    "foo": "bar"
   |}

I would love to have an option in the settings to enable this behavior.

coredumperror avatar Apr 29 '25 18:04 coredumperror

this is what VSCode TypeScript uses https://github.com/microsoft/vscode/blob/42ec991f0de1d447693654cf2a77b20f3e7aa616/extensions/typescript-basics/language-configuration.json#L130-L144

https://www.reddit.com/r/vscode/comments/1ka6nd0/how_do_you_make_vs_code_deindent_python_ending/

RedCMD avatar Apr 29 '25 22:04 RedCMD

Thanks for the ticket. I'd review a PR that adds this functionality. Not sure when I'll get around to it otherwise.

kbrose avatar Apr 30 '25 04:04 kbrose

What code would one have to edit to add this function? I'd be happy to make a PR, but I just don't even know where to start.

coredumperror avatar Apr 30 '25 18:04 coredumperror