Skip to content
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

'Move to new file' refactoring for JavaScript and TypeScript #49866

Closed
mjbvz opened this issue May 15, 2018 · 4 comments
Closed

'Move to new file' refactoring for JavaScript and TypeScript #49866

mjbvz opened this issue May 15, 2018 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality javascript JavaScript support issues on-testplan typescript Typescript support issues
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented May 15, 2018

Add a new refactoring that extracts a class or function to a new file next to the current one. For example, for the simple project:

code.ts:

export class Foo { }
export class Bar { }

If the user highlightsBar, the extract to new file action would result in:

code.ts:

export class Foo { }

bar.ts:

export class Bar { }
@mjbvz mjbvz added this to the May 2018 milestone May 15, 2018
@mjbvz mjbvz self-assigned this May 15, 2018
@mjbvz mjbvz added feature-request Request for new features or functionality typescript Typescript support issues javascript JavaScript support issues labels May 15, 2018
mjbvz added a commit that referenced this issue May 15, 2018
@mjbvz mjbvz closed this as completed in 4c57171 May 16, 2018
@mohsen1
Copy link

mohsen1 commented May 25, 2018

Awesome! Love to see this happen in the next release!

Per my example in #50474 extracted class/function should be exported from the new file and get imported into the original file.

@kakty3
Copy link

kakty3 commented Jun 7, 2018

Why it is not working for .jsx files?

@osya
Copy link

osya commented Jun 8, 2018

@kakty3 , Confirm that Move to a new file refactoring not working for .jsx files. In opposite to PyCharm where it just works

@thomasjm
Copy link

Likewise for .tsx files, I press the button and nothing happens.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality javascript JavaScript support issues on-testplan typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

6 participants
@kakty3 @mohsen1 @osya @thomasjm @mjbvz and others