Skip to content

Commit 19f6e6b

Browse files
jamalchyangah
authored andcommitted
package.json: add markdown descriptions to inlay hints config
Fixes #1631 Change-Id: I270ae81baf3317605b4fb7ece1342c6d1db2143c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/417295 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
1 parent d2f0f1c commit 19f6e6b

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed

docs/settings.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,36 +273,85 @@ Default: `false`
273273
### `go.inlayHints.assignVariableTypes`
274274

275275
Enable/disable inlay hints for variable types in assign statements.
276+
```go
277+
278+
i /*int*/, j /*int*/ := 0, len(r)-1
279+
```
276280

277281
Default: `false`
278282
### `go.inlayHints.compositeLiteralFields`
279283

280284
Enable/disable inlay hints for composite literal field names.
285+
```go
286+
287+
for _, c := range []struct {in, want string}{
288+
{/*in:*/ "Hello, world", /*want:*/ "dlrow ,olleH"},
289+
{/*in:*/ "Hello, 世界", /*want:*/ "界世 ,olleH"},
290+
{/*in:*/ "", /*want:*/ ""},
291+
} {
292+
...
293+
}
294+
```
281295

282296
Default: `false`
283297
### `go.inlayHints.compositeLiteralTypes`
284298

285299
Enable/disable inlay hints for composite literal types.
300+
```go
301+
302+
for _, c := range []struct {in, want string}{
303+
/*struct{ in, want string }*/{"Hello, world", "dlrow ,olleH"},
304+
/*struct{ in, want string }*/{"Hello, 世界", "界世 ,olleH"},
305+
/*struct{ in, want string }*/{"", ""},
306+
} {
307+
...
308+
}
309+
```
286310

287311
Default: `false`
288312
### `go.inlayHints.constantValues`
289313

290314
Enable/disable inlay hints for constant values.
315+
```go
316+
317+
const (
318+
KindNone = iota /*= 0*/
319+
KindPrint /*= 1*/
320+
KindPrintf /*= 2*/
321+
KindErrorf /*= 3*/
322+
)
323+
```
291324

292325
Default: `false`
293326
### `go.inlayHints.functionTypeParameters`
294327

295328
Enable/disable inlay hints for implicit type parameters on generic functions.
329+
```go
330+
331+
func myFunc[T any](a T) { ... }
332+
333+
func main() {
334+
myFunc/*[int]*/(1)
335+
}
336+
```
296337

297338
Default: `false`
298339
### `go.inlayHints.parameterNames`
299340

300341
Enable/disable inlay hints for parameter names.
342+
```go
343+
344+
http.HandleFunc(/*pattern:*/ "/", /*handler:*/ indexHandler)
345+
```
301346

302347
Default: `false`
303348
### `go.inlayHints.rangeVariableTypes`
304349

305350
Enable/disable inlay hints for variable types in range statements.
351+
```go
352+
353+
for k /*int*/, v /*string*/ := range []string{} { ... }
354+
```
306355

307356
Default: `false`
308357
### `go.installDependenciesWhenBuilding`

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,37 +2045,37 @@
20452045
},
20462046
"go.inlayHints.assignVariableTypes": {
20472047
"type": "boolean",
2048-
"description": "Enable/disable inlay hints for variable types in assign statements.",
2048+
"markdownDescription": "Enable/disable inlay hints for variable types in assign statements.\n```go\n\ni /*int*/, j /*int*/ := 0, len(r)-1\n```",
20492049
"default": false
20502050
},
20512051
"go.inlayHints.compositeLiteralFields": {
20522052
"type": "boolean",
2053-
"description": "Enable/disable inlay hints for composite literal field names.",
2053+
"markdownDescription": "Enable/disable inlay hints for composite literal field names.\n```go\n\nfor _, c := range []struct {in, want string}{\n\t{/*in:*/ \"Hello, world\", /*want:*/ \"dlrow ,olleH\"},\n\t{/*in:*/ \"Hello, 世界\", /*want:*/ \"界世 ,olleH\"},\n\t{/*in:*/ \"\", /*want:*/ \"\"},\n} {\n\t...\n}\n```",
20542054
"default": false
20552055
},
20562056
"go.inlayHints.compositeLiteralTypes": {
20572057
"type": "boolean",
2058-
"description": "Enable/disable inlay hints for composite literal types.",
2058+
"markdownDescription": "Enable/disable inlay hints for composite literal types.\n```go\n\nfor _, c := range []struct {in, want string}{\n\t/*struct{ in, want string }*/{\"Hello, world\", \"dlrow ,olleH\"},\n\t/*struct{ in, want string }*/{\"Hello, 世界\", \"界世 ,olleH\"},\n\t/*struct{ in, want string }*/{\"\", \"\"},\n} {\n\t...\n}\n```",
20592059
"default": false
20602060
},
20612061
"go.inlayHints.constantValues": {
20622062
"type": "boolean",
2063-
"description": "Enable/disable inlay hints for constant values.",
2063+
"markdownDescription": "Enable/disable inlay hints for constant values.\n```go\n\nconst (\n\tKindNone = iota\t/*= 0*/\n\tKindPrint\t/*= 1*/\n\tKindPrintf\t/*= 2*/\n\tKindErrorf\t/*= 3*/\n)\n```",
20642064
"default": false
20652065
},
20662066
"go.inlayHints.functionTypeParameters": {
20672067
"type": "boolean",
2068-
"description": "Enable/disable inlay hints for implicit type parameters on generic functions.",
2068+
"markdownDescription": "Enable/disable inlay hints for implicit type parameters on generic functions.\n```go\n\nfunc myFunc[T any](a T) { ... }\n\nfunc main() {\n\tmyFunc/*[int]*/(1)\n}\n```",
20692069
"default": false
20702070
},
20712071
"go.inlayHints.parameterNames": {
20722072
"type": "boolean",
2073-
"description": "Enable/disable inlay hints for parameter names.",
2073+
"markdownDescription": "Enable/disable inlay hints for parameter names.\n```go\n\nhttp.HandleFunc(/*pattern:*/ \"/\", /*handler:*/ indexHandler)\n```",
20742074
"default": false
20752075
},
20762076
"go.inlayHints.rangeVariableTypes": {
20772077
"type": "boolean",
2078-
"description": "Enable/disable inlay hints for variable types in range statements.",
2078+
"markdownDescription": "Enable/disable inlay hints for variable types in range statements.\n```go\n\nfor k /*int*/, v /*string*/ := range []string{} { ... }\n```",
20792079
"default": false
20802080
},
20812081
"gopls": {

0 commit comments

Comments
 (0)