Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

no semantic results for cmd/... #190

Open
zephyrtronium opened this issue Aug 14, 2021 · 0 comments
Open

no semantic results for cmd/... #190

zephyrtronium opened this issue Aug 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@zephyrtronium
Copy link

zephyrtronium commented Aug 14, 2021

Similar to std, the Go tool treats paths that start with cmd as special, referring to $GOROOT/src/cmd. lsif-go understands to treat std specially, but it does not do so for cmd:

func resolveRepoRootForImportPath(name string) (string, bool) {
// When indexing golang/go, there are some references to the package "std" itself.
// Generally, "std/" is not referenced directly (it is just assumed when you have "fmt" or similar
// in your imports), but inside of golang/go, it is directly referenced.
//
// In that case, we just return it directly, there is no other resolving to do.
if name == "std" {
return name, true
}

The result is that there are no semantic results for code in some packages inside golang/go/src/cmd. E.g., Sourcegraph gives the wrong result for types.AlgType here: https://sourcegraph.com/github.com/golang/go@master/-/blob/src/cmd/compile/internal/reflectdata/alg.go?L22

Packages added under cmd in Go 1.17 do seem to work, according to @Strum355.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants