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

Rename file module: file move #240

Closed
1 task
basarat opened this issue Apr 8, 2015 · 4 comments
Closed
1 task

Rename file module: file move #240

basarat opened this issue Apr 8, 2015 · 4 comments
Assignees

Comments

@basarat
Copy link
Member

basarat commented Apr 8, 2015

  • rename file module (this is a big pain and the reason why we added ///ts:import transform in the first place)
@basarat basarat self-assigned this Apr 8, 2015
@ifeltsweet
Copy link

Completely agree. Is this in the plans?

@basarat
Copy link
Member Author

basarat commented May 3, 2015

Completely agree. Is this in the plans?

We already have the refactoring code working (

let relativePath = editor.getTextInRange(editor.bufferRangeForScopeAtCursor(matched)).replace(/['"]+/g, '');
if (!utils.pathIsRelative(relativePath)) {
atom.notifications.addInfo('AtomTS: Can only rename external modules if they are relative files!');
return;
}
let completePath = path.resolve(path.dirname(atomUtils.getCurrentPath()), relativePath) + '.ts';
// TODO: Actually rename the file
renameView.panelView.renameThis({
autoSelect: false,
title: 'Rename File',
text: completePath,
openFiles: [],
closedFiles: [],
onCancel: () => { },
onValidate: (newText): string => {
if (!newText.trim()) {
return 'If you want to abort : Press esc to exit'
}
return '';
},
onCommit: (newText) => {
newText = newText.trim();
parent.getRenameFilesRefactorings({ oldPath: completePath, newPath: newText })
.then((res) => {
applyRefactorings(res.refactorings);
});
}
});
atom.notifications.addInfo('AtomTS: File rename comming soon!');
) i.e. all paths in the code are updated on renaming. Pending :

@trusktr
Copy link

trusktr commented May 14, 2019

This would be sweet. Can we keep this open?

@lierdakil
Copy link
Collaborator

Please open a new issue lest I miss this in the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants