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: hover over some tokens in template files oops #50031

Closed
hyangah opened this issue Dec 7, 2021 · 2 comments
Closed

x/tools/gopls: hover over some tokens in template files oops #50031

hyangah opened this issue Dec 7, 2021 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Dec 7, 2021

gopls version

Built from x/tools/gopls@feb39d0cd73d2729e7fca6ed7f4125db80ea2022

/Users/hakim/go/bin/gopls: devel go1.18-085d6ff531 Tue Dec 7 17:59:54 2021 +0000 path golang.org/x/tools/gopls mod golang.org/x/tools/gopls (devel) dep github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= dep github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= dep github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= dep golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= dep golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= dep golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= dep golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= dep golang.org/x/tools v0.1.7 => ../ (devel)
    dep     golang.org/x/xerrors    v0.0.0-20200804184101-5ec99f83aff1      h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    dep     honnef.co/go/tools      v0.2.1  h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY=
    dep     mvdan.cc/gofumpt        v0.1.1  h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
    dep     mvdan.cc/xurls/v2       v2.3.0  h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I=
    build   -compiler=gc
    build   CGO_ENABLED=1
    build   CGO_CFLAGS=
    build   CGO_CPPFLAGS=
    build   CGO_CXXFLAGS=
    build   CGO_LDFLAGS=
    build   GOARCH=amd64
    build   GOOS=darwin
    build   GOAMD64=v1
    build   vcs=git
    build   vcs.revision=feb39d0cd73d2729e7fca6ed7f4125db80ea2022
    build   vcs.time=2021-12-06T16:11:25Z
    build   vcs.modified=true

go env

% go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hakim/Library/Caches/go-build"
GOENV="/Users/hakim/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/hakim/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/hakim/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/hakim/projects/w/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go-build3950163895=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://go.dev/play/p/ngmJwtIi5pJ

Hover over "%q" in the .tmpl file

What did you expect to see?

pretty hover message or nothing?

What did you see instead?

Screen Shot 2021-12-07 at 1 17 55 PM

Editor and settings

    "gopls": {
        "ui.semanticTokens": true
    }

Logs

[Trace - 13:26:53.237 PM] Sending request 'textDocument/hover - (13)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/projects/w/assets/letter.tmpl"},"position":{"line":1,"character":17}}


[Trace - 13:26:53.238 PM] Received response 'textDocument/hover - (13)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"oops, sym=\u0026template.symbol{start:17, length:2, name:\"\", kind:15, vardef:false}"},"range":{"start":{"line":1,"character":16},"end":{"line":1,"character":18}}}

cc @pjweinb

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Dec 7, 2021
@gopherbot gopherbot added this to the Unreleased milestone Dec 7, 2021
@pjweinb pjweinb self-assigned this Dec 7, 2021
@pjweinb
Copy link

pjweinb commented Dec 7, 2021

fix coming. (There's a huge number of possibilities, some of which I'd never seen, and strangely, this is one of them.)

@gopherbot
Copy link

Change https://golang.org/cl/369956 mentions this issue: internal/lsp/template: add missed hover cases

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.7.4 Dec 15, 2021
@rsc rsc unassigned pjweinb Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants