Skip to content

Automatic indentation inside brackets #701

Closed

Description

@seekiu

Environment data

VS Code version: 1.19.3
Python Extension version: 2018.1.0
Python Version: 3.6.3
OS and version: Windows 10 1709

Actual behavior

When adding new line within brackets, the indentation does not conform to PEP8 format. E.g.

some_list = [item1,<press enter here>
<cursor gets to here>

Expected behavior

some_list = [item1,<press enter here>
             <cursor expected to be here>

I'm not sure if this is a python extension related issue or maybe VS code issue. I'm also using Vim, which has an extension specifically for this: https://github.com/Vimjas/vim-python-pep8-indent. It would be nice if this feature can be added to the extension. Thanks.

Activity

  1. DonJayamanne commented on Feb 3, 2018

    @DonJayamanne

    Similar to #481
    Though that is specific to indenting of function arguments

    Mikhail Arkhipov (@MikhailArkhipov) cc

  2. seekiu commented on Feb 5, 2018

    @seekiu
    Author

    This is indeed similar to #481. But there are also some python-specific conventions of indentation that are not usually found in other languages such as C/C++. So I think it is reasonable to consider incorporating this functionality into the python extension.

    Ideally, the final result should be just like what https://github.com/Vimjas/vim-python-pep8-indent has done. And to be honest, this is one of the main reasons I sometimes still switch back to Vim, despite the great environment VS code and this extension has already provided.

  3. removed this from the June 2018 milestone on Jun 4, 2018
  4. krisjobs commented on Jun 7, 2018

    @krisjobs

    So, was this moved to the June18 milestone?

  5. brettcannon commented on Jun 7, 2018

    @brettcannon
    Member

    Kris Jobs (@krisjobs) no as the June milestone is specifically bug fixes only as we're trying to free up time for the experimental debugger. Once that's work is done we will come back to enhancements and working on automatic indentation, I suspect, will be high on our list.

  6. kbrose commented on Jan 5, 2019

    @kbrose

    Hello, I'm wondering if it would be possible to get a status update on this issue? I see a little bit of action in the related #481.

  7. DonJayamanne commented on Jan 5, 2019

    @DonJayamanne

    Duplicate of #481

  8. ghost removed on Jan 5, 2019
  9. kbrose commented on Jan 8, 2019

    @kbrose

    Don Jayamanne (@DonJayamanne) It is a duplicate as long as you pay attention to the note #481 (comment) that #481 should be more general than just function arguments, it applies to any sort of bracket pair. The issues as written in the OPs are not duplicates IMO.

  10. locked as resolved and limited conversation to collaborators on Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions