Skip to content

fails to find declaration, sometimes #51

Description

@josh-tepper

I use godef primarily by being a Microsoft VSCode go-extension user. I've noticed over the past few months that sometimes "go to declaration" does not work, and investigation has shown this to be an issue with godef (upon which the VSCode extension relies).

When I run godef in such a case, it just says "no declaration found". See below. First as a proof of proper configuration, here is an example of an expression that does work:

$ godef -f api/main.go environment.SetFromString
<PATH REDACTED>/environment.go:41:6

Here is an example of one of the offending expressions:

$ godef -f api/main.go state.Init
godef: no declaration found for state.Init

Finally, running the failed godef command with gogetdoc yields the proper results:

$ gogetdoc -pos api/main.go:#870
import "clarifai/state"

func Init()

Undocumented.

The offending cases all involve jumping to a function in another package, but in some cases this does work. In the cases where it works, it always works, and in the cases where it doesn't, it never seems to work.

I first filed an issue against vscode, which can be found here:
microsoft/vscode-go#702
It was recommended in that thread that I file an issue here, against godef.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions