Open simococce02 opened 1 year ago
Hi, it's unclear to us what's going on, but appears that the language server is not running. From your version output, I see that the gopls
binary does not exist.
Can you run "Go: Install/Update Tools" from the command palette?
I tried to reinstall gopls but i just go this message in continuous loading
I tried to uninstall everything concerning golang from my mac but the above error still remain
@simococce02 do you have a go.mod or go.work in a parent directory of the folder you open? As described in that error, gopls needs to know which module(s) you are working on.
Yes I created both go.mod file and go.work file
Also now I need to test my code but terminal said that can't found function, but I have that function. If i try just to build and run a single code, it works; if I try to use testing not works
We need more details to continue triaging.
For language intellisense feature errors - please share the language server log following the instruction here https://github.com/golang/vscode-go/wiki/troubleshooting#collect-gopls-information
For test failure - please describe how you ran the test function and show the error message that shows up in the "Go Tests" output channel. Example repro case or screenshot/video to demonstrate the issue is also helpful.
Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
* Run `go version` to get version of Go from _the VS Code integrated terminal_. - go version go1.19.3 darwin/arm64 * Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_. - command not found in zsh terminal * Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders. - 1.73.1 (Universal) * Check your installed extensions to get the version of the VS Code Go extension - 0.36.0 * Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command. - Checking configured tools.... GOBIN: undefined toolsGopath: gopath: /Users/cocce/go GOROOT: /usr/local/go PATH: /Users/cocce/miniconda3/bin:/Users/cocce/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion Tech Preview.app/Contents/Public:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS go: /usr/local/go/bin/go: go version go1.19.3 darwin/arm64 gotests: not installed gomodifytags: not installed impl: not installed goplay: not installed dlv: /Users/cocce/go/bin/dlv (version: v1.9.1 built with go: go1.19.1) staticcheck: /Users/cocce/go/bin/staticcheck (version: v0.3.3 built with go: go1.19.1) gopls: /Users/cocce/go/bin/gopls (version: v0.10.1 built with go: go1.19.1) go env Workspace Folder (choba_library): /Users/cocce/Library/CloudStorage/OneDrive-UniversitàdegliStudidiMilano/Notability/Unimi/Anno 1/Primo semestre/Programmazione I/choba_library GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/Users/cocce/Library/Caches/go-build" GOENV="/Users/cocce/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/cocce/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/cocce/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.19.3" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mw/h65c6rx15zqf3xq8m476bkym0000gn/T/go-build2013612946=/tmp/go-build -gno-record-gcc-switches -fno-common"
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 thego.
or["go"]
orgopls
prefixes."[go]": { "editor.insertSpaces": false, "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.organizeImports": true }, "editor.suggest.snippetsPreventQuickSuggestions": false }, "go.addTags": { "tags": "json", "options": "json=omitempty", "promptForTags": false, "transform": "snakecase", "template": "" }, // Alternate tools or alternate paths for the same tools used by the Go extension. Provide either absolute path or the name of the binary in GOPATH/bin, GOROOT/bin or PATH. Useful when you want to use wrapper script for the Go tools. "go.alternateTools": {},
Describe the bug
A clear and concise description of what the bug.
When I open some go file and I want to write a function or some assignment the code completion not loads all the list but only the default function. For example when I want to use fmt and I should see the list of function, I can't see it and I just see "const, func, import, type, var" as the list. VSCode output in Extension Host Log show me an error log with this description
2022-12-07 11:21:45.149 [error] [golang.go] provider FAILED
2022-12-07 11:21:45.156 [error] Error: no identifier found at handleResponse (/Users/cocce/.vscode/extensions/golang.go-0.36.0/dist/goMain.js:4470:40) at processMessageQueue (/Users/cocce/.vscode/extensions/golang.go-0.36.0/dist/goMain.js:4293:13) at Immediate.<anonymous> (/Users/cocce/.vscode/extensions/golang.go-0.36.0/dist/goMain.js:4279:11) at process.processImmediate (node:internal/timers:466:21)
Steps to reproduce the behavior:
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.