x/tools/gopls: Cannot navigate to function on MacOS when the go file is Windows OS specific. #67646
Labels
gopls/metadata
Issues related to metadata loading in gopls
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Go version
go version go1.22.3 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Edit a "windows" file (platform specific) ..
main_windows.go
on MacOS Arm64 / M1.I have two files,
main_darwin.go
andmain_windows.go
that serve two purposes, the Darwin one is for testing the code on MacOS, while the windows one is what will ultimately ship and be packaged.When editing the
main_windows.go
file I am unable to navigate to symbol / function using VsCode.What did you see happen?
When navigating to a symbol by pressing F12, I get the message
No definition found for FatalF
.I notice this stack trace:
ERR no package metadata for file file:///Users/wayneforrest/Documents/Projects/nextup/nextup-lib/main_windows.go: Error: no package metadata for file file:///Users/wayneforrest/Documents/Projects/nextup/nextup-lib/main_windows.go at handleResponse (/Users/wayneforrest/.vscode/extensions/golang.go-0.41.4/dist/goMain.js:8606:40) at handleMessage (/Users/wayneforrest/.vscode/extensions/golang.go-0.41.4/dist/goMain.js:8416:11) at processMessageQueue (/Users/wayneforrest/.vscode/extensions/golang.go-0.41.4/dist/goMain.js:8431:13) at Immediate.<anonymous> (/Users/wayneforrest/.vscode/extensions/golang.go-0.41.4/dist/goMain.js:8407:11) at process.processImmediate (node:internal/timers:476:21)
Note the
stdlog
:import ( "fmt" stdLog "log" "runtime/debug" "sync" "time"
What did you expect to see?
When I navigate to the symbol/function from the
main_darwin.go
file, it works, but not when I navigate frommain_windows.go
file.The text was updated successfully, but these errors were encountered: