Skip to content

API to tell editor to trigger rename after applying refactoring #17852

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
mjbvz opened this issue Aug 17, 2017 · 5 comments · Fixed by #18050
Closed

API to tell editor to trigger rename after applying refactoring #17852

mjbvz opened this issue Aug 17, 2017 · 5 comments · Fixed by #18050
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Aug 17, 2017

Problem
Using the new extract method refactoring in TS 2.5, extracted methods currently are always named newFunction*. Renaming the extracted method requires a second step after the refactoring as been applied

A better flow would automatically trigger the rename on the new function after the refactoring has been applied.

Proposal
In the getEditsForRefactor response, return an additional field indicating that an editor should perform another action, such as rename, after the refactor has been applied.

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Aug 17, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 17, 2017

renameLocation is not sufficient?

@mjbvz
Copy link
Contributor Author

mjbvz commented Aug 17, 2017

Thanks! I overlooked this but will give it a try

@mjbvz mjbvz closed this as completed Aug 17, 2017
@mhegazy mhegazy added the Bug A bug in TypeScript label Aug 17, 2017
@mhegazy mhegazy added this to the TypeScript 2.5.1 milestone Aug 17, 2017
@mhegazy mhegazy reopened this Aug 17, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 17, 2017

Looks like the property is there, but extract method is not setting it correctly. we should just set it be the span of the new function name.

@mhegazy mhegazy assigned ghost and unassigned RyanCavanaugh Aug 24, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 24, 2017

@Andy-MS can you take a look for release-2.5

@mhegazy mhegazy added the Domain: Refactorings e.g. extract to constant or function, rename symbol label Aug 24, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 25, 2017

After looking at the implementation, this is gonna be harder than we originally thought, so we will try to get this done for 2.5.3 instead.

@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 Domain: Refactorings e.g. extract to constant or function, rename symbol Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants