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/gopls: cannot go to definition when "ui.navigation.importShortcut": "Link" #45987

Closed
zyctree opened this issue May 6, 2021 · 1 comment
Closed
Assignees
Milestone

Comments

@zyctree
Copy link

@zyctree zyctree commented May 6, 2021

What did you do?

add the following in vscode setting

    "gopls": {
        "ui.navigation.importShortcut": "Link"
    },

What did you expect to see?

"go to definition" doesn't work:in vscode, right-click on any function, or type, or variable, then click "go to definition" shows 'no definition found for XXX'.

logs shows

[Trace - 14:02:56.949 PM] Received response 'textDocument/definition - (103)' in 0ms.
Result: null

What did you see instead?

"go to definition" should work

it works when

    "gopls": {
        "ui.navigation.importShortcut": "Both"
    },

Build info

golang.org/x/tools/gopls v0.6.11
    golang.org/x/tools/gopls@v0.6.11-pre.1 h1:WC/eGK7AcuoBLCv3JzzQrRIaaeRTSRgVjwtbDlN18BI=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
    golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
    golang.org/x/sys@v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
    golang.org/x/tools@v0.1.1-0.20210504170620-03ebc2c9fca8 h1:rTLms91GhM16y4sUcNGLdel0jJ8jXdQeXuN+7evgYiQ=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o=
    mvdan.cc/gofumpt@v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
@gopherbot
Copy link

@gopherbot gopherbot commented May 10, 2021

Change https://golang.org/cl/318469 mentions this issue: internal/lsp: fix no definition when importShortcut is link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants