sourcegraph / go-langserver

Go language server to add Go support to editors and other tools that use the Language Server Protocol (LSP)
https://sourcegraph.com
MIT License
1.17k stars 90 forks source link

Bad intelligence on new rev in GitHub PR file lists #383

Open efritz opened 4 years ago

efritz commented 4 years ago

We're recently discovered some odd behavior when viewing results from go-langserver via the Sourcegraph browser extension. When on a GitHub PR file list in which a Go file has been added in the new rev, the Go langserver fails to tokenize any Go file in the new revision and no code intelligence appears. This does not seem to affect the original revision.

The failing line is a build context import which always returns a scanner error (expected 'package' but got EOF). Additional debugging shows that the build context attempts to open and return the content of a zero-length file (the file in the new rev). When looking at the temp directories, the zip archives appear to be correct.

See https://github.com/sourcegraph/sourcegraph/issues/9556 for some additional context.

efritz commented 4 years ago

Update: this also appears to happen on diff views on Sourcegraph.com, which also points to this being a langserver issue.