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: couldn't start client gopls #39987

Closed
leetrout opened this issue Jul 2, 2020 · 11 comments
Closed

x/tools/gopls: couldn't start client gopls #39987

leetrout opened this issue Jul 2, 2020 · 11 comments

Comments

@leetrout
Copy link

@leetrout leetrout commented Jul 2, 2020

What did you do?

Tried to open a go file from the command line with code <relative filepath>.

What did you expect to see?

Go language features working in VS code.

What did you see instead?

[Error - 8:05:11 PM] Starting client failed
  Message: unsupported URI scheme:  (gopls only supports file URIs)
  Code: 0 
[Error - 8:05:50 PM] Starting client failed
  Message: unsupported URI scheme:  (gopls only supports file URIs)
  Code: 0 
gopls: failed reading header line: EOF

Edit 2020-07-02 9:54 EDT

Additional logs:

[Trace - 09:54:21.306 AM] Sending request 'initialize - (0)'.
Params: {
	"processId": 7234,
	"clientInfo": {
		"name": "vscode",
		"version": "1.46.1"
	},
	"rootPath": null,
	"rootUri": null,
	"capabilities": {
		"workspace": {
			"applyEdit": true,
			"workspaceEdit": {
				"documentChanges": true,
				"resourceOperations": ["create", "rename", "delete"],
				"failureHandling": "textOnlyTransactional"
			},
			"didChangeConfiguration": {
				"dynamicRegistration": true
			},
			"didChangeWatchedFiles": {
				"dynamicRegistration": true
			},
			"symbol": {
				"dynamicRegistration": true,
				"symbolKind": {
					"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
				}
			},
			"executeCommand": {
				"dynamicRegistration": true
			},
			"configuration": true,
			"workspaceFolders": true
		},
		"textDocument": {
			"publishDiagnostics": {
				"relatedInformation": true,
				"versionSupport": false,
				"tagSupport": {
					"valueSet": [1, 2]
				}
			},
			"synchronization": {
				"dynamicRegistration": true,
				"willSave": true,
				"willSaveWaitUntil": true,
				"didSave": true
			},
			"completion": {
				"dynamicRegistration": true,
				"contextSupport": true,
				"completionItem": {
					"snippetSupport": true,
					"commitCharactersSupport": true,
					"documentationFormat": ["markdown", "plaintext"],
					"deprecatedSupport": true,
					"preselectSupport": true,
					"tagSupport": {
						"valueSet": [1]
					}
				},
				"completionItemKind": {
					"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
				}
			},
			"hover": {
				"dynamicRegistration": true,
				"contentFormat": ["markdown", "plaintext"]
			},
			"signatureHelp": {
				"dynamicRegistration": true,
				"signatureInformation": {
					"documentationFormat": ["markdown", "plaintext"],
					"parameterInformation": {
						"labelOffsetSupport": true
					}
				},
				"contextSupport": true
			},
			"definition": {
				"dynamicRegistration": true,
				"linkSupport": true
			},
			"references": {
				"dynamicRegistration": true
			},
			"documentHighlight": {
				"dynamicRegistration": true
			},
			"documentSymbol": {
				"dynamicRegistration": true,
				"symbolKind": {
					"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
				},
				"hierarchicalDocumentSymbolSupport": true
			},
			"codeAction": {
				"dynamicRegistration": true,
				"isPreferredSupport": true,
				"codeActionLiteralSupport": {
					"codeActionKind": {
						"valueSet": ["", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports"]
					}
				}
			},
			"codeLens": {
				"dynamicRegistration": true
			},
			"formatting": {
				"dynamicRegistration": true
			},
			"rangeFormatting": {
				"dynamicRegistration": true
			},
			"onTypeFormatting": {
				"dynamicRegistration": true
			},
			"rename": {
				"dynamicRegistration": true,
				"prepareSupport": true
			},
			"documentLink": {
				"dynamicRegistration": true,
				"tooltipSupport": true
			},
			"typeDefinition": {
				"dynamicRegistration": true,
				"linkSupport": true
			},
			"implementation": {
				"dynamicRegistration": true,
				"linkSupport": true
			},
			"colorProvider": {
				"dynamicRegistration": true
			},
			"foldingRange": {
				"dynamicRegistration": true,
				"rangeLimit": 5000,
				"lineFoldingOnly": true
			},
			"declaration": {
				"dynamicRegistration": true,
				"linkSupport": true
			},
			"selectionRange": {
				"dynamicRegistration": true
			}
		},
		"window": {
			"workDoneProgress": true
		}
	},
	"initializationOptions": {},
	"trace": "off",
	"workspaceFolders": null
}


[Error - Received] 09:54:21.306 AM #0 unsupported URI scheme:  (gopls only supports file URIs)


[Error - 9:54:21 AM] Starting client failed
  Message: unsupported URI scheme:  (gopls only supports file URIs)
  Code: 0 
[Trace - 09:54:21.309 AM] Sending request 'shutdown - (1)'.
Params: 


[Trace - 09:54:21.309 AM] Received response 'shutdown - (1)' in 0ms.
Result: null


[Trace - 09:54:21.309 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 09:54:21 Shutdown session\n\tshutdown_session=1\n"}


[Trace - 09:54:21.309 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 09:54:21 server shutdown without initialization\n"}


[Trace - 09:54:21.312 AM] Sending notification 'exit'.
Params: 


gopls: failed reading header line: EOF

Build info

    golang.org/x/tools/gopls 0.4.2
    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go info

go version go1.14.3 linux/amd64

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 2, 2020

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

@gopherbot gopherbot added this to the Unreleased milestone Jul 2, 2020
@cerezo074
Copy link

@cerezo074 cerezo074 commented Jul 2, 2020

Hi there, I'm facing the same issue opening VSC at any time.

GO version go1.14.3 darwin/amd64
VSC Version: 1.46.1, Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
OS X version 10.15.3 (19D76)

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 2, 2020

Thanks for the reports.

@leetrout: Do you mind sharing the full log for gopls? Specifically I'd be curious to see the file URI that VS Code provided in the textDocument/didOpen request.

@cerezo074: If you could also share your logs, that'd be very helpful. Details on how to do so in the Troubleshooting guide.

@stamblerre stamblerre changed the title x/tools/gopls: Couldn't start client gopls x/tools/gopls: couldn't start client gopls Jul 2, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Jul 2, 2020
@karaatanassov
Copy link

@karaatanassov karaatanassov commented Jul 2, 2020

I have roughly similar setup i.e. MacOS gopls 4.2 etc.

Below is the log with "--rpc.trace" flag. I cannot find the URI at fault

[Trace - 13:57:02.338 PM] Sending request 'initialize - (0)'.
Params: {"processId":22676,"clientInfo":{"name":"vscode","version":"1.46.1"},"rootPath":null,"rootUri":null,"capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":null}


[Error - Received] 13:57:02.339 PM #0 unsupported URI scheme:  (gopls only supports file URIs)


[Error - 1:57:02 PM] Starting client failed
  Message: unsupported URI scheme:  (gopls only supports file URIs)
  Code: 0 
[Trace - 13:57:02.341 PM] Sending request 'shutdown - (1)'.
Params: 


[Trace - 13:57:02.341 PM] Received response 'shutdown - (1)' in 0ms.
Result: null


[Trace - 13:57:02.341 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 13:57:02 server shutdown without initialization\n"}


[Trace - 13:57:02.341 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 13:57:02 Shutdown session\n\tshutdown_session=1\n"}


[Trace - 13:57:02.345 PM] Sending notification 'exit'.
Params: 


gopls: failed reading header line: EOF

Below are the details of my setup

Build info

golang.org/x/tools/gopls 0.4.2
    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go info

go version go1.14.2 darwin/amd64

@leetrout
Copy link
Author

@leetrout leetrout commented Jul 2, 2020

I've added additional logs in the original issue description.

Per this reddit thread I can confirm opening a directory works...

code .

It looks related to rootPath and/or rootUri being null in the debug output above compared to the debug output below when it runs successfully.

[Trace - 09:58:00.468 AM] Sending request 'initialize - (0)'.
Params: {"processId":8541,"clientInfo":{"name":"vscode","version":"1.46.1"},"rootPath":"/home/user/scratch/debug","rootUri":"file:///home/user/scratch/debug","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///home/user/scratch/debug","name":"debug"}]}


[Trace - 09:58:00.472 AM] Received response 'initialize - (0)' in 4ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["test","tidy","upgrade_dependency","generate","regenerate_cgo"]},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"Build info\n----------\ngolang.org/x/tools/gopls 0.4.2\n    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=\n    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=\n    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=\n    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=\n    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n\nGo info\n-------\ngo version go1.14.3 linux/amd64\n\n"}}


[Trace - 09:58:00.473 AM] Sending notification 'initialized'.
Params: {}


[Trace - 09:58:00.473 AM] Received request 'client/registerCapability - (1)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"},{"id":"workspace/didChangeWatchedFiles","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.go","kind":7}]}}]}


[Trace - 09:58:00.477 AM] Sending response 'client/registerCapability - (1)' in 3ms.
Result: 


[Trace - 09:58:00.484 AM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///home/user/scratch/debug","section":"gopls"},{"scopeUri":"file:///home/user/scratch/debug","section":"gopls-debug"}]}


[Trace - 09:58:00.484 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 09:58:00 Build info\n----------\ngolang.org/x/tools/gopls 0.4.2\n    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=\n    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=\n    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=\n    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=\n    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n\nGo info\n-------\ngo version go1.14.3 linux/amd64\n\n\n"}


[Info  - 9:58:00 AM] 2020/07/02 09:58:00 Build info
----------
golang.org/x/tools/gopls 0.4.2
    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go info
-------
go version go1.14.3 linux/amd64



[Trace - 09:58:00.484 AM] Sending response 'workspace/configuration - (2)' in 0ms.
Result: [null,null]


[Trace - 09:58:00.526 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 09:58:00 go/packages.Load\n\tsnapshot=0\n\tdirectory=/home/user/scratch/debug\n\tquery=[./ builtin]\n\tpackages=2\n"}


[Info  - 9:58:00 AM] 2020/07/02 09:58:00 go/packages.Load
	snapshot=0
	directory=/home/user/scratch/debug
	query=[./ builtin]
	packages=2

[Trace - 09:58:00.552 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 09:58:00 go env for /home/user/scratch/debug\n(valid build configuration = false)\n(build flags: [])\nGO111MODULE=\"\"\nGOARCH=\"amd64\"\nGOBIN=\"\"\nGOCACHE=\"/home/user/.cache/go-build\"\nGOENV=\"/home/user/.config/go/env\"\nGOEXE=\"\"\nGOFLAGS=\"\"\nGOHOSTARCH=\"amd64\"\nGOHOSTOS=\"linux\"\nGOINSECURE=\"\"\nGONOPROXY=\"\"\nGONOSUMDB=\"\"\nGOOS=\"linux\"\nGOPATH=\"/home/user/.asdf/installs/golang/1.14.3/packages\"\nGOPRIVATE=\"\"\nGOPROXY=\"https://proxy.golang.org,direct\"\nGOROOT=\"/home/user/.asdf/installs/golang/1.14.3/go\"\nGOSUMDB=\"sum.golang.org\"\nGOTMPDIR=\"\"\nGOTOOLDIR=\"/home/user/.asdf/installs/golang/1.14.3/go/pkg/tool/linux_amd64\"\nGCCGO=\"gccgo\"\nAR=\"ar\"\nCC=\"gcc\"\nCXX=\"g++\"\nCGO_ENABLED=\"1\"\nGOMOD=\"\"\nCGO_CFLAGS=\"-g -O2\"\nCGO_CPPFLAGS=\"\"\nCGO_CXXFLAGS=\"-g -O2\"\nCGO_FFLAGS=\"-g -O2\"\nCGO_LDFLAGS=\"-g -O2\"\nPKG_CONFIG=\"pkg-config\"\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build205966988=/tmp/go-build -gno-record-gcc-switches\"\n\n"}


[Info  - 9:58:00 AM] 2020/07/02 09:58:00 go env for /home/user/scratch/debug
(valid build configuration = false)
(build flags: [])
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/user/.asdf/installs/golang/1.14.3/packages"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/user/.asdf/installs/golang/1.14.3/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/user/.asdf/installs/golang/1.14.3/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build205966988=/tmp/go-build -gno-record-gcc-switches"


[Trace - 09:58:00.555 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 09:58:00 go/packages.Load\n\tsnapshot=0\n\tdirectory=/home/user/scratch/debug\n\tquery=[./]\n\tpackages=1\n"}


[Info  - 9:58:00 AM] 2020/07/02 09:58:00 go/packages.Load
	snapshot=0
	directory=/home/user/scratch/debug
	query=[./]
	packages=1
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 2, 2020

Thank you for sharing the logs. It looks like both the rootURI and the workspace folders are null when you start VS Code. How are you opening it?

@leetrout: I see you are opening code with a relative file path. Is this path to a directory or a single file? We have only just added support for opening a single file, and it's not part of v0.4.2.

@leetrout
Copy link
Author

@leetrout leetrout commented Jul 2, 2020

We have only just added support for opening a single file, and it's not part of v0.4.2.

@stamblerre I don't think I ever noticed that it didn't work! 🤔

So to clarify (my apologies it wasn't clear):

  • it is failing when I try to open a single Go file from my shell with code myfile.go
  • It is working if I open the directory with code .
  • it is working if VS Code is already open with the directory for the file in the workspace and I use code myfile.go
[Trace - 13:22:35.129 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/user/scratch/debug/main.go","languageId":"go","version":1,"text":""}}


[Trace - 13:22:35.129 PM] Sending request 'textDocument/documentLink - (1)'.
Params: {"textDocument":{"uri":"file:///home/user/scratch/debug/main.go"}}


[Trace - 13:22:35.130 PM] Sending request 'textDocument/documentSymbol - (2)'.
Params: {"textDocument":{"uri":"file:///home/user/scratch/debug/main.go"}}


[Trace - 13:22:35.133 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 13:22:35 go/packages.Load\n\tsnapshot=1\n\tdirectory=/home/user/scratch/debug\n\tquery=[./]\n\tpackages=1\n"}


[Trace - 13:22:35.144 PM] Received response 'textDocument/documentLink - (1)' in 14ms.
Result: null


[Trace - 13:22:35.144 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 13:22:35 go/packages.Load\n\tsnapshot=1\n\tdirectory=/home/user/scratch/debug\n\tquery=[file=/home/user/scratch/debug/main.go]\n\tpackages=0\n"}


[Trace - 13:22:35.144 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/07/02 13:22:35 failed to compute document links: no PackageHandles\n\tURI=file:///home/user/scratch/debug/main.go\n"}


[Trace - 13:22:35.144 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 13:22:35 go/packages.Load\n\tsnapshot=1\n\tdirectory=/home/user/scratch/debug\n\tquery=[file=/home/user/scratch/debug/main.go]\n\tpackages=0\n"}


[Info  - 1:22:35 PM] 2020/07/02 13:22:35 go/packages.Load
	snapshot=1
	directory=/home/user/scratch/debug
	query=[./]
	packages=1

[Trace - 13:22:35.156 PM] Received response 'textDocument/documentSymbol - (2)' in 26ms.
Result: []


[Trace - 13:22:35.156 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/07/02 13:22:35 DocumentSymbols failed: getting file for DocumentSymbols: no PackageHandles\n\tURI=file:///home/user/scratch/debug/main.go\n"}


[Trace - 13:22:35.156 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/07/02 13:22:35 go/packages.Load\n\tsnapshot=1\n\tdirectory=/home/user/scratch/debug\n\tquery=[file=/home/user/scratch/debug/main.go]\n\tpackages=0\n"}


[Info  - 1:22:35 PM] 2020/07/02 13:22:35 go/packages.Load
	snapshot=1
	directory=/home/user/scratch/debug
	query=[file=/home/user/scratch/debug/main.go]
	packages=0

<cut all the errors for features failing because it was an empty go file>
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 3, 2020

Yep - that sounds about right. We will support just opening a single file in the next version (the change just went in - https://golang.org/cl/240099).

Can we close this issue or is there anything else to address?

@leetrout
Copy link
Author

@leetrout leetrout commented Jul 3, 2020

Yep, will close! Thank you so much for the quick responses!

@hyangah
Copy link
Contributor

@hyangah hyangah commented Jul 9, 2020

Can this be marked as a 0.4.4 milestone item?

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.4 Jul 9, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 9, 2020

Done - just created a 0.4.4 milestone.

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

Successfully merging a pull request may close this issue.

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