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
gopls Tools
Milestone

Comments

@hyangah
Copy link
Contributor

@hyangah 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 gopls labels Mar 16, 2022
@gopherbot gopherbot added this to the Unreleased milestone Mar 16, 2022
@hyangah
Copy link
Contributor Author

@hyangah 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 removed this from the Unreleased milestone Mar 16, 2022
@findleyr findleyr added this to the gopls/v0.8.2 milestone Mar 16, 2022
@suiluj
Copy link

@suiluj suiluj commented Mar 30, 2022

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

@findleyr findleyr removed this from the gopls/v0.8.2 milestone Mar 31, 2022
@findleyr findleyr added this to the gopls/v0.8.3 milestone Mar 31, 2022
@findleyr findleyr removed this from the gopls/v0.8.3 milestone Apr 5, 2022
@findleyr findleyr added this to the gopls/v0.8.4 milestone Apr 5, 2022
@findleyr findleyr removed this from the gopls/v0.8.4 milestone May 18, 2022
@findleyr findleyr added this to the gopls/v0.9.0 milestone May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Tools
Projects
None yet
Development

No branches or pull requests

4 participants