Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refactored code that uses ASI is borked #37813

Copy link
Copy link
@DanielRosenwasser

Description

@DanielRosenwasser
Issue body actions

Found from #37814.

function foo() {
    [|var x: number

    x = 10;
    return x;|]
}

Extract [| this range |] to a function in the global scope.

Expected:

function foo() {
    return yadda();
}

function yadda() {
    var x: number;
    
    x = 10;
    return x;
}

or

function foo() {
    return yadda();
}

function yadda() {
    var x: number
    
    x = 10;
    return x;
}

Actual:

function foo() {
    return yadda();
}

function yadda() {
    var x: number

        ;

    x = 10;
    return x;
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFix AvailableA PR has been opened for this issueA PR has been opened for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.