Skip to content

Provide rename location for extractMethod in presence of writes #18048

@ghost

Description

TypeScript Version: master

Code

/// <reference path='fourslash.ts' />

////function foo() {
////    var i = 10;
////    /*a*/i++/*b*/;
////}

goTo.select("a", "b");
edit.applyRefactor({
    refactorName: "Extract Method",
    actionName: "scope_1",
    actionDescription: "Extract function into global scope",
    newContent:
`function foo() {
    var i = 10;
    i = /*RENAME*/newFunction(i);
}
function newFunction(i: number) {
    i++;
    return i;
}
`
});

Expected behavior:

Get rename location.

Actual behavior:

Get nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions