-
Notifications
You must be signed in to change notification settings - Fork 763
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
Can not connect gopls when start vscode #2914
Comments
👋 @tayalone Having a similar issue on my VSCode since yesterday. Did you find a workaround? I've tried to change the version but doesn't look like it worked
|
@tayalone this fixed my issue golang/go#61190 (comment) |
Yes, this looks like a broken binary due to golang/go#61190. @tayalone could you confirm that |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
I am experiencing a similar issue. |
@AasmundN are you on darwin? What happens when you run |
@findleyr thanks for quick reply. I am on Sonoma 14.2.1. I have tried the solution suggested in golang/go#61190. I am currently using xcode devtools for xcode 15.1, considering trying to downgrade. I have not checked out the issue you link to, I will do that before downgrading. Edit: I read through the issue, and I don't really understand what it concludes with. I am just getting started with Go. |
@AasmundN if I note that your gopls is version
|
@findleyr I installed it via homebrew, and also copied it over to /usr/local/go/bin/gopls like suggested in golang/go#61190 (comment). Running the command you sent doesn't seem to change anything. Here is the error in vscode:
|
Hmm, can you please try running gopls as a daemon in a terminal, to see if it gets a connection? In a terminal, can you start gopls with When you restart the language server in VS Code (via the command palette: |
Hi, I believe |
Changed it to a string, still no luck. |
@findleyr I was able to make it connect to the language server by setting alternateTools.gopls to the gopls binary path in my homebrew directory. My current settings are "go.alternateTools": {
"gopls": "/opt/homebrew/bin/gopls"
},
"[go]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "golang.go"
}, Intellisense and formatting seems to be working now. However I am getting some error regarding the modules in my workspace that I am not quite sure how to resolve. Should I change my GOPATH to the homebrew path? EDIT: Looks like I was just missing a go.mod file. Things seem to be working like they should now. Thanks for the help 💯 🙏 |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.2ccd690cbff1569e4a83d7c43d45101f817401dc
arm64
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
Cann't Connect gopls when start vscode and I got error
Screenshots or recordings
The text was updated successfully, but these errors were encountered: