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: add inlay hints #52343

Closed
qinxin0720 opened this issue Apr 14, 2022 · 11 comments
Closed

x/tools/gopls: add inlay hints #52343

qinxin0720 opened this issue Apr 14, 2022 · 11 comments
Assignees
Labels
FeatureRequest 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

@qinxin0720
Copy link

gopls version

Build info

golang.org/x/tools/gopls v0.8.3
golang.org/x/tools/[email protected] h1:Mxm94ix8oSARQ6svioO6SxKEYWT/VCP54/448LOHzrk=
github.com/BurntSushi/[email protected] h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
github.com/google/[email protected] h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp/[email protected] h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM=
golang.org/x/[email protected] h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
golang.org/x/[email protected] h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/[email protected] h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c=
golang.org/x/[email protected] h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/[email protected] h1:rYiuK/jn6TCxjAq1hQ6MR6pgOeP3A5gIHDxgrQ8Vbys=
golang.org/x/[email protected] h1:9dMzk88fnONra7zrEalqkRMGa9jMGf9B5mdzhYVyI28=
golang.org/x/[email protected] h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
honnef.co/go/[email protected] h1:2LdYUZ7CIxnYgskbUZfY7FPggmqnh6shBqfWa8Tn3XU=
mvdan.cc/[email protected] h1:kTojdZo9AcEYbQYhGuLf/zszYthRdhDNDUi2JKTxas4=
mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.18

go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/qinxin/Library/Caches/go-build"
GOENV="/Users/qinxin/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/qinxin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/qinxin/go"
GOPRIVATE=""
GOPROXY="http://192.168.0.241:9090"
GOROOT="/opt/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/opt/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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/rx/ks2mtkms1rv76l73ywd3rwv00000gn/T/go-build1612532483=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

none

What did you expect to see?

can gopls provide inlay hints in vscode?

like rust-analyzer

截屏2022-04-14 10 12 24

and clangd 14.0.0
截屏2022-04-14 10 15 55

What did you see instead?

none

Editor and settings

none

Logs

none

@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 Apr 14, 2022
@gopherbot gopherbot added this to the Unreleased milestone Apr 14, 2022
@jamalc jamalc modified the milestones: Unreleased, gopls/unplanned Apr 14, 2022
@jamalc
Copy link

jamalc commented Apr 15, 2022

Related golang/vscode-go#1631.

@code-n-go
Copy link

Definitely looking forward to this getting implemented!

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/410132 mentions this issue: tools/internal: support textDocument/inlayHint

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/411094 mentions this issue: tools/internal: support textDocument/inlayHint

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/410974 mentions this issue: internal/lsp: add inlay hints to server capabilities

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/411100 mentions this issue: internal/lsp: add inlay hints for variable types

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/411102 mentions this issue: internal/lsp: add inlay hints for composite literals

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/411101 mentions this issue: internal/lsp: add inlay hints for constant values

gopherbot pushed a commit to golang/tools that referenced this issue Jun 10, 2022
This change implements support for textDocument/inlayHint and
adds inlay hints for parameter names.

For golang/go#52343.
For golang/vscode-go#1631.

Change-Id: I3f989838b86cef4fd2b4076cb6340010fff7c24c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/411094
gopls-CI: kokoro <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
Run-TryBot: Jamal Carvalho <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
gopherbot pushed a commit to golang/tools that referenced this issue Jun 10, 2022
For golang/go#52343.
For golang/vscode-go#1631.

Change-Id: I94a1b3c389d8bfaa48754e28a52ef76c29eb6ead
Reviewed-on: https://go-review.googlesource.com/c/tools/+/411100
Run-TryBot: Jamal Carvalho <[email protected]>
gopls-CI: kokoro <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
gopherbot pushed a commit to golang/tools that referenced this issue Jun 10, 2022
For golang/go#52343.
For golang/vscode-go#1631.

Change-Id: Iaef0beab2837502f6428767f457d1da21848fcb6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/411101
Run-TryBot: Jamal Carvalho <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
gopls-CI: kokoro <[email protected]>
gopherbot pushed a commit to golang/tools that referenced this issue Jun 10, 2022
For golang/go#52343.
For golang/vscode-go#1631.

Change-Id: I8fba5ddf0bd25ba0fc20f3305ce13868f426087c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/411102
Run-TryBot: Jamal Carvalho <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
gopls-CI: kokoro <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/411905 mentions this issue: internal/lsp: add inlay hints for composite literal types

gopherbot pushed a commit to golang/tools that referenced this issue Jun 17, 2022
Add inlay hints for composite literal types. This will show type
information for composite literals with no explicit types.

Example:
<struct {in, want string}>{"hello", "goodbye"}

For golang/go#52343

Change-Id: Ia1f03b82669387c864353b8033940759fa1128e7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/411905
gopls-CI: kokoro <[email protected]>
Run-TryBot: Suzy Mueller <[email protected]>
Reviewed-by: Jamal Carvalho <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/412994 mentions this issue: internal/lsp: add inlay hints for inferred type params

gopherbot pushed a commit to golang/tools that referenced this issue Jun 21, 2022
This will show inferred type information for generic function
call expressions.

Example:
SumNumbers<[string, int64]>(ints)

For golang/go#52343

Change-Id: I05595f236626e8fb3666af5160611e074e8265a4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/412994
Reviewed-by: Suzy Mueller <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
gopls-CI: kokoro <[email protected]>
Run-TryBot: Jamal Carvalho <[email protected]>
@findleyr findleyr modified the milestones: gopls/later, gopls/v0.9.0 Jul 1, 2022
@findleyr
Copy link
Contributor

findleyr commented Jul 1, 2022

I believe this is done. Thanks @suzmue and @jamalc!

@findleyr findleyr closed this as completed Jul 1, 2022
@golang golang locked and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest 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

6 participants