DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
http://docs.basedpyright.com/
Other
601 stars 12 forks source link

feature request: auto-indent after items inside brackets #435

Open beauxq opened 1 week ago

beauxq commented 1 week ago

This is a feature that both Pycharm and Pylance have, but it is missing from basedpyright in vscodium.

The editor can help follow PEP8 indentation standards when pressing enter inside brackets - () [] {}


(| represents the cursor)

def foo(a, b,|)

If I press enter from this cursor position, this should be the new state after pressing enter:

def foo(a, b,
        |)

current behavior:

def foo(a, b,
|)

The following scenario is currently working correctly. I'm just mentioning it to make sure it doesn't break when someone implements this. (a recommended regression test)

def foo(a, b, {|})

goes to:

def foo(a, b, {
    |
})

^ This behavior should not change. The difference is whether the line ends with an open bracket or not - ( [ { - The line def foo(a, b, does not end with an open bracket (but the line end is inside brackets).