Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Renaming functionality not working at all #1954

Closed
JoseFMP opened this issue Oct 1, 2018 · 7 comments
Closed

Renaming functionality not working at all #1954

JoseFMP opened this issue Oct 1, 2018 · 7 comments

Comments

@JoseFMP
Copy link

JoseFMP commented Oct 1, 2018

This bug happens in all operating systems. No matter what I set-up. Happens in Windows, Linux, and Mac.

Steps to reproduce:

  1. Click on a symbol with the right button (not package name)

  2. Click on "Rename Symbol" option in the context menu
    image

  3. Enter the new different name of the symbol
    image

  4. Press enter (return key)

Expected behavior
Symbol is renamed

Actual behavior
Symbol is not renamed. the Output console will contain the error message:
Rename failed: gorename: can't find package containing ****
Where the stars point to the folder of your package. Wherever it is.


This is not particular of any source code. Happens everywhere.

VS Code version 1.27.2
Extension version: 0.6.89

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Oct 2, 2018

@JoseFMP

We use the gorename tool to provide the renaming feature. As per the error you have shared, it looks like the gorename tool is not able to find the package.

This can happen if your package is not under GOPATH

Are you using Go modules? If yes, the gorename doesnt yet support Go modules.

@vscodebot
Copy link

vscodebot bot commented Oct 9, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. Thank you for your contributions.

@JoseFMP
Copy link
Author

JoseFMP commented Oct 20, 2018

No go modules. I tried multiple configurations for GOPATH. Same result all the time. I mean. Is, this supposed to be working? I really have the same error in different machines with different projects and completely different set-ups.

@ramya-rao-a
Copy link
Contributor

Yes, when not using Go modules, rename feature should work.

Run Go: Current GOPATH. That is the GOPATH used by all the Go tools in the extension. Is the result what you expect?

Also see GOPATH in VS Code

@JoseFMP
Copy link
Author

JoseFMP commented Oct 29, 2018

@ramya-rao-a Yes $GOPATH is set-up correctly. The issue of renaming not working happens in all the golang projects I tried. It never ever worked.
However I do believe the projects are configured correctly since all other go-related tools are working properly.

@ramya-rao-a
Copy link
Contributor

@JoseFMP Can you try running gorename from the command line and see if the tool succeeds?

@grazimdeoliveira
Copy link

😈

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants