-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
support rename all file for go.mod project #2917
Conversation
gopls rename require to switch to the root dir to rename all files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing. This looks great overall.
After the rename completes in the synchronous case the working directory should be restored, though. Can you make that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't think you need to worry about only setting the working directory when binary is gopls
: setting the working directory to the module root should be fine in all cases when there's an ambient go.mod
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there. I can take care of the small changes I requested if you want. If so, then are you ok if I push to your branch?
Feel free to make any change @bhcleek |
* Rename the newly introduced go#util#ExecInDir2 to go#util#ExecInWorkDir * use single quotes in one instance * Rename an variable that holds a working directory name from 'to' to 'wd'. * Call go#util#Chdir instead of using the older pattern of checking for 'lcd'.
chdir() returns the previous directory, so make go#util#Chdir() behave similarly so that caller never have to capture the current working directory in a separate statement before calling go#util#Chdir().
Apologies for force pushing to your branch. I've only force pushed over the new commits that I've added, though, so your local branch shouldn't be affected. I'll merge as soon as tests pass. |
gopls rename require to switch to the root dir to rename all files.