Navigation Menu

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

x/tools/gopls: Code navigation and lsp doesn't work when using go.mod replace #33731

Closed
krasi-georgiev opened this issue Aug 20, 2019 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@krasi-georgiev
Copy link

krasi-georgiev commented Aug 20, 2019

go version go1.12.6 linux/amd64

Does this issue reproduce with the latest release? Yes

 gopls version
golang.org/x/tools/gopls v0.1.3
    golang.org/x/tools/gopls@v0.1.4-0.20190820033707-85edb9ef3283 h1:4RzCZ4grbWxufc4sDtqmkQ6criGdzTK41oyDOb7JnYQ=

As soon as you put something in the go.mod replace as

replace github.com/calvernaz/rak811 => ../local/rak811

The code navigation(clicking on the function name) still takes you to
github.com/calvernaz/rak811

If I change some code in ../local/rak811 LSB complains about errors as it uses the github.com/calvernaz/rak811 and ignores the replace directive.

@gopherbot gopherbot added this to the Unreleased milestone Aug 20, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Aug 20, 2019
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here.

@stamblerre
Copy link
Contributor

Thanks for moving this issue! Just to confirm, are you opening VSCode at the module root (the directory that contains the go.mod file)?

@krasi-georgiev
Copy link
Author

yes

@stamblerre
Copy link
Contributor

Can you run the command gopls -rpc.trace -v check path/to/file.go when your code is in the state you described above (doesn't have errors, but gopls shows errors)?

@krasi-georgiev
Copy link
Author

Thanks for this command, after running it I realized that I had a duplicate do.mod file in the subdir.

@golang golang locked and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

3 participants