Skip to content

Provide rename location for extractMethod in presence of writes #18048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Aug 25, 2017 · 1 comment · Fixed by #18050
Closed

Provide rename location for extractMethod in presence of writes #18048

ghost opened this issue Aug 25, 2017 · 1 comment · Fixed by #18050
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Aug 25, 2017

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.

@ghost ghost self-assigned this Aug 25, 2017
@mhegazy mhegazy added the Bug A bug in TypeScript label Aug 28, 2017
@mhegazy mhegazy added this to the TypeScript 2.5.3 milestone Aug 28, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 28, 2017

in the light of the offline discussion we had, i do not think we need this. will leave it open for now. please close it when we have the final implementation for rename locations.

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Sep 8, 2017
@mhegazy mhegazy closed this as completed Sep 9, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant