Skip to content

Incorrect indentation on new line after return statement #25582

Closed
@minestarks

Description

@minestarks

TypeScript Version: 2.7+ (first commit: d49491b)

VS Code does not repro. Try Visual Studio 2017 or run my fourslash test from below

Search Terms: smart indent

Code

function foo() {
    return; // hit enter here
    // new line is indented correctly

    if (true) {
        return; // hit enter here
    // new line is NOT indented correctly
    }
}

Expected behavior:
Line is indented 8 characters after the return statement within the if statement

Actual behavior:
Line is only indented 4 characters

Test:

git pull https://github.com/minestarks/TypeScript.git smartindentbug
jake test test=smartIndentReturn lint=false

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions