-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp: add inlay hints for composite literal names
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 <jamal@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com>
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package inlayHint //@inlayHint("package") | ||
|
||
import "fmt" | ||
|
||
func fieldNames() { | ||
for _, c := range []struct { | ||
in, want string | ||
}{ | ||
{"Hello, world", "dlrow ,olleH"}, | ||
{"Hello, 世界", "界世 ,olleH"}, | ||
{"", ""}, | ||
} { | ||
fmt.Println(c.in == c.want) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
internal/lsp/testdata/inlay_hint/composite_literals.go.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- inlayHint -- | ||
package inlayHint //@inlayHint("package") | ||
|
||
import "fmt" | ||
|
||
func fieldNames() { | ||
for _<int>, c<struct{in string; want strin...> := range []struct { | ||
in, want string | ||
}{ | ||
{<in:>"Hello, world", <want:>"dlrow ,olleH"}, | ||
{<in:>"Hello, 世界", <want:>"界世 ,olleH"}, | ||
{<in:>"", <want:>""}, | ||
} { | ||
fmt.Println(<a...:>c.in == c.want) | ||
} | ||
} | ||
|