Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation level of else:-type lines is not reduced #771

Closed
nathdwek opened this issue Feb 13, 2018 · 6 comments
Closed

Indentation level of else:-type lines is not reduced #771

nathdwek opened this issue Feb 13, 2018 · 6 comments
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug windows

Comments

@nathdwek
Copy link

Environment data

VS Code version:

1.20.0
c63189deaa8e620f650cc28792b8f5f3363f2c5b
x64

Python Extension version: 2018.1.0
Python Version: 3.6.3
OS and version: Ubuntu 2017.10 AMD64

Actual behavior

After typing enter at the end of a line such as else:, elif cond:, except:, finally:, the indentation level of that line is unchanged and the next line is auto-indented to the wrong level as well:

if cond:
    do_stuff()
    else:|

after typing enter, becomes

if cond:
    do_stuff()
    else:
        |

Expected behavior

if cond:
    do_stuff()
    else:|

after typing enter (or : on atom if I remember correctly), should become

if cond:
    do_stuff()
else:
    |

Steps to reproduce:

  • Use a construct as if-elif-else, try-except-else-finally.

Is this normal? I expect that this is a problem with my setup and not this extension given the simplicity of the issue, but my install is as standard as can be...

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug awaiting 2-PR area-formatting labels Feb 15, 2018
@MikhailArkhipov MikhailArkhipov removed the bug Issue identified by VS Code Team member as probable bug label Feb 20, 2018
@MikhailArkhipov
Copy link

The caret is placed correctly, one level less than else:. Moving else requires AST/autoformatting infrastructure.

@MikhailArkhipov MikhailArkhipov added the feature-request Request for new features or functionality label Feb 20, 2018
@MikhailArkhipov MikhailArkhipov self-assigned this Feb 20, 2018
@nathdwek
Copy link
Author

OK, good to know this is currently expected behaviour.
Thank you for trying to tackle this!

@AlexChapple
Copy link

AlexChapple commented Jul 8, 2018

Is there an update on this?

@brettcannon
Copy link
Member

[ @redoctopus0 I edited your ✉️ ⬆️ to come off as more 😃 and less 😠 ]

Fixing this requires #1847 which is not a minor undertaking. So we expect to get to it eventually, but it might be a little while.

@brettcannon
Copy link
Member

Was supposed to be fixed by #2724 .

@brettcannon brettcannon added windows bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Oct 17, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 14, 2018
@luabud
Copy link
Member

luabud commented Mar 15, 2019

tracked by #481

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug windows
Projects
None yet
Development

No branches or pull requests

6 participants