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: applied suggested fix in go.mod doesn't remove diagnostic #44439

Open
leitzler opened this issue Feb 19, 2021 · 6 comments
Open

x/tools/gopls: applied suggested fix in go.mod doesn't remove diagnostic #44439

leitzler opened this issue Feb 19, 2021 · 6 comments

Comments

@leitzler
Copy link
Contributor

@leitzler leitzler commented Feb 19, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

With the following scenario:

$ txtar -x <<EOF
-- go.mod --
module x

go 1.17
-- main.go --
package main

import _ "rsc.io/quote"

func main() {}
EOF

I open both go.mod and main.go (so that applying suggested fixes to go.mod are sent as workspace/applyEdit).
Then I choose to apply the suggested edit go get rsc.io/quote for the "BrokenImport" diagnostic.

What did you expect to see?

The diagnostic removed directly (the same way applying fixes to a .go file does).

What did you see instead?

The diagnostic is still there.

Applying the suggested fix makes gopls to send workspace/applyEdit back that updates go.mod into an unsaved state.
I also noticed that gopls creates a go.sum file on the file system.

Saving go.mod do make the diagnostic go away.

gopls.log:

serve.go:414: debug server listening at http://localhost:40415
[Trace - 22:53:24.703 PM] Sending request 'initialize - (1)'.
Params: {"processId":0,"clientInfo":{"name":""},"rootUri":"file:///tmp/tmp.Qf2Bx3OXte","capabilities":{"Workspace":{"workspaceEdit":{"changeAnnotationSupport":{}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"symbolKind":{},"tagSupport":{"valueSet":null}},"executeCommand":{},"semanticTokens":{},"codeLens":{},"fileOperations":{},"configuration":true},"textDocument":{"synchronization":{},"completion":{"completionItem":{"tagSupport":{"valueSet":null},"resolveSupport":{"properties":null},"insertTextModeSupport":{"valueSet":null}},"completionItemKind":{}},"hover":{"contentFormat":["plaintext"]},"signatureHelp":{"signatureInformation":{"parameterInformation":{}}},"declaration":{},"definition":{},"typeDefinition":{},"implementation":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{},"tagSupport":{"valueSet":null}},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":null}},"resolveSupport":{"properties":null}},"codeLens":{},"documentLink":{},"colorProvider":{},"formatting":{},"rangeFormatting":{},"onTypeFormatting":{},"rename":{},"foldingRange":{},"selectionRange":{},"publishDiagnostics":{"tagSupport":{"valueSet":null}},"callHierarchy":{},"semanticTokens":{"requests":{},"tokenTypes":null,"tokenModifiers":null,"formats":null},"linkedEditingRange":{},"moniker":{}},"Window":{"showMessage":{"messageActionItem":{}},"showDocument":{"support":false},"workDoneProgress":true},"general":{"staleRequestSupport":{"cancel":false,"retryOnContentModified":null},"regularExpressions":{"engine":""},"markdown":{"parser":""}}},"initializationOptions":{"allowModfileModifications":false,"symbolMatcher":"fuzzy","symbolStyle":"full"},"workspaceFolders":null}


[Trace - 22:53:24.706 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/19 22:53:24 Handshake session update\n\tupdate_session=8\n\tdebug_address=\"127.0.0.1:40415\"\n\tlogfile=\"/tmp/gopls_20210219_2253_24_878196270.log\"\n\tserver=\"1\"\n\tgopls_path=\"/home/leitzler/.vim/plugged/govim/cmd/govim/.bin/a8b8ff21e5a8e67a4f251e7d4d6d67c7a49b5a43/gopls\"\n"}


[Trace - 22:53:24.759 PM] Received response 'initialize - (1)' in 56ms.
Result: {"capabilities":{"textDocumentSync":{"change":2,"openClose":true,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":true,"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.run_tests","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor"]},"callHierarchyProvider":true},"serverInfo":{"name":"gopls","version":"{\"path\":\"golang.org/x/tools/gopls\",\"version\":\"v0.0.0-20210219012152-f3748ed8ec89\",\"sum\":\"h1:gv7t9S5r+UFeolH4lCH46k4fF0kVo1iQJMQ5/kM5BzA=\",\"deps\":[{\"path\":\"github.com/BurntSushi/toml\",\"version\":\"v0.3.1\",\"sum\":\"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\"},{\"path\":\"github.com/google/go-cmp\",\"version\":\"v0.5.4\",\"sum\":\"h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=\"},{\"path\":\"github.com/sergi/go-diff\",\"version\":\"v1.1.0\",\"sum\":\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\"},{\"path\":\"golang.org/x/mod\",\"version\":\"v0.4.1\",\"sum\":\"h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=\"},{\"path\":\"golang.org/x/sync\",\"version\":\"v0.0.0-20201020160332-67f06af15bc9\",\"sum\":\"h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=\"},{\"path\":\"golang.org/x/sys\",\"version\":\"v0.0.0-20210124154548-22da62e12c0c\",\"sum\":\"h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=\"},{\"path\":\"golang.org/x/tools\",\"version\":\"v0.1.1-0.20210219012152-f3748ed8ec89\",\"sum\":\"h1:CEQ9B2ID7kyvD17eBaAu+yYOtnawoOFcUxxtCVRBPzo=\"},{\"path\":\"golang.org/x/xerrors\",\"version\":\"v0.0.0-20200804184101-5ec99f83aff1\",\"sum\":\"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\"},{\"path\":\"honnef.co/go/tools\",\"version\":\"v0.1.1\",\"sum\":\"h1:EVDuO03OCZwpV2t/tLLxPmPiomagMoBOgfPt0FM+4IY=\"},{\"path\":\"mvdan.cc/gofumpt\",\"version\":\"v0.1.0\",\"sum\":\"h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=\"},{\"path\":\"mvdan.cc/xurls/v2\",\"version\":\"v2.2.0\",\"sum\":\"h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\"}]}"}}


[Trace - 22:53:24.761 PM] Sending notification 'initialized'.
Params: {}


[Trace - 22:53:24.762 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"894385949183117216"}


[Trace - 22:53:24.770 PM] Sending response 'window/workDoneProgress/create - (1)' in 8ms.
Result:


[Trace - 22:53:24.771 PM] Received notification '$/progress'.
Params: {"token":"894385949183117216","value":{"kind":"begin","message":"Loading packages...","title":"Setting up workspace"}}


[Trace - 22:53:24.771 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.Qf2Bx3OXte","section":"gopls"}]}


[Trace - 22:53:24.773 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Qf2Bx3OXte/go.mod","languageId":"go.mod","version":1,"text":"module x\n\ngo 1.17\n"}}


[Trace - 22:53:24.778 PM] Sending response 'workspace/configuration - (2)' in 6ms.
Result: [{"analyses":{"fieldalignment":true,"fillstruct":true},"codelenses":{"gc_details":true},"hoverKind":"FullDocumentation","staticcheck":true,"tempModfile":true}]


[Trace - 22:53:24.851 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/19 22:53:24 go env for /tmp/tmp.Qf2Bx3OXte\n(root /tmp/tmp.Qf2Bx3OXte)\n(go version go version go1.16 linux/amd64)\n(valid build configuration = true)\n(build flags: [])\nGOPRIVATE=\nGOPROXY=https://proxy.golang.org,direct\nGOROOT=/usr/local/go\nGOMODCACHE=/home/leitzler/go/pkg/mod\nGOPATH=/home/leitzler/go\nGOSUMDB=sum.golang.org\nGONOPROXY=\nGONOSUMDB=\nGOINSECURE=\nGOMOD=/tmp/tmp.Qf2Bx3OXte/go.mod\nGO111MODULE=\nGOCACHE=/home/leitzler/.cache/go-build\nGOFLAGS=\n\n"}


[Trace - 22:53:24.948 PM] Received notification '$/progress'.
Params: {"token":"894385949183117216","value":{"kind":"end","message":"Finished loading packages."}}


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


[Trace - 22:53:24.957 PM] Sending response 'client/registerCapability - (3)' in 0ms.
Result:


[Trace - 22:53:24.957 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/19 22:53:24 go/packages.Load\n\tsnapshot=0\n\tdirectory=/tmp/tmp.Qf2Bx3OXte\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:53:24.957 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:24 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=0\n"}


[Trace - 22:53:24.958 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}


[Trace - 22:53:24.958 PM] Sending response 'client/registerCapability - (4)' in 0ms.
Result:


[Trace - 22:53:24.966 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.Qf2Bx3OXte/main.go","diagnostics":[{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":23}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import rsc.io/quote (no required module provides package \"rsc.io/quote\")"}]}


[Trace - 22:53:24.966 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:24 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:53:25.312 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/19 22:53:25 go/packages.Load\n\tsnapshot=1\n\tdirectory=/tmp/tmp.Qf2Bx3OXte\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:53:25.313 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:25 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=1\n"}


[Trace - 22:53:25.320 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:25 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:53:27.867 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Qf2Bx3OXte/main.go","languageId":"go","version":1,"text":"package main\n\nimport _ \"rsc.io/quote\"\n\nfunc main() {}\n"}}


[Trace - 22:53:27.869 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:27 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=2\n"}


[Trace - 22:53:28.128 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:28 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:53:28.133 PM] Sending request 'textDocument/documentHighlight - (2)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Qf2Bx3OXte/main.go"},"position":{"line":2,"character":9}}


[Trace - 22:53:28.135 PM] Received response 'textDocument/documentHighlight - (2)' in 2ms.
Result: [{"range":{"start":{"line":2,"character":7},"end":{"line":2,"character":23}},"kind":1}]


[Trace - 22:53:31.171 PM] Sending request 'textDocument/codeAction - (3)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Qf2Bx3OXte/main.go"},"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":9}},"context":{"diagnostics":[{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":23}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import rsc.io/quote (no required module provides package \"rsc.io/quote\")"}],"only":["quickfix"]}}


[Trace - 22:53:31.174 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:31 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:53:31.174 PM] Received response 'textDocument/codeAction - (3)' in 2ms.
Result: [{"title":"go get package rsc.io/quote","kind":"quickfix","diagnostics":[{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":23}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import rsc.io/quote (no required module provides package \"rsc.io/quote\")"}],"edit":{},"command":{"title":"go get package rsc.io/quote","command":"gopls.go_get_package","arguments":[{"URI":"file:///tmp/tmp.Qf2Bx3OXte/main.go","Pkg":"rsc.io/quote","AddRequire":true}]}}]


[Trace - 22:53:32.480 PM] Sending request 'workspace/executeCommand - (4)'.
Params: {"command":"gopls.go_get_package","arguments":[{"URI":"file:///tmp/tmp.Qf2Bx3OXte/main.go","Pkg":"rsc.io/quote","AddRequire":true}]}


[Trace - 22:53:32.481 PM] Received request 'window/workDoneProgress/create - (5)'.
Params: {"token":"2775422040480279449"}


[Trace - 22:53:32.482 PM] Sending response 'window/workDoneProgress/create - (5)' in 0ms.
Result:


[Trace - 22:53:32.483 PM] Received notification '$/progress'.
Params: {"token":"2775422040480279449","value":{"cancellable":true,"kind":"begin","message":"Running...","title":"Running go get"}}


[Trace - 22:53:32.812 PM] Received request 'workspace/applyEdit - (6)'.
Params: {"edit":{"documentChanges":[{"textDocument":{"version":1,"uri":"file:///tmp/tmp.Qf2Bx3OXte/go.mod"},"edits":[{"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":0}},"newText":"\nrequire rsc.io/quote v1.5.2\n"}]}]}}


[Trace - 22:53:32.813 PM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///tmp/tmp.Qf2Bx3OXte/go.sum","type":1}]}


[Trace - 22:53:32.813 PM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///tmp/tmp.Qf2Bx3OXte/go.sum","type":2}]}


[Trace - 22:53:32.816 PM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"version":2,"uri":"file:///tmp/tmp.Qf2Bx3OXte/go.mod"},"contentChanges":[{"text":"module x\n\ngo 1.17\n\nrequire rsc.io/quote v1.5.2\n"}]}


[Trace - 22:53:32.817 PM] Sending response 'workspace/applyEdit - (6)' in 5ms.
Result: {"applied":true}


[Trace - 22:53:32.818 PM] Received response 'workspace/executeCommand - (4)' in 337ms.
Result: null


[Trace - 22:53:32.818 PM] Received notification '$/progress'.
Params: {"token":"2775422040480279449","value":{"kind":"end","message":"completed"}}


[Trace - 22:53:32.939 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/19 22:53:32 go/packages.Load\n\tsnapshot=3\n\tdirectory=/tmp/tmp.Qf2Bx3OXte\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:53:32.940 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:32 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=3\n"}


[Trace - 22:53:33.042 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/19 22:53:33 go/packages.Load\n\tsnapshot=4\n\tdirectory=/tmp/tmp.Qf2Bx3OXte\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:53:33.042 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:33 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=4\n"}


[Trace - 22:53:33.296 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/19 22:53:33 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=5\n"}
@gopherbot gopherbot added this to the Unreleased milestone Feb 19, 2021
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 20, 2021

Thanks for the report, but I'm actually not able to reproduce this in VS Code. Can you please share a log with the "verboseOutput" setting enabled?

@stamblerre stamblerre removed this from the Unreleased milestone Feb 20, 2021
@stamblerre stamblerre added this to the gopls/v1.0.0 milestone Feb 20, 2021
@leitzler
Copy link
Contributor Author

@leitzler leitzler commented Feb 20, 2021

Sure!

I think the key point is that go.mod must be opened in the editor so that gopls send workspace/applyEdit, and the editor not saving the file to disk directly.

Log:

[Trace - 22:23:51.239 PM] Sending request 'initialize - (1)'.
Params: {"processId":0,"clientInfo":{"name":""},"rootUri":"file:///tmp/tmp.Tzng9DVxws","capabilities":{"Workspace":{"workspaceEdit":{"changeAnnotationSupport":{}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"symbolKind":{},"tagSupport":{"valueSet":null}},"executeCommand":{},"semanticTokens":{},"codeLens":{},"fileOperations":{},"configuration":true},"textDocument":{"synchronization":{},"completion":{"completionItem":{"tagSupport":{"valueSet":null},"resolveSupport":{"properties":null},"insertTextModeSupport":{"valueSet":null}},"completionItemKind":{}},"hover":{"contentFormat":["plaintext"]},"signatureHelp":{"signatureInformation":{"parameterInformation":{}}},"declaration":{},"definition":{},"typeDefinition":{},"implementation":{},"references":{},"documentHighlight":{},"documentSymbol":{"symbolKind":{},"tagSupport":{"valueSet":null}},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":null}},"resolveSupport":{"properties":null}},"codeLens":{},"documentLink":{},"colorProvider":{},"formatting":{},"rangeFormatting":{},"onTypeFormatting":{},"rename":{},"foldingRange":{},"selectionRange":{},"publishDiagnostics":{"tagSupport":{"valueSet":null}},"callHierarchy":{},"semanticTokens":{"requests":{},"tokenTypes":null,"tokenModifiers":null,"formats":null},"linkedEditingRange":{},"moniker":{}},"Window":{"showMessage":{"messageActionItem":{}},"showDocument":{"support":false},"workDoneProgress":true},"general":{"staleRequestSupport":{"cancel":false,"retryOnContentModified":null},"regularExpressions":{"engine":""},"markdown":{"parser":""}}},"initializationOptions":{"allowModfileModifications":false,"symbolMatcher":"fuzzy","symbolStyle":"full"},"workspaceFolders":null}


[Trace - 22:23:51.241 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 Handshake session update\n\tupdate_session=3\n\tdebug_address=\"127.0.0.1:33813\"\n\tlogfile=\"/tmp/gopls_20210220_2223_51_648531651.log\"\n\tserver=\"1\"\n\tgopls_path=\"/home/leitzler/.vim/plugged/govim/cmd/govim/.bin/a8b8ff21e5a8e67a4f251e7d4d6d67c7a49b5a43/gopls\"\n"}


[Trace - 22:23:51.299 PM] Received response 'initialize - (1)' in 60ms.
Result: {"capabilities":{"textDocumentSync":{"change":2,"openClose":true,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":true,"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.run_tests","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor"]},"callHierarchyProvider":true},"serverInfo":{"name":"gopls","version":"{\"path\":\"golang.org/x/tools/gopls\",\"version\":\"v0.0.0-20210219012152-f3748ed8ec89\",\"sum\":\"h1:gv7t9S5r+UFeolH4lCH46k4fF0kVo1iQJMQ5/kM5BzA=\",\"deps\":[{\"path\":\"github.com/BurntSushi/toml\",\"version\":\"v0.3.1\",\"sum\":\"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\"},{\"path\":\"github.com/google/go-cmp\",\"version\":\"v0.5.4\",\"sum\":\"h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=\"},{\"path\":\"github.com/sergi/go-diff\",\"version\":\"v1.1.0\",\"sum\":\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\"},{\"path\":\"golang.org/x/mod\",\"version\":\"v0.4.1\",\"sum\":\"h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=\"},{\"path\":\"golang.org/x/sync\",\"version\":\"v0.0.0-20201020160332-67f06af15bc9\",\"sum\":\"h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=\"},{\"path\":\"golang.org/x/sys\",\"version\":\"v0.0.0-20210124154548-22da62e12c0c\",\"sum\":\"h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=\"},{\"path\":\"golang.org/x/tools\",\"version\":\"v0.1.1-0.20210219012152-f3748ed8ec89\",\"sum\":\"h1:CEQ9B2ID7kyvD17eBaAu+yYOtnawoOFcUxxtCVRBPzo=\"},{\"path\":\"golang.org/x/xerrors\",\"version\":\"v0.0.0-20200804184101-5ec99f83aff1\",\"sum\":\"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\"},{\"path\":\"honnef.co/go/tools\",\"version\":\"v0.1.1\",\"sum\":\"h1:EVDuO03OCZwpV2t/tLLxPmPiomagMoBOgfPt0FM+4IY=\"},{\"path\":\"mvdan.cc/gofumpt\",\"version\":\"v0.1.0\",\"sum\":\"h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=\"},{\"path\":\"mvdan.cc/xurls/v2\",\"version\":\"v2.2.0\",\"sum\":\"h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\"}]}"}}


[Trace - 22:23:51.301 PM] Sending notification 'initialized'.
Params: {}


[Trace - 22:23:51.302 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"4037200794235010051"}


[Trace - 22:23:51.311 PM] Sending response 'window/workDoneProgress/create - (1)' in 8ms.
Result:


[Trace - 22:23:51.312 PM] Received notification '$/progress'.
Params: {"token":"4037200794235010051","value":{"kind":"begin","message":"Loading packages...","title":"Setting up workspace"}}


[Trace - 22:23:51.313 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.Tzng9DVxws","section":"gopls"}]}


[Trace - 22:23:51.315 PM] Sending response 'workspace/configuration - (2)' in 2ms.
Result: [{"analyses":{"fieldalignment":true,"fillstruct":true},"codelenses":{"gc_details":true},"hoverKind":"FullDocumentation","staticcheck":true,"tempModfile":true,"verboseOutput":true}]


[Trace - 22:23:51.319 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Tzng9DVxws/go.mod","languageId":"go.mod","version":1,"text":"module x\n\ngo 1.17\n"}}


[Trace - 22:23:51.414 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go env for /tmp/tmp.Tzng9DVxws\n(root /tmp/tmp.Tzng9DVxws)\n(go version go version devel +9a99515c8f Fri Feb 19 12:23:42 2021 -0800 linux/amd64)\n(valid build configuration = true)\n(build flags: [])\nGONOPROXY=\nGONOSUMDB=\nGOPROXY=https://proxy.golang.org,direct\nGOCACHE=/home/leitzler/.cache/go-build\nGOPRIVATE=\nGOROOT=/home/leitzler/sdk/gotip\nGOMODCACHE=/home/leitzler/go/pkg/mod\nGOINSECURE=\nGOMOD=/tmp/tmp.Tzng9DVxws/go.mod\nGO111MODULE=\nGOPATH=/home/leitzler/go\nGOSUMDB=sum.golang.org\nGOFLAGS=\n\n"}


[Trace - 22:23:51.429 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 16.578974ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.607240280.mod -mod=readonly -f \"{{context.GOARCH}} {{context.Compiler}}\" -- unsafe\n"}


[Trace - 22:23:51.456 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 39.55041ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/tmp/tmp.Tzng9DVxws go list -e -f {{context.ReleaseTags}}\n"}


[Trace - 22:23:51.510 PM] Received notification '$/progress'.
Params: {"token":"4037200794235010051","value":{"kind":"end","message":"Finished loading packages."}}


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


[Trace - 22:23:51.517 PM] Sending response 'client/registerCapability - (3)' in 0ms.
Result:


[Trace - 22:23:51.518 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 69.623092ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.607240280.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin x/...\n"}


[Trace - 22:23:51.518 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go/packages.Load\n\tsnapshot=0\n\tdirectory=/tmp/tmp.Tzng9DVxws\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:23:51.519 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go/packages.Load\n\tsnapshot=0\n\tpackage=\"builtin\"\n\tfiles=[/home/leitzler/sdk/gotip/src/builtin/builtin.go]\n"}


[Trace - 22:23:51.520 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go/packages.Load\n\tsnapshot=0\n\tpackage=\"x\"\n\tfiles=[/tmp/tmp.Tzng9DVxws/main.go]\n"}


[Trace - 22:23:51.520 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:23:51 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=0\n"}


[Trace - 22:23:51.521 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}


[Trace - 22:23:51.521 PM] Sending response 'client/registerCapability - (4)' in 0ms.
Result:


[Trace - 22:23:51.530 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.Tzng9DVxws/main.go","diagnostics":[{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":23}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import rsc.io/quote (no required module provides package \"rsc.io/quote\")"}]}


[Trace - 22:23:51.530 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:23:51 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:23:51.787 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 13.082502ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.245906762.mod -mod=readonly -f \"{{context.GOARCH}} {{context.Compiler}}\" -- unsafe\n"}


[Trace - 22:23:51.808 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 33.380931ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=off GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -e -f {{context.ReleaseTags}}\n"}


[Trace - 22:23:51.872 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 63.412428ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.245906762.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin x/...\n"}


[Trace - 22:23:51.875 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go/packages.Load\n\tsnapshot=1\n\tdirectory=/tmp/tmp.Tzng9DVxws\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:23:51.875 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go/packages.Load\n\tsnapshot=1\n\tpackage=\"builtin\"\n\tfiles=[/home/leitzler/sdk/gotip/src/builtin/builtin.go]\n"}


[Trace - 22:23:51.875 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:23:51 go/packages.Load\n\tsnapshot=1\n\tpackage=\"x\"\n\tfiles=[/tmp/tmp.Tzng9DVxws/main.go]\n"}


[Trace - 22:23:51.875 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:23:51 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=1\n"}


[Trace - 22:23:51.881 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:23:51 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:23:55.972 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Tzng9DVxws/main.go","languageId":"go","version":1,"text":"package main\n\nimport _ \"rsc.io/quote\"\n\nfunc main() {}\n"}}


[Trace - 22:23:55.974 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:23:55 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=2\n"}


[Trace - 22:23:56.232 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:23:56 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:23:59.705 PM] Sending request 'textDocument/documentHighlight - (2)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Tzng9DVxws/main.go"},"position":{"line":2,"character":9}}


[Trace - 22:23:59.707 PM] Received response 'textDocument/documentHighlight - (2)' in 1ms.
Result: [{"range":{"start":{"line":2,"character":7},"end":{"line":2,"character":23}},"kind":1}]


[Trace - 22:24:00.615 PM] Sending request 'textDocument/codeAction - (3)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.Tzng9DVxws/main.go"},"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":9}},"context":{"diagnostics":[{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":23}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import rsc.io/quote (no required module provides package \"rsc.io/quote\")"}],"only":["quickfix"]}}


[Trace - 22:24:00.618 PM] Received response 'textDocument/codeAction - (3)' in 2ms.
Result: [{"title":"go get package rsc.io/quote","kind":"quickfix","diagnostics":[{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":23}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"pkg.go.dev/golang.org/x/tools/internal/typesinternal#BrokenImport"},"source":"compiler","message":"could not import rsc.io/quote (no required module provides package \"rsc.io/quote\")"}],"edit":{},"command":{"title":"go get package rsc.io/quote","command":"gopls.go_get_package","arguments":[{"URI":"file:///tmp/tmp.Tzng9DVxws/main.go","Pkg":"rsc.io/quote","AddRequire":true}]}}]


[Trace - 22:24:00.618 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:24:00 diagnosing go.mod: err: exit status 1: stderr: go: finding module for package rsc.io/quote\nx imports\n\trsc.io/quote: cannot find module providing package rsc.io/quote: module lookup disabled by GOPROXY=off\n\n"}


[Trace - 22:24:00.618 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:00 fixImports(filename=\"/tmp/tmp.Tzng9DVxws/main.go\"), abs=\"/tmp/tmp.Tzng9DVxws/main.go\", srcDir=\"/tmp/tmp.Tzng9DVxws\" ...\n"}


[Trace - 22:24:01.695 PM] Sending request 'workspace/executeCommand - (4)'.
Params: {"command":"gopls.go_get_package","arguments":[{"URI":"file:///tmp/tmp.Tzng9DVxws/main.go","Pkg":"rsc.io/quote","AddRequire":true}]}


[Trace - 22:24:01.696 PM] Received request 'window/workDoneProgress/create - (5)'.
Params: {"token":"3916589616287113937"}


[Trace - 22:24:01.697 PM] Sending response 'window/workDoneProgress/create - (5)' in 0ms.
Result:


[Trace - 22:24:01.699 PM] Received notification '$/progress'.
Params: {"token":"3916589616287113937","value":{"cancellable":true,"kind":"begin","message":"Running...","title":"Running go get"}}


[Trace - 22:24:02.085 PM] Received request 'workspace/applyEdit - (6)'.
Params: {"edit":{"documentChanges":[{"textDocument":{"version":1,"uri":"file:///tmp/tmp.Tzng9DVxws/go.mod"},"edits":[{"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":0}},"newText":"\nrequire rsc.io/quote v1.5.2\n"}]}]}}


[Trace - 22:24:02.087 PM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///tmp/tmp.Tzng9DVxws/go.sum","type":1}]}


[Trace - 22:24:02.087 PM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {"changes":[{"uri":"file:///tmp/tmp.Tzng9DVxws/go.sum","type":2}]}


[Trace - 22:24:02.090 PM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"version":2,"uri":"file:///tmp/tmp.Tzng9DVxws/go.mod"},"contentChanges":[{"text":"module x\n\ngo 1.17\n\nrequire rsc.io/quote v1.5.2\n"}]}


[Trace - 22:24:02.091 PM] Sending response 'workspace/applyEdit - (6)' in 5ms.
Result: {"applied":true}


[Trace - 22:24:02.092 PM] Received response 'workspace/executeCommand - (4)' in 397ms.
Result: null


[Trace - 22:24:02.092 PM] Received notification '$/progress'.
Params: {"token":"3916589616287113937","value":{"kind":"end","message":"completed"}}


[Trace - 22:24:02.122 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 23.255605ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.137840896.mod -mod=readonly -f \"{{context.GOARCH}} {{context.Compiler}}\" -- unsafe\n"}


[Trace - 22:24:02.143 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 47.384713ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=off GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -e -f {{context.ReleaseTags}}\n"}


[Trace - 22:24:02.213 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 67.061236ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.137840896.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin x/...\n"}


[Trace - 22:24:02.213 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 go/packages.Load\n\tsnapshot=3\n\tdirectory=/tmp/tmp.Tzng9DVxws\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:24:02.213 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 go/packages.Load\n\tsnapshot=3\n\tpackage=\"builtin\"\n\tfiles=[/home/leitzler/sdk/gotip/src/builtin/builtin.go]\n"}


[Trace - 22:24:02.213 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 go/packages.Load\n\tsnapshot=3\n\tpackage=\"x\"\n\tfiles=[/tmp/tmp.Tzng9DVxws/main.go]\n"}


[Trace - 22:24:02.213 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:24:02 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=3\n"}


[Trace - 22:24:02.227 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 13.886598ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.478366303.mod -mod=readonly -f \"{{context.GOARCH}} {{context.Compiler}}\" -- unsafe\n"}


[Trace - 22:24:02.248 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 35.633465ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=off GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -e -f {{context.ReleaseTags}}\n"}


[Trace - 22:24:02.314 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 64.837008ms for GOROOT=/home/leitzler/sdk/gotip GOPATH=/home/leitzler/go GO111MODULE=auto GOPROXY=off PWD=/tmp/tmp.Tzng9DVxws go list -modfile=/tmp/go.918a7e9a88298a6a52fdec050e2f48968633e949986d3dc1a1eebbc79a828757.478366303.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin x/...\n"}


[Trace - 22:24:02.315 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 go/packages.Load\n\tsnapshot=4\n\tdirectory=/tmp/tmp.Tzng9DVxws\n\tquery=[builtin x/...]\n\tpackages=2\n"}


[Trace - 22:24:02.316 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 go/packages.Load\n\tsnapshot=4\n\tpackage=\"builtin\"\n\tfiles=[/home/leitzler/sdk/gotip/src/builtin/builtin.go]\n"}


[Trace - 22:24:02.317 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/02/20 22:24:02 go/packages.Load\n\tsnapshot=4\n\tpackage=\"x\"\n\tfiles=[/tmp/tmp.Tzng9DVxws/main.go]\n"}


[Trace - 22:24:02.317 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:24:02 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=4\n"}


[Trace - 22:24:02.567 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/02/20 22:24:02 x: no dep handle for rsc.io/quote: no metadata for rsc.io/quote\n\tsnapshot=5\n"}

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 20, 2021

Saving go.mod do make the diagnostic go away.

Oh sorry, I totally missed this part. This is working as intended--you do need to save the file to resolve the diagnostic. This is a decision we've made in gopls--to only update metadata changes when a go.mod file has been saved. Otherwise, we would be invalidating and reloading metadata constantly as you typed in the go.mod file, which would be too expensive.

@leitzler
Copy link
Contributor Author

@leitzler leitzler commented Feb 20, 2021

That totally make sense! From a user perspective this is a slightly different case than typing, as the user is applying a suggested fix (from another file, in this case main.go).

Other suggested fixes applied makes the suggested fix go away while this sticks around until you realise that you have to switch to go.mod and save it.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 21, 2021

From a user perspective this is a slightly different case than typing, as the user is applying a suggested fix (from another file, in this case main.go).

That's fair, but it would be tricky to get right on the gopls side because the applied edit just comes in as a typical textDocument/didChange. /cc @heschik to get his thoughts

@heschi
Copy link
Contributor

@heschi heschi commented Feb 23, 2021

I think it'd make sense to force a metadata load after a quick fix finishes. As long as the didChange always comes in before applyEdit returns, which seems like the most reasonable client implementation, I don't think it's particularly racy or difficult.

@stamblerre stamblerre added this to To Do in gopls on-deck Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants