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: improve new module/package import workflow #44366

Closed
hyangah opened this issue Feb 18, 2021 · 3 comments
Closed

x/tools/gopls: improve new module/package import workflow #44366

hyangah opened this issue Feb 18, 2021 · 3 comments
Labels
FrozenDueToAge 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 Feb 18, 2021

gopls version: v0.6.6-pre.1
go version 1.16

Consider the following code with incomplete go.mod

--- go.mod ---
module w

go 1.16

--- main.go ---
package main

import (
	_ "golang.org/x/mod/modfile"
)
func main() {

}

Gopls reports an error and provides codeaction:
Screen Shot 2021-02-18 at 2 11 06 AM

[Trace - 02:10:59.236 AM] Sending request 'textDocument/codeAction - (9)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"message":"could not import golang.org/x/mod/modfile (no required module provides package \"golang.org/x/mod/modfile\")","code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"severity":1,"source":"compiler"}],"only":["quickfix"]}}

No diagnostics for go.mod file yet.

User accepts the quickfix (go get package golang.org/x/mod/modfile).

Gopls reports another error for the import statement.
Screen Shot 2021-02-18 at 2 11 29 AM

[Trace - 02:11:16.863 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/google/w/main.go","version":1,"diagnostics":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"severity":1,"source":"compiler","message":"error while importing golang.org/x/mod/modfile: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1"}]}

The error message doesn't mention anything about go.mod file and there is no quickfix this time.
The user is now told to check go.mod and finds an error in go.mod, actually three error messages.
(Edit: I updated my vscode from 1.53.1 to 1.53.2 in the mean time, and cannot reproduce the third diagnostic message (with the quickfix any more now. Still I see two duplicate messages in go.mod file.)

Screen Shot 2021-02-18 at 2 11 45 AM

[Trace - 02:11:16.862 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/google/w/go.mod","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":1,"source":"compiler","message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":1,"source":"compiler","message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}]}

Among the three, the last one claims golang.org/x/mod is not used in this module. And quickfix is titled:

Screen Shot 2021-02-18 at 2 12 13 AM

Running the quickfix indeed removes the require statement, and we return to the original state. 😓

gopls trace ``` ... [Trace - 02:10:53.413 AM] Sending notification 'initialized'. Params: {}

[Trace - 02:10:53.413 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go","languageId":"go","version":1,"text":"package main\n\nimport (\n\t_ "golang.org/x/mod/modfile"\n)\nfunc main() {\n\n}\n"}}

[Trace - 02:10:53.413 AM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}

[Trace - 02:10:53.433 AM] Sending response 'window/workDoneProgress/create - (1)' in 20ms.
Result:

[Trace - 02:10:53.433 AM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}

[Trace - 02:10:53.434 AM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/projects/google/w","section":"gopls"}]}

[Trace - 02:10:53.446 AM] Sending response 'workspace/configuration - (2)' in 12ms.
Result: [{"build.experimentalWorkspaceModule":false,"build.expandWorkspaceToModule":true,"build.directoryFilters":["-internal/lsp/testdata"],"ui.diagnostic.staticcheck":true}]

[Trace - 02:10:53.551 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:10:53 go env for /Users/hakim/projects/google/w\n(root /Users/hakim/projects/google/w)\n(go version go version go1.16 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGOFLAGS=\nGOPROXY=https://proxy.golang.org,direct\nGOINSECURE=\nGOMOD=/Users/hakim/projects/google/w/go.mod\nGOPATH=/Users/hakim/go\nGOSUMDB=sum.golang.org\nGOCACHE=/Users/hakim/Library/Caches/go-build\nGONOSUMDB=\nGO111MODULE=\nGOMODCACHE=/Users/hakim/go/pkg/mod\nGONOPROXY=\nGOPRIVATE=\nGOROOT=/usr/local/go\n\n"}

[Info - 2:10:53 AM] 2021/02/18 02:10:53 go env for /Users/hakim/projects/google/w
(root /Users/hakim/projects/google/w)
(go version go version go1.16 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GOFLAGS=
GOPROXY=https://proxy.golang.org,direct
GOINSECURE=
GOMOD=/Users/hakim/projects/google/w/go.mod
GOPATH=/Users/hakim/go
GOSUMDB=sum.golang.org
GOCACHE=/Users/hakim/Library/Caches/go-build
GONOSUMDB=
GO111MODULE=
GOMODCACHE=/Users/hakim/go/pkg/mod
GONOPROXY=
GOPRIVATE=
GOROOT=/usr/local/go

[Trace - 02:10:53.645 AM] Sending request 'textDocument/codeAction - (1)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":7,"character":1},"end":{"line":7,"character":1}},"context":{"diagnostics":[]}}

[Trace - 02:10:53.645 AM] Sending request 'textDocument/documentLink - (2)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:10:53.740 AM] Sending notification '$/cancelRequest'.
Params: {"id":2}

[Trace - 02:10:53.740 AM] Sending request 'textDocument/documentLink - (3)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:10:53.767 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:10:53 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/hakim/projects/google/w\n\tquery=[builtin w/...]\n\tpackages=2\n"}

[Trace - 02:10:53.768 AM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}

[Info - 2:10:53 AM] 2021/02/18 02:10:53 go/packages.Load
snapshot=0
directory=/Users/hakim/projects/google/w
query=[builtin w/...]
packages=2

[Trace - 02:10:53.769 AM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7}]}}]}

[Trace - 02:10:53.771 AM] Sending response 'client/registerCapability - (3)' in 2ms.
Result:

[Trace - 02:10:53.772 AM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}

[Trace - 02:10:53.773 AM] Sending response 'client/registerCapability - (4)' in 1ms.
Result:

[Trace - 02:10:54.008 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:10:54 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/hakim/projects/google/w\n\tquery=[file=/Users/hakim/projects/google/w/main.go]\n\tpackages=1\n"}

[Trace - 02:10:54.011 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/18 02:10:54 w: no dep handle for golang.org/x/mod/modfile: no metadata for golang.org/x/mod/modfile\n\tsnapshot=1\n"}

[Info - 2:10:54 AM] 2021/02/18 02:10:54 go/packages.Load
snapshot=1
directory=/Users/hakim/projects/google/w
query=[file=/Users/hakim/projects/google/w/main.go]
packages=1

[Trace - 02:10:54.011 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:10:54 go/packages.Load\n\tsnapshot=1\n\tpackage="w"\n\tfiles=[/Users/hakim/projects/google/w/main.go]\n"}

[Trace - 02:10:54.012 AM] Received response 'textDocument/codeAction - (1)' in 367ms.
Result: null

[Error - Received] 02:10:54.012 AM #2 JSON RPC cancelled

[Trace - 02:10:54.012 AM] Received response 'textDocument/documentLink - (3)' in 271ms.
Result: [{"range":{"start":{"line":3,"character":4},"end":{"line":3,"character":28}},"target":"https://pkg.go.dev/golang.org/x/mod/modfile?utm_source=gopls"}]

[Error - 2:10:54 AM] 2021/02/18 02:10:54 w: no dep handle for golang.org/x/mod/modfile: no metadata for golang.org/x/mod/modfile
snapshot=1

[Info - 2:10:54 AM] 2021/02/18 02:10:54 go/packages.Load
snapshot=1
package="w"
files=[/Users/hakim/projects/google/w/main.go]

[Trace - 02:10:54.020 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:10:54 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/hakim/projects/google/w\n\tquery=[file=/Users/hakim/projects/google/w/main.go]\n\tpackages=1\n"}

[Trace - 02:10:54.021 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:10:54 go/packages.Load\n\tsnapshot=1\n\tpackage="w"\n\tfiles=[/Users/hakim/projects/google/w/main.go]\n"}

[Trace - 02:10:54.021 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/google/w/main.go","version":1,"diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")"}]}

[Info - 2:10:54 AM] 2021/02/18 02:10:54 go/packages.Load
snapshot=1
directory=/Users/hakim/projects/google/w
query=[file=/Users/hakim/projects/google/w/main.go]
packages=1

[Info - 2:10:54 AM] 2021/02/18 02:10:54 go/packages.Load
snapshot=1
package="w"
files=[/Users/hakim/projects/google/w/main.go]

[Trace - 02:10:54.054 AM] Sending request 'textDocument/foldingRange - (4)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:10:54.055 AM] Received response 'textDocument/foldingRange - (4)' in 0ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":3,"endCharacter":29,"kind":"imports"}]

[Trace - 02:10:54.227 AM] Sending request 'textDocument/codeAction - (5)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":5,"character":13},"end":{"line":5,"character":13}},"context":{"diagnostics":[]}}

[Trace - 02:10:54.228 AM] Received response 'textDocument/codeAction - (5)' in 0ms.
Result: null

[Trace - 02:10:54.372 AM] Sending request 'textDocument/documentSymbol - (6)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:10:54.372 AM] Received response 'textDocument/documentSymbol - (6)' in 0ms.
Result: [{"name":"main","detail":"()","kind":12,"range":{"start":{"line":5,"character":0},"end":{"line":7,"character":1}},"selectionRange":{"start":{"line":5,"character":5},"end":{"line":5,"character":9}}}]

[Trace - 02:10:54.585 AM] Sending request 'textDocument/codeLens - (7)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:10:54.585 AM] Received response 'textDocument/codeLens - (7)' in 0ms.
Result: null

[Trace - 02:10:59.057 AM] Sending request 'textDocument/hover - (8)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":17}}

[Trace - 02:10:59.058 AM] Received response 'textDocument/hover - (8)' in 0ms.
Result: null

[Trace - 02:10:59.236 AM] Sending request 'textDocument/codeAction - (9)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")","code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"severity":1,"source":"compiler"}],"only":["quickfix"]}}

[Trace - 02:10:59.237 AM] Received response 'textDocument/codeAction - (9)' in 1ms.
Result: [{"title":"go get package golang.org/x/mod/modfile","kind":"quickfix","diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")"}],"edit":{},"command":{"title":"go get package golang.org/x/mod/modfile","command":"gopls.go_get_package","arguments":[{"URI":"file:///Users/hakim/projects/google/w/main.go","Pkg":"golang.org/x/mod/modfile","AddRequire":true}]}}]

[Trace - 02:11:00.591 AM] Sending request 'textDocument/definition - (10)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":18}}

[Error - Received] 02:11:00.592 AM #10 no imported package for golang.org/x/mod/modfile

[Error - 2:11:00 AM] Request textDocument/definition failed.
Message: no imported package for golang.org/x/mod/modfile
Code: 0
[Trace - 02:11:00.737 AM] Sending request 'textDocument/hover - (11)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":17}}

[Trace - 02:11:00.738 AM] Received response 'textDocument/hover - (11)' in 0ms.
Result: null

[Trace - 02:11:00.964 AM] Sending request 'textDocument/hover - (12)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":17}}

[Trace - 02:11:00.965 AM] Received response 'textDocument/hover - (12)' in 0ms.
Result: null

[Trace - 02:11:01.123 AM] Sending request 'textDocument/codeAction - (13)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")","code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"severity":1,"source":"compiler"}],"only":["quickfix"]}}

[Trace - 02:11:01.124 AM] Received response 'textDocument/codeAction - (13)' in 0ms.
Result: [{"title":"go get package golang.org/x/mod/modfile","kind":"quickfix","diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")"}],"edit":{},"command":{"title":"go get package golang.org/x/mod/modfile","command":"gopls.go_get_package","arguments":[{"URI":"file:///Users/hakim/projects/google/w/main.go","Pkg":"golang.org/x/mod/modfile","AddRequire":true}]}}]

[Trace - 02:11:07.651 AM] Sending request 'textDocument/hover - (14)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":20}}

[Trace - 02:11:07.651 AM] Received response 'textDocument/hover - (14)' in 0ms.
Result: null

[Trace - 02:11:07.804 AM] Sending request 'textDocument/codeAction - (15)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")","code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"severity":1,"source":"compiler"}],"only":["quickfix"]}}

[Trace - 02:11:07.805 AM] Received response 'textDocument/codeAction - (15)' in 0ms.
Result: [{"title":"go get package golang.org/x/mod/modfile","kind":"quickfix","diagnostics":[{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"file:///pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import golang.org/x/mod/modfile (no required module provides package "golang.org/x/mod/modfile")"}],"edit":{},"command":{"title":"go get package golang.org/x/mod/modfile","command":"gopls.go_get_package","arguments":[{"URI":"file:///Users/hakim/projects/google/w/main.go","Pkg":"golang.org/x/mod/modfile","AddRequire":true}]}}]

[Trace - 02:11:14.578 AM] Sending request 'workspace/executeCommand - (16)'.
Params: {"command":"gopls.go_get_package","arguments":[{"URI":"file:///Users/hakim/projects/google/w/main.go","Pkg":"golang.org/x/mod/modfile","AddRequire":true}]}

[Trace - 02:11:14.579 AM] Received request 'window/workDoneProgress/create - (5)'.
Params: {"token":"8674665223082153551"}

[Trace - 02:11:14.580 AM] Sending response 'window/workDoneProgress/create - (5)' in 1ms.
Result:

[Trace - 02:11:14.581 AM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"begin","title":"Running go get","cancellable":true,"message":"Running..."}}

[Trace - 02:11:14.822 AM] Sending request 'textDocument/codeLens - (17)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:11:15.345 AM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"end","message":"completed"}}

[Trace - 02:11:15.345 AM] Received response 'workspace/executeCommand - (16)' in 767ms.
Result: null

[Trace - 02:11:15.345 AM] Received response 'textDocument/codeLens - (17)' in 523ms.
Result: null

[Trace - 02:11:15.348 AM] Sending request 'textDocument/codeAction - (18)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":5,"character":13},"end":{"line":5,"character":13}},"context":{"diagnostics":[]}}

[Trace - 02:11:15.349 AM] Received response 'textDocument/codeAction - (18)' in 0ms.
Result: null

[Trace - 02:11:16.125 AM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///Users/hakim/projects/google/w/go.mod","type":2}]}

[Trace - 02:11:16.601 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:11:16 go/packages.Load\n\tsnapshot=2\n\tdirectory=/Users/hakim/projects/google/w\n\tquery=[builtin w/...]\n\tpackages=2\n"}

[Info - 2:11:16 AM] 2021/02/18 02:11:16 go/packages.Load
snapshot=2
directory=/Users/hakim/projects/google/w
query=[builtin w/...]
packages=2

[Trace - 02:11:16.641 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/18 02:11:16 golang.org/x/mod/module: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors\n\tsnapshot=2\n"}

[Error - 2:11:16 AM] 2021/02/18 02:11:16 golang.org/x/mod/module: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors
snapshot=2

[Trace - 02:11:16.862 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/google/w/go.mod","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":1,"source":"compiler","message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":1,"source":"compiler","message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}]}

[Trace - 02:11:16.863 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/google/w/main.go","version":1,"diagnostics":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"severity":1,"source":"compiler","message":"error while importing golang.org/x/mod/modfile: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1"}]}

[Trace - 02:11:17.120 AM] Sending request 'textDocument/codeAction - (19)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":5,"character":13},"end":{"line":5,"character":13}},"context":{"diagnostics":[]}}

[Trace - 02:11:17.164 AM] Received response 'textDocument/codeAction - (19)' in 43ms.
Result: null

[Trace - 02:11:19.930 AM] Sending request 'textDocument/hover - (20)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":24}}

[Trace - 02:11:19.930 AM] Received response 'textDocument/hover - (20)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"go\n_ \"golang.org/x/mod/modfile\"\n"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}}}

[Trace - 02:11:20.087 AM] Sending request 'textDocument/codeAction - (21)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"message":"error while importing golang.org/x/mod/modfile: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"}],"only":["quickfix"]}}

[Trace - 02:11:20.089 AM] Received response 'textDocument/codeAction - (21)' in 1ms.
Result: null

[Trace - 02:11:21.569 AM] Sending request 'textDocument/definition - (22)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":25}}

[Trace - 02:11:21.570 AM] Received response 'textDocument/definition - (22)' in 0ms.
Result: [{"uri":"file:///Users/hakim/go/pkg/mod/golang.org/x/mod@v0.4.1/modfile/print.go","range":{"start":{"line":6,"character":0},"end":{"line":161,"character":41}}},{"uri":"file:///Users/hakim/go/pkg/mod/golang.org/x/mod@v0.4.1/modfile/read.go","range":{"start":{"line":4,"character":0},"end":{"line":923,"character":34}}},{"uri":"file:///Users/hakim/go/pkg/mod/golang.org/x/mod@v0.4.1/modfile/rule.go","range":{"start":{"line":19,"character":0},"end":{"line":1090,"character":41}}}]

[Trace - 02:11:21.724 AM] Sending request 'textDocument/hover - (23)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":24}}

[Trace - 02:11:21.725 AM] Received response 'textDocument/hover - (23)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"go\n_ \"golang.org/x/mod/modfile\"\n"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}}}

[Trace - 02:11:21.946 AM] Sending request 'textDocument/hover - (24)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"position":{"line":3,"character":24}}

[Trace - 02:11:21.947 AM] Received response 'textDocument/hover - (24)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"go\n_ \"golang.org/x/mod/modfile\"\n"},"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":29}}}

[Trace - 02:11:22.101 AM] Sending request 'textDocument/codeAction - (25)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"message":"error while importing golang.org/x/mod/modfile: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"}],"only":["quickfix"]}}

[Trace - 02:11:22.102 AM] Received response 'textDocument/codeAction - (25)' in 1ms.
Result: null

[Trace - 02:11:23.780 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:11:23 background imports cache refresh starting\n"}

[Info - 2:11:23 AM] 2021/02/18 02:11:23 background imports cache refresh starting

[Trace - 02:11:24.017 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:11:24 background refresh finished after 236.620843ms\n"}

[Info - 2:11:24 AM] 2021/02/18 02:11:24 background refresh finished after 236.620843ms

[Trace - 02:11:36.849 AM] Sending request 'textDocument/documentSymbol - (26)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:11:36.851 AM] Received response 'textDocument/documentSymbol - (26)' in 2ms.
Result: [{"name":"main","detail":"()","kind":12,"range":{"start":{"line":5,"character":0},"end":{"line":7,"character":1}},"selectionRange":{"start":{"line":5,"character":5},"end":{"line":5,"character":9}}}]

[Trace - 02:11:36.901 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod","languageId":"go.mod","version":1,"text":"module w\n\ngo 1.16\n\nrequire golang.org/x/mod v0.4.1\n"}}

[Trace - 02:11:36.902 AM] Sending request 'textDocument/documentLink - (27)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:11:36.902 AM] Sending request 'textDocument/codeAction - (28)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 02:11:36.902 AM] Sending request 'textDocument/documentSymbol - (29)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:11:36.906 AM] Received response 'textDocument/documentLink - (27)' in 4ms.
Result: [{"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":24}},"target":"https://pkg.go.dev/mod/golang.org/x/mod@v0.4.1?utm_source=gopls"}]

[Trace - 02:11:36.908 AM] Received response 'textDocument/codeAction - (28)' in 6ms.
Result: null

[Trace - 02:11:36.908 AM] Received response 'textDocument/documentSymbol - (29)' in 6ms.
Result: []

[Trace - 02:11:37.111 AM] Sending request 'textDocument/foldingRange - (30)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:11:37.112 AM] Received response 'textDocument/foldingRange - (30)' in 1ms.
Result: null

[Trace - 02:11:37.112 AM] Sending request 'textDocument/codeLens - (31)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:11:37.114 AM] Received response 'textDocument/codeLens - (31)' in 1ms.
Result: [{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run go mod tidy","command":"gopls.tidy","arguments":[{"URIs":["file:///Users/hakim/projects/google/w/go.mod"]}]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Create vendor directory","command":"gopls.vendor","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod"}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Check for upgrades","command":"gopls.check_upgrades","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","Modules":["golang.org/x/mod"]}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade transitive dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["-u","all"],"AddRequire":false}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade direct dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["golang.org/x/mod"],"AddRequire":false}]}}]

[Trace - 02:11:37.373 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:11:37 go/packages.Load\n\tsnapshot=3\n\tdirectory=/Users/hakim/projects/google/w\n\tquery=[builtin w/...]\n\tpackages=2\n"}

[Info - 2:11:37 AM] 2021/02/18 02:11:37 go/packages.Load
snapshot=3
directory=/Users/hakim/projects/google/w
query=[builtin w/...]
packages=2

[Trace - 02:11:37.379 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/18 02:11:37 golang.org/x/mod/module: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors\n\tsnapshot=3\n"}

[Error - 2:11:37 AM] 2021/02/18 02:11:37 golang.org/x/mod/module: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors
snapshot=3

[Trace - 02:11:38.039 AM] Sending request 'textDocument/hover - (32)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":17}}

[Trace - 02:11:38.055 AM] Received response 'textDocument/hover - (32)' in 16ms.
Result: {"contents":{"kind":"markdown","value":"### golang.org/x/mod\n\n(main module does not need module golang.org/x/mod)"},"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":24}}}

[Trace - 02:11:38.207 AM] Sending request 'textDocument/codeAction - (33)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:11:38.209 AM] Received response 'textDocument/codeAction - (33)' in 2ms.
Result: [{"title":"Remove dependency: golang.org/x/mod","kind":"quickfix","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}],"edit":{},"command":{"title":"Remove dependency: golang.org/x/mod","command":"gopls.remove_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","ModulePath":"golang.org/x/mod","OnlyDiagnostic":true}]}}]

[Trace - 02:11:49.949 AM] Sending request 'textDocument/hover - (34)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":4}}

[Trace - 02:11:49.949 AM] Received response 'textDocument/hover - (34)' in 0ms.
Result: null

[Trace - 02:11:50.104 AM] Sending request 'textDocument/codeAction - (35)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:11:50.105 AM] Received response 'textDocument/codeAction - (35)' in 1ms.
Result: [{"title":"Remove dependency: golang.org/x/mod","kind":"quickfix","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}],"edit":{},"command":{"title":"Remove dependency: golang.org/x/mod","command":"gopls.remove_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","ModulePath":"golang.org/x/mod","OnlyDiagnostic":true}]}}]

[Trace - 02:11:52.859 AM] Sending request 'textDocument/hover - (36)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":5}}

[Trace - 02:11:52.860 AM] Received response 'textDocument/hover - (36)' in 0ms.
Result: null

[Trace - 02:11:53.014 AM] Sending request 'textDocument/codeAction - (37)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:11:53.015 AM] Received response 'textDocument/codeAction - (37)' in 1ms.
Result: [{"title":"Remove dependency: golang.org/x/mod","kind":"quickfix","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}],"edit":{},"command":{"title":"Remove dependency: golang.org/x/mod","command":"gopls.remove_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","ModulePath":"golang.org/x/mod","OnlyDiagnostic":true}]}}]

[Trace - 02:12:01.734 AM] Sending request 'textDocument/codeLens - (38)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:12:01.734 AM] Received response 'textDocument/codeLens - (38)' in 0ms.
Result: [{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run go mod tidy","command":"gopls.tidy","arguments":[{"URIs":["file:///Users/hakim/projects/google/w/go.mod"]}]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Create vendor directory","command":"gopls.vendor","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod"}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Check for upgrades","command":"gopls.check_upgrades","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","Modules":["golang.org/x/mod"]}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade transitive dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["-u","all"],"AddRequire":false}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade direct dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["golang.org/x/mod"],"AddRequire":false}]}}]

[Trace - 02:12:01.895 AM] Sending request 'textDocument/hover - (39)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":5}}

[Trace - 02:12:01.896 AM] Received response 'textDocument/hover - (39)' in 0ms.
Result: null

[Trace - 02:12:19.334 AM] Sending request 'textDocument/codeLens - (40)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:12:19.334 AM] Received response 'textDocument/codeLens - (40)' in 0ms.
Result: [{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run go mod tidy","command":"gopls.tidy","arguments":[{"URIs":["file:///Users/hakim/projects/google/w/go.mod"]}]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Create vendor directory","command":"gopls.vendor","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod"}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Check for upgrades","command":"gopls.check_upgrades","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","Modules":["golang.org/x/mod"]}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade transitive dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["-u","all"],"AddRequire":false}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade direct dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["golang.org/x/mod"],"AddRequire":false}]}}]

[Trace - 02:12:19.749 AM] Sending request 'textDocument/hover - (41)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":7}}

[Trace - 02:12:19.750 AM] Received response 'textDocument/hover - (41)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"### golang.org/x/mod\n\n(main module does not need module golang.org/x/mod)"},"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":24}}}

[Trace - 02:12:19.906 AM] Sending request 'textDocument/codeAction - (42)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:12:19.907 AM] Received response 'textDocument/codeAction - (42)' in 1ms.
Result: [{"title":"Remove dependency: golang.org/x/mod","kind":"quickfix","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}],"edit":{},"command":{"title":"Remove dependency: golang.org/x/mod","command":"gopls.remove_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","ModulePath":"golang.org/x/mod","OnlyDiagnostic":true}]}}]

[Trace - 02:12:22.973 AM] Sending request 'textDocument/hover - (43)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":20}}

[Trace - 02:12:22.974 AM] Received response 'textDocument/hover - (43)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"### golang.org/x/mod\n\n(main module does not need module golang.org/x/mod)"},"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":24}}}

[Trace - 02:12:23.130 AM] Sending request 'textDocument/codeAction - (44)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:12:23.130 AM] Sending notification '$/cancelRequest'.
Params: {"id":44}

[Error - Received] 02:12:23.130 AM #44 JSON RPC cancelled

[Trace - 02:12:23.519 AM] Sending request 'textDocument/hover - (45)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":21}}

[Trace - 02:12:23.519 AM] Received response 'textDocument/hover - (45)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"### golang.org/x/mod\n\n(main module does not need module golang.org/x/mod)"},"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":24}}}

[Trace - 02:12:23.675 AM] Sending request 'textDocument/codeAction - (46)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:12:23.675 AM] Received response 'textDocument/codeAction - (46)' in 0ms.
Result: [{"title":"Remove dependency: golang.org/x/mod","kind":"quickfix","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}],"edit":{},"command":{"title":"Remove dependency: golang.org/x/mod","command":"gopls.remove_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","ModulePath":"golang.org/x/mod","OnlyDiagnostic":true}]}}]

[Trace - 02:14:39.279 AM] Sending request 'textDocument/codeLens - (47)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:14:39.280 AM] Received response 'textDocument/codeLens - (47)' in 0ms.
Result: [{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run go mod tidy","command":"gopls.tidy","arguments":[{"URIs":["file:///Users/hakim/projects/google/w/go.mod"]}]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Create vendor directory","command":"gopls.vendor","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod"}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Check for upgrades","command":"gopls.check_upgrades","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","Modules":["golang.org/x/mod"]}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade transitive dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["-u","all"],"AddRequire":false}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade direct dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["golang.org/x/mod"],"AddRequire":false}]}}]

[Trace - 02:14:42.613 AM] Sending request 'textDocument/documentSymbol - (48)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:14:42.613 AM] Sending request 'textDocument/documentLink - (49)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:14:42.613 AM] Sending request 'textDocument/codeAction - (50)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 02:14:42.613 AM] Sending notification '$/cancelRequest'.
Params: {"id":48}

[Trace - 02:14:42.613 AM] Sending request 'textDocument/documentSymbol - (51)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Error - Received] 02:14:42.614 AM #48 JSON RPC cancelled

[Trace - 02:14:42.614 AM] Received response 'textDocument/documentLink - (49)' in 1ms.
Result: [{"range":{"start":{"line":3,"character":4},"end":{"line":3,"character":28}},"target":"https://pkg.go.dev/golang.org/x/mod@v0.4.1/modfile?utm_source=gopls"}]

[Trace - 02:14:42.615 AM] Received response 'textDocument/codeAction - (50)' in 1ms.
Result: null

[Trace - 02:14:42.615 AM] Received response 'textDocument/documentSymbol - (51)' in 1ms.
Result: [{"name":"main","detail":"()","kind":12,"range":{"start":{"line":5,"character":0},"end":{"line":7,"character":1}},"selectionRange":{"start":{"line":5,"character":5},"end":{"line":5,"character":9}}}]

[Trace - 02:14:42.774 AM] Sending request 'textDocument/foldingRange - (52)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:14:42.774 AM] Received response 'textDocument/foldingRange - (52)' in 0ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":3,"endCharacter":29,"kind":"imports"}]

[Trace - 02:14:42.830 AM] Sending request 'textDocument/codeAction - (53)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":5,"character":13},"end":{"line":5,"character":13}},"context":{"diagnostics":[]}}

[Trace - 02:14:42.830 AM] Received response 'textDocument/codeAction - (53)' in 0ms.
Result: null

[Trace - 02:14:42.953 AM] Sending request 'textDocument/codeLens - (54)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:14:42.954 AM] Received response 'textDocument/codeLens - (54)' in 0ms.
Result: null

[Trace - 02:14:44.779 AM] Sending request 'textDocument/codeAction - (55)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":7,"character":1}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":29}},"message":"error while importing golang.org/x/mod/modfile: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"}]}}

[Trace - 02:14:44.781 AM] Received response 'textDocument/codeAction - (55)' in 1ms.
Result: null

[Trace - 02:15:11.724 AM] Sending request 'textDocument/codeLens - (56)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:15:11.725 AM] Received response 'textDocument/codeLens - (56)' in 1ms.
Result: null

[Trace - 02:15:12.620 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:15:12 background imports cache refresh starting\n"}

[Info - 2:15:12 AM] 2021/02/18 02:15:12 background imports cache refresh starting

[Trace - 02:15:12.752 AM] Sending request 'textDocument/documentSymbol - (57)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/main.go"}}

[Trace - 02:15:12.752 AM] Sending request 'textDocument/documentLink - (58)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:15:12.753 AM] Sending request 'textDocument/codeAction - (59)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 02:15:12.753 AM] Sending notification '$/cancelRequest'.
Params: {"id":57}

[Trace - 02:15:12.753 AM] Sending request 'textDocument/documentSymbol - (60)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Error - Received] 02:15:12.755 AM #57 JSON RPC cancelled

[Trace - 02:15:12.755 AM] Received response 'textDocument/documentLink - (58)' in 2ms.
Result: [{"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":24}},"target":"https://pkg.go.dev/mod/golang.org/x/mod@v0.4.1?utm_source=gopls"}]

[Trace - 02:15:12.762 AM] Received response 'textDocument/codeAction - (59)' in 9ms.
Result: null

[Trace - 02:15:12.767 AM] Received response 'textDocument/documentSymbol - (60)' in 14ms.
Result: []

[Trace - 02:15:12.793 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:15:12 background refresh finished after 173.669062ms\n"}

[Info - 2:15:12 AM] 2021/02/18 02:15:12 background refresh finished after 173.669062ms

[Trace - 02:15:12.926 AM] Sending request 'textDocument/foldingRange - (61)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:15:12.926 AM] Received response 'textDocument/foldingRange - (61)' in 0ms.
Result: null

[Trace - 02:15:13.017 AM] Sending request 'textDocument/codeLens - (62)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:15:13.017 AM] Received response 'textDocument/codeLens - (62)' in 0ms.
Result: [{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run go mod tidy","command":"gopls.tidy","arguments":[{"URIs":["file:///Users/hakim/projects/google/w/go.mod"]}]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Create vendor directory","command":"gopls.vendor","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod"}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Check for upgrades","command":"gopls.check_upgrades","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","Modules":["golang.org/x/mod"]}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade transitive dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["-u","all"],"AddRequire":false}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade direct dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["golang.org/x/mod"],"AddRequire":false}]}}]

[Trace - 02:15:13.456 AM] Sending request 'textDocument/hover - (63)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"position":{"line":4,"character":29}}

[Trace - 02:15:13.457 AM] Received response 'textDocument/hover - (63)' in 0ms.
Result: null

[Trace - 02:15:13.617 AM] Sending request 'textDocument/codeAction - (64)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"},"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"context":{"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"error while importing golang.org/x/mod/module: missing go.sum entry for module providing package golang.org/x/xerrors (imported by golang.org/x/mod/module); to add:\n\tgo get golang.org/x/mod/module@v0.4.1","severity":1,"source":"compiler"},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"message":"golang.org/x/mod is not used in this module","severity":2,"source":"go mod tidy"}],"only":["quickfix"]}}

[Trace - 02:15:13.619 AM] Received response 'textDocument/codeAction - (64)' in 1ms.
Result: [{"title":"Remove dependency: golang.org/x/mod","kind":"quickfix","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"severity":2,"source":"go mod tidy","message":"golang.org/x/mod is not used in this module"}],"edit":{},"command":{"title":"Remove dependency: golang.org/x/mod","command":"gopls.remove_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","ModulePath":"golang.org/x/mod","OnlyDiagnostic":true}]}}]

[Trace - 02:16:16.802 AM] Sending request 'textDocument/codeLens - (65)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod"}}

[Trace - 02:16:16.804 AM] Received response 'textDocument/codeLens - (65)' in 1ms.
Result: [{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run go mod tidy","command":"gopls.tidy","arguments":[{"URIs":["file:///Users/hakim/projects/google/w/go.mod"]}]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Create vendor directory","command":"gopls.vendor","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod"}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Check for upgrades","command":"gopls.check_upgrades","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","Modules":["golang.org/x/mod"]}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade transitive dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["-u","all"],"AddRequire":false}]}},{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":31}},"command":{"title":"Upgrade direct dependencies","command":"gopls.upgrade_dependency","arguments":[{"URI":"file:///Users/hakim/projects/google/w/go.mod","GoCmdArgs":["golang.org/x/mod"],"AddRequire":false}]}}]

[Trace - 02:16:19.546 AM] Sending notification 'textDocument/didSave'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/google/w/go.mod","version":1}}

[Trace - 02:16:20.119 AM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///Users/hakim/projects/google/w/go.mod","type":2}]}

[Trace - 02:16:20.129 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/projects/google/w/go.mod","version":1,"diagnostics":[]}

[Trace - 02:16:21.629 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/18 02:16:21 go/packages.Load\n\tsnapshot=5\n\tdirectory=/Users/hakim/projects/google/w\n\tquery=[builtin w/...]\n\tpackages=2\n"}

[Info - 2:16:21 AM] 2021/02/18 02:16:21 go/packages.Load
snapshot=5
directory=/Users/hakim/projects/google/w
query=[builtin w/...]
packages=2

[Trace - 02:16:21.633 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/18 02:16:21 golang.org/x/mod/module: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors\n\tsnapshot=5\n"}

[Error - 2:16:21 AM] 2021/02/18 02:16:21 golang.org/x/mod/module: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors
snapshot=5

</details>
@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 Feb 18, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 18, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.6.6 Feb 18, 2021
@stamblerre
Copy link
Contributor

Thanks for filing this--I think it is a dupe of #44307. We hadn't milestoned the fix for v0.6.6, but I believe this is serious enough that we need the fix in the v0.6.6 release. I'll close this as a duplicate but we'll aim to get it resolved ASAP.

@hyangah
Copy link
Contributor Author

hyangah commented Feb 18, 2021

Were the duplicate diagnostic entries a symptom of #44307?

@stamblerre
Copy link
Contributor

I'm not sure but https://golang.org/cl/291192 will have probably changed this, and it didn't make it into the release.

@golang golang locked and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

3 participants