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/rename file as a command #66233

Closed
OliverJAsh opened this issue Jan 8, 2019 · 10 comments
Closed

Move/rename file as a command #66233

OliverJAsh opened this issue Jan 8, 2019 · 10 comments
Labels
*extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality
Milestone

Comments

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Jan 8, 2019

I like to use files using the VS Code file explorer, as this is the only way to move/rename a file and then have TypeScript prompt you if you would like to update imports.

However, in a large project, it gets extremely difficult to move files using drag and drop. Folders tend to get very large, with multiple levels of nesting.

Is there an alternative way to move a file? Perhaps this could be done as a command? I'm aware some extensions provide this, however they use the file system directly, which means TypeScript won't prompt to update imports for the moved/renamed file.

@isidorn isidorn assigned mjbvz and unassigned isidorn Jan 9, 2019
@isidorn
Copy link
Contributor

isidorn commented Jan 9, 2019

Sounds like a feature request against typescript moving to @mjbvz

@mjbvz
Copy link
Collaborator

mjbvz commented Jan 9, 2019

@isidorn I don't think this request TS specific. TypeScript handles any file move events, so what @OliverJAsh is asking for is a nicer UI to move the file in the first place.

Such a move file UI would also be useful even without TS's support for updating imports

@mjbvz mjbvz assigned isidorn and unassigned mjbvz Jan 9, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 9, 2019

Also, if we had API that allowed extensions to perform file moves within VS Code, a "file move" UI could be implemented entirely by an extension. Somewhat related to #48034 but for moves

@isidorn isidorn added the feature-request Request for new features or functionality label Jan 10, 2019
@isidorn isidorn added this to the Backlog milestone Jan 10, 2019
@isidorn isidorn removed their assignment Jan 10, 2019
@gdh1995
Copy link

gdh1995 commented Jan 24, 2019

I also want a command to rename current edited file by Ctrl+P - it's annoying that currently I have to move mouse to the left file explorer, find the file, click it and then press F2.

@OliverJAsh
Copy link
Contributor Author

The new version adds support for "Cut" to the context menu, which is a big help: https://code.visualstudio.com/updates/v1_31#_cut-command-in-explorer-context-menu.

@jrieken jrieken added the *extension-candidate Issue identified as good extension implementation label Oct 8, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 8, 2019

We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Oct 8, 2019
@jrieken
Copy link
Member

jrieken commented Oct 8, 2019

We have an improved version of the WorkspaceEdit-API which does allow to rename files.

@amiceli
Copy link

amiceli commented Oct 11, 2019

To rename a file I use that extension : https://github.com/sleistner/vscode-fileutils
It can be useful.

@OliverJAsh
Copy link
Contributor Author

Does that trigger TS's "update imports"?

@amiceli
Copy link

amiceli commented Oct 15, 2019

I try with es6 imports, no, it just rename file.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants