Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/gopls: GoToDef does not work with Module Replace Clause #31055

Closed
marwan-at-work opened this issue Mar 26, 2019 · 3 comments
Closed

x/tools/cmd/gopls: GoToDef does not work with Module Replace Clause #31055

marwan-at-work opened this issue Mar 26, 2019 · 3 comments

Comments

@marwan-at-work
Copy link
Contributor

@marwan-at-work marwan-at-work commented Mar 26, 2019

Summary

I am working on a project where "GoToDef" works on all the symbols except the ones that come from a module that has been "replaced" in go.mod through the replace clause.

Reproduce

# be outside of GOPATH
1. ~ git clone https://github.com/marwan-at-work/authproxy
2. ~ cd authproxy
3. ~ go build ./...
4. ~ code . # open VSCode pointed at this prject

5. Open authproxy.go file and go to line 63 that reads `cfg, err := google.JWTConfigFromJSON(bts)` 

6. Hover over the `JWTConfigFromJSON` part and try to GoToDef 

Expected: go to the replaced definition insode $GOPATH/pkg/mod
Actual: nothing happened.

Editor Settings

GO111MODULE: on
Editor: VSCODE
GoPls Settings:

{
    "atomKeymap.promptV3Features": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.formatOnPaste": true,
    "window.zoomLevel": 0,
    "editor.fontSize": 12,
    "editor.lineHeight": 22,
    "go.buildOnSave": "off",
    "go.vetOnSave": "off",
    "go.useLanguageServer": true,
    "go.alternateTools": {
        "go-langserver": "gopls"
    },
    "go.languageServerExperimentalFeatures": {
        "format": false,
        "autoComplete": true,
        "rename": true,
        "goToDefinition": true,
        "hover": true,
        "signatureHelp": true,
        "goToTypeDefinition": true,
        "goToImplementation": true,
        "documentSymbols": true,
        "workspaceSymbols": true,
        "findReferences": true
    },
    "go.lintTool": "golint",
    "go.coverageDecorator": {
        "type": "highlight"
    },
    "editor.hideCursorInOverviewRuler": false,
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.organizeImports": true,
    },
    "breadcrumbs.enabled": true
}
@gopherbot gopherbot added this to the Unreleased milestone Mar 26, 2019
@myitcv
Copy link
Member

@myitcv myitcv commented May 8, 2019

Also seeing this. Noting that this is particularly painful for people (like me) who use gohack to quickly hack on deps for debugging/whatever.

@myitcv
Copy link
Member

@myitcv myitcv commented May 8, 2019

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 21, 2019

I also can no longer reproduce this. Closing.

@stamblerre stamblerre closed this May 21, 2019
@golang golang locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.