vscode-as3mxml
vscode-as3mxml copied to clipboard
Update package names and imports on folder rename or move
Hi, today, we have to update all imports of affected files manually after renaming or moving a folder. (Or do I miss something?) It would be very helpful if VSCode would do that automatically ;-)
There were already filed a couple of issues regarding this feature, maybe this helps [1].
Thanks, Olaf
[1] https://github.com/Microsoft/vscode/issues/53233
This is definitely a feature that I'd like to add.
It looks like they're using some "proposed" APIs (in other words, the APIs are considered beta-quality) for detecting folder renames for TypeScript/JavaScript imports.
https://code.visualstudio.com/updates/v1_25#_local-rename-events
Listening for renames seems to work like this:
//listen
var subscription = vscode.workspace.onDidRenameFile((event) =>
{
//event.oldUri
//event.newUri
});
//stop listening
subscription.dispose();
Right now, there is no API available in the language server protocol. I would need to listen in the VSCode extension, and then I could register a custom command in the language server that VSCode can call.
I will wait until the API moves from "proposed" to stable, though.
Yup, I come from FlashDevelop and was expecting all the references to change with class file rename. I hope it gets added soon because having to navigate .as file by .as file and changing all references is time consuming and a pain in the trace( ["a", "r", "s", "e"].join("") ).
Thank you!
@angelhdz If you're only renaming a single class, you should be able to use Rename Symbol instead of renaming the file in the file explorer, and it will also change all references. You can find Rename Symbol when you right click in the editor.
What about this feature? It's would be really helpful