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: translate go.work conflicting replacement errors to quickfixes or a command to run. #51712

Open
hyangah opened this issue Mar 16, 2022 · 2 comments
Labels
FeatureRequest gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Mar 16, 2022

Screen Shot 2022-03-16 at 9 54 23 AM

What did you do?

Checkout kubernetes repo, and create a go.work file including all modules in the repo except those in vendor.
A better, simpler repro case can be constructed by creating a workspace with conflicting modules (I will take a look if I can create a simpler repro with gopls test setup later if gopls experts cannot help with it).

What did you expect to see?

Notifications popup with "Fix This" button :-) or
Diagnostics with quickfix associated.

What did you see instead?

Verbose error messages.

Go command is giving a specific command to run already. I wonder if we can parse the message, replace [override] part, and suggest it as a quickfix.

cc @findleyr @matloob

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 16, 2022
@gopherbot gopherbot added this to the Unreleased milestone Mar 16, 2022
@hyangah
Copy link
Contributor Author

hyangah commented Mar 16, 2022

I added a replace statement:

$ go work edit -replace sigs.k8s.io/json=sigs.k8s.io/json@v0.0.0-20211208200746-9f7c6b3444d2 
$ cat go.work
...
replace sigs.k8s.io/json => sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2

But gopls was still reporting the issue (load error notification didn't go away) until I restarted gopls.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.8.2 Mar 16, 2022
@suiluj
Copy link

suiluj commented Mar 30, 2022

same problem. I don't know how to do the replace. Did you find a solution?

@findleyr findleyr modified the milestones: gopls/v0.8.4, gopls/v0.9.0 May 18, 2022
@findleyr findleyr modified the milestones: gopls/v0.9.0, gopls/later Jun 13, 2022
@ansaba ansaba added FeatureRequest gopls/workspace Issues related to support for modules or multi-module workspaces. labels Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants