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

CodeLens references do not work in module mode if it is in another file #3003

@karim

Description

@karim

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.13.6 windows/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.41.1 26076a4de974ead31f97692a0d32f90d735645c0 x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.12.0
  • Run go env GOOS GOARCH to get the operating system and processor arhcitecture details
    • windows amd64

Share the Go related settings you have added/edited

"go.useLanguageServer": true,
"go.languageServerExperimentalFeatures": {
    "documentLink": false,
},
"gopls": {
    "completeUnimported": true,
    "hoverKind": "FullDocumentation",
    "staticcheck": true,
},
"go.enableCodeLens": {
    "references": true,
    "runtest": true
}

Describe the bug

Showing references does not work in module mode if they are in different files.

2

However, if I moved the function to the same file it works.

3

Or if I moved the whole project inside GOPATH.

1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions