Skip to content

No indentation after PEP 484 type hint for function def #1587

Closed
@willfrey

Description

@willfrey

Issue Type: Bug

Declaring a function with a PEP 484 style type hint results in the newline not being properly indented.

For example, if I type

def function() -> None:

I would expect that after pressing the return key to insert a newline, I would end up

def function() -> None:
    # here

however, I'm finding that I end up

def function() -> None:
# here

which is undesirable.

Indentation appears to be working just fine when I do not use PEP 484 type hints.

Extension version: 2018.4.0
VS Code version: Code 1.22.2 (3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9, 2018-04-12T16:32:53.389Z)
OS version: Darwin x64 17.4.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
Load (avg) 1, 2, 2
Memory (System) 16.00GB (6.31GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron .
Screen Reader no
VM 0%

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-formattingbugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions