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

go guru implement use an invalid scope when GOPATH is opened directly #1554

Closed
leaxoy opened this issue Mar 3, 2018 · 4 comments
Closed

Comments

@leaxoy
Copy link
Contributor

leaxoy commented Mar 3, 2018

Here is error message:
ERR Command failed: /Users/leaxoy/go/bin/guru -scope _/Users/leaxoy/go/... -json implements /Users/leaxoy/go/src/test/main.go:#56
guru: no packages specified for pointer analysis scope
: Error: Command failed: /Users/leaxoy/go/bin/guru -scope _/Users/leaxoy/go/... -json implements /Users/leaxoy/go/src/test/main.go:#56
guru: no packages specified for pointer analysis scope

On my mac, I set ${HOME}/go as GOPATH, then I open GOPATH with command code-insiders ~/go, and then press command+shift+F12 to find interface implementations, this error occurred.
guru arg scope expect test/..., but got _/Users/leaxoy/go/....

@leaxoy leaxoy changed the title go implement use an invalid scope go guru implement use an invalid scope Mar 3, 2018
@leaxoy
Copy link
Contributor Author

leaxoy commented Mar 3, 2018

dokigo λ go list -e -json ..
{
        "Dir": "/Users/leaxoy/go/src",
        "ImportPath": "_/Users/leaxoy/go/src",
        "Stale": true,
        "StaleReason": "build ID mismatch",
        "Incomplete": true,
        "Error": {
                "ImportStack": [
                        ".."
                ],
                "Pos": "",
                "Err": "no Go files in /Users/leaxoy/go/src"
        }
}
dokigo λ go list -e -json ../..
{
        "Dir": "/Users/leaxoy/go",
        "ImportPath": "_/Users/leaxoy/go",
        "Stale": true,
        "StaleReason": "build ID mismatch",
        "Incomplete": true,
        "Error": {
                "ImportStack": [
                        "../.."
                ],
                "Pos": "",
                "Err": "no Go files in /Users/leaxoy/go"
        }
}
dokigo λ cd chatserver/
chatserver λ go list -e -json
{
        "Dir": "/Users/leaxoy/go/src/dokigo/chatserver",
        "ImportPath": "dokigo/chatserver",
        "Root": "/Users/leaxoy/go",
        "Stale": true,
        "StaleReason": "build ID mismatch",
        "Incomplete": true,
        "Error": {
                "ImportStack": [
                        "dokigo/chatserver"
                ],
                "Pos": "",
                "Err": "no Go files in /Users/leaxoy/go/src/dokigo/chatserver"
        }
}```
if not `Root` field present, , may be we should re-populate scope string.

@ramya-rao-a ramya-rao-a changed the title go guru implement use an invalid scope go guru implement use an invalid scope when GOPATH is opened directly Mar 4, 2018
@ramya-rao-a
Copy link
Contributor

Thanks for the idea of looking at the Root. I was working on #1545 which is the same as this issue. I was about to add a check where we skip the scope if it starts with _. But checking for Root is a better idea.

@ramya-rao-a
Copy link
Contributor

Fixed. Need some help testing though. All you need to do is

@ramya-rao-a
Copy link
Contributor

This fix is now available in the latest update (0.6.78) to the Go extension

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 18, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants