Closed
Description
- Start a new Emacs instance using go-mode, eglot, xrefs, and gopls.
- Find-file xtools/internal/lsp/cache/cache.go, where xtools is a git clone of golang.org/x/tools.
- Place cursor at func
New
identifier and call thexref-find-references
Lisp command. - Observe no results.
- Find-file xtools/internal/lsp/cmd/cmd.go then immediately kill the buffer.
- Repeat steps 2 and 3
- Observe these (correct) results:
internal/lsp/cmd/capabilities_test.go
46: c.Server = lsp.NewServer(cache.New(app.options).NewSession(ctx), c.Client)
internal/lsp/cmd/cmd.go
289: connection.Server = lsp.NewServer(cache.New(app.options).NewSession(ctx), connection.Client)
internal/lsp/cmd/serve.go
104: ss = lsprpc.NewStreamServer(cache.New(s.app.options), isDaemon)
This history of opened buffers should not affect the results of this query.
My first question at this point is: is the problem in Emacs or gopls? I tried to answer that by using the command-line client, but that exits zero with no output even when Emacs is working, which looks like a separate bug:
$ go run ./gopls/ --remote=localhost:8091 references internal/lsp/cache/cache.go:31:6
$
(Adding -v to the latter command displays a number of info logs concerning "go/packages.Load". Is the command-line tool trying to do the analysis itself instead of sending a request to the server?)