Typescript: Refactor move file

Created on 14 Jan 2016  ·  27Comments  ·  Source: microsoft/TypeScript

_From @tamascsaba on December 7, 2015 15:15_

I want to move file to another location but there is no way :(
like: https://www.jetbrains.com/idea/help/move-refactorings.html

_Copied from original issue: Microsoft/TypeScript-Sublime-Plugin#416_

API Refactorings Fixed Needs Proposal Suggestion

Most helpful comment

I have been using this Move TS extension with good results.

All 27 comments

_From @tamascsaba on January 8, 2016 9:8_

???

What's going on here?

API support for a new LS operation to move a file. the new operation would result in , similar to rename, a set of changes to be applied to the project.

for instance, if you more a module, all imports will be adjusted to reflect the new name/path. similarly /// references would be rewritten as well. possiblly tsconfig.json references.

+1

A better explanation can be found in https://github.com/Microsoft/TypeScript/issues/10218#issue-170099571

:+1:

👍

+1

+1

I think this is a MUST. Very useful.

Do you guys have any updates about this issue? It is not in the Roadmap.

The reason i code with webstorm open, side by side with vscode, to rename/move files/folders and update all imports automatically.
+10

Aggregate 👍 on the OP 😀

@aluanhaddad, no, it's good that he posted this. He provided valuable information that Webstorm has an implementation of this.

This would be very valuable and actually, must. When this can be expected?

Another feature, not sure mentioned anywhere or not, is ability to move TS export (interface/function/const../whatever) into another file, so that it would find all the import references in other files and changed them to a new location. Also, would add import in the original file if moved object was used there.

+1

I have been using this Move TS extension with good results.

Would the changes be on vscode or typescript api providing vscode that ability to rename/move files?

A definite must. If you don't plan a months-ahead architecture for any big project you get in, the final structure will either be a complete mess or organized at the cost of many head-scratching hours.

@orgito damn that plugin should have been built into vscode itself! a real gem

Agreed that this is vital. Without that plugin it would have pushed me over the edge to Webstorm. The only weakness with the plugin is that it saves automatically; to be compatible with "rename symbol" in VSCode it should make the changes in all dependent files but not save them.

Any news here?

No news?

+1

Hi @misantronic, @sergeu90, @Tinee and @baszalmstra

Have you ever seen that you could use emoji reaction instead of posting +1?

Every time we post comments on GitHub, all the subscribers of the topic receive notifications and some users, receive emails too. It's kind of frustrated reading an email written: +1

The community appreciates if we all start using the reactions instead:
github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments

I apologise for any offence it may cause and for the others getting this notification.

So, is this not gonna be implemented?

Should be covered by:

  1. New rename command: https://github.com/Microsoft/TypeScript/pull/23573
    Triggered by IDE to update the project after a file rename event
  2. Refactor - Move to a new file: https://github.com/Microsoft/TypeScript/pull/23726
    Triggered manually by selecting a declaration(s) and moving them to a new file
Was this page helpful?
0 / 5 - 0 ratings