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

support rename all file for go.mod project #2917

Merged
merged 5 commits into from
Jun 13, 2020
Merged

Conversation

taoso
Copy link
Contributor

@taoso taoso commented Jun 11, 2020

gopls rename require to switch to the root dir to rename all files.

gopls rename require to switch to the root dir to rename all files.
Copy link
Collaborator

@bhcleek bhcleek left a 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?

Copy link
Collaborator

@bhcleek bhcleek left a 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.

Copy link
Collaborator

@bhcleek bhcleek left a 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?

autoload/go/rename.vim Outdated Show resolved Hide resolved
@taoso
Copy link
Contributor Author

taoso commented Jun 12, 2020

are you ok if I push to your branch

Feel free to make any change @bhcleek

taoso and others added 2 commits June 13, 2020 07:11
* 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'.
@bhcleek bhcleek added this to the vim-go 1.24 milestone Jun 13, 2020
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().
@bhcleek
Copy link
Collaborator

bhcleek commented Jun 13, 2020

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.

@bhcleek bhcleek merged commit 9a8e76c into fatih:master Jun 13, 2020
@taoso taoso deleted the rename-root branch June 13, 2020 22:50
bhcleek added a commit that referenced this pull request Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants