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: stuck with error after resolving git conflict markers #38879

Open
atombender opened this issue May 5, 2020 · 6 comments
Open

x/tools/gopls: stuck with error after resolving git conflict markers #38879

atombender opened this issue May 5, 2020 · 6 comments
Labels
Milestone

Comments

@atombender
Copy link

@atombender atombender commented May 5, 2020

What did you do?

Did a git rebase and resolved conflict markers in a file.

What did you expect to see?

No errors.

What did you see instead?

gopls thinks there are still conflict markers.

Screen Shot 2020-05-05 at 12 30 21

Log

gopls.log.gz, scrubbed of didOpen sources, except for the file in question, source_test.go.

Build info

golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.0.0-20200501005904-d351ea090f9b h1:CAqIXUMd9mH3t2O1DRj2IWu0Zh75A4fWPA+YjJOmXdE=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200430221153-f26c0dd9827d h1:8emZwJTManptbFnp36i5fbhO/1vUs3rfnh5e3Th8HEQ=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
    mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.14 darwin/amd64

@gopherbot gopherbot added this to the Unreleased milestone May 5, 2020
@gopherbot gopherbot added the Tools label May 5, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented May 5, 2020

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

@gopherbot gopherbot added the gopls label May 5, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 May 5, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 5, 2020

Seeing error messages like

[Error - 12:27:01 PM] 2020/05/05 12:27:01
	message="failed to load workspace packages, skipping diagnostics"
	error=github.com/sanity-io/gradient/pkg/search/elasticsearch/indexstate_test [github.com/sanity-io/gradient/pkg/search/elasticsearch/indexstate.test] has no metadata
	snapshot=244
	directory=file:///Users/alex/Projects/Sanity/gradient

which leads me to believe that this is a duplicate of #38878, which is in turn a duplicate of #38423 (and probably related to #38358).

@atombender
Copy link
Author

@atombender atombender commented May 5, 2020

Got it. It's pretty hard to understand what the cause of a bug is and therefore know if it's a dupe, sorry. As an aside, is there no way for gopls to report itself as broken so that things don't get stuck, and maybe an error message bubbles up to VSCode?

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 5, 2020

No worries - I appreciate you filing all of these issues with logs. We can probably use a window/showMessage when we start skipping diagnostics to make the error more visible to the user.

@atombender
Copy link
Author

@atombender atombender commented May 6, 2020

I just got the error again, after restarting gopls. In other words:

  • git rebase, got conflict markers.
  • Restarted gopls and even reloaded window a couple of times.
  • Gopls reports same errors as top of this issue.

gopls.log.gz

I wasn't sure if the bug in the other issues related to new files appearing while gopls was running, or just changes in test files.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 6, 2020

Thanks for the report. It looks like we're failing to load a package from a file, but we don't log any errors. I added a better error log in https://golang.org/cl/230315, so when that's merged it would be easier to figure out why this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.