-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: error loading workspace folders #68846
Comments
Hi, I did go through the docs and made changes:
Specific error message: ` below are the logs of Inbound, Outbound data 2024-08-15T12:43:37.845+0530 INFO helper/gointellisense.go:37 Inbound: {"jsonrpc":"2.0","method":"initialized","params":{}} 2024-08-15T12:43:37.845+0530 INFO helper/gointellisense.go:68 Modified Inbound Params: {} 2024-08-15T12:43:37.846+0530 INFO helper/gointellisense.go:98 Outbound: {"id":1,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"723829060117214342"}} 2024-08-15T12:43:37.846+0530 INFO helper/gointellisense.go:98 Outbound: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"723829060117214342","value":{"kind":"begin","message":"Loading packages...","title":"Setting up workspace"}}} 2024-08-15T12:43:37.847+0530 INFO helper/gointellisense.go:98 Outbound: {"id":2,"jsonrpc":"2.0","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///C:/users/vivek/go_test","section":"gopls"}]}} 2024-08-15T12:43:37.848+0530 INFO helper/gointellisense.go:98 Outbound: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"723829060117214342","value":{"kind":"end","message":"Error loading packages: failed to get workspace configuration from client (file:///C:/users/vivek/go_test): unmarshaling result: json: cannot unmarshal string into Go value of type []interface {}"}}} 2024-08-15T12:43:37.848+0530 INFO helper/gointellisense.go:98 Outbound: {"id":3,"jsonrpc":"2.0","method":"client/registerCapability","params":{"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{mod,work}","kind":7}]}}]}} 2024-08-15T12:43:37.849+0530 INFO helper/gointellisense.go:98 Outbound: {"jsonrpc":"2.0","method":"window/showMessage","params":{"message":"Error loading workspace folders (expected 1, got 0)\nfailed to load view for file:///c:/users/vivek/go_test: failed to get workspace configuration from client (file:///C:/users/vivek/go_test): unmarshaling result: json: cannot unmarshal string into Go value of type []interface {}\n","type":1}} 2024-08-15T12:43:37.849+0530 INFO helper/gointellisense.go:98 Outbound: {"id":4,"jsonrpc":"2.0","method":"client/registerCapability","params":{"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}} |
Hi, just catching up on this, it looks like perhaps the Are you able to capture the raw logs? I suspect we may only be seeing those with valid JSON. One way to do this would be to start gopls with |
logs.txt |
@vivekburman did you add |
Yes, cmd: "gopls -port=8080 serve -rpc.trace -logfile=C:/Users/Vivek/gopls.log" This is all i see. |
Got it. That's the gopls daemon. Can you add those arguments to the gopls process started by your editor, which is communicating with the daemon? |
I'm triggering gopls manually from cmd prompt. Not using any editor |
@vivekburman how are you communicating with that gopls instance? Is you LSP client communicating directly over tcp? |
So I've my main golang app server running on a port and then LSP server is started as a process in a different PORT. Now to bridge them with frontend client. I'm opening a websocket on golang app server. And using "github.com/sourcegraph/jsonrpc2" to proxy the messages back and forth from client to LSP. |
Understood. I'm not aware of anyone trying to use gopls in this way -- typically the daemon communicates with a sidecar gopls instance that forwards the LSP. However, I suppose it should work. The error message seems to be saying that the response to If you could capture the wire-level RPC transcript, I can perhaps provide more help. |
{"id":2,"jsonrpc":"2.0","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///C:/users/vivek/go_test","section":"gopls"}]}} Here I see this request. Going out from server to Monaco Editor. But can you tell me what to expect? After this. Sure I can provide the wire-level RPC transcript. Can you let me know where and how to get those? Any docs? |
@vivekburman sorry for going silent on this issue. I'm not sure the best way to capture the exact transcript, since we've not supported this communication mode in the past. Can you record exactly what your client receives and sends? |
gopls version
go env
What did you do?
I'm trying to setup Monaco Editor (Browser) with a gopls server.
What did you see happen?
Requests in order:
What did you expect to see?
I expected it to properly configure gopls server on my folder. Allow relaying information back to monaco editor
Editor and settings
No response
Logs
The text was updated successfully, but these errors were encountered: