Consider a Go project with main.go looking like this:
package main
import (
"fmt"
"github.com/google/uuid"
)
func main() {
id := uuid.New()
fmt.Println(id)
}
When I go to definition (F12) of uuid.New() I end up here:
func New() UUID {
return Must(NewRandom())
}
So far so good.
But when I try to navigate futher to Must or NewRandom, I get a popup "No definition found...".
Whereas if I navigate to fmt.Println, I can navigate further into Fprintln, doPrintln, writeByte, etc.
Why is this difference in behavior between Go SDK packages and imported modules?
Shouldn't I be able to navigate within modules the same way I do in my own code and the Go SDK?
gopls version: v0.15.2
go version: 1.22
The full test project can be found at https://github.com/rustyx/issue-66827
Consider a Go project with
main.golooking like this:When I go to definition (F12) of
uuid.New()I end up here:So far so good.
But when I try to navigate futher to
MustorNewRandom, I get a popup "No definition found...".Whereas if I navigate to
fmt.Println, I can navigate further intoFprintln,doPrintln,writeByte, etc.Why is this difference in behavior between Go SDK packages and imported modules?
Shouldn't I be able to navigate within modules the same way I do in my own code and the Go SDK?
gopls version: v0.15.2
go version: 1.22
The full test project can be found at https://github.com/rustyx/issue-66827