Skip to content

Commit

Permalink
package.json: add markdown descriptions to inlay hints config
Browse files Browse the repository at this point in the history
Fixes #1631

Change-Id: I270ae81baf3317605b4fb7ece1342c6d1db2143c
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/417295
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
  • Loading branch information
jamalc authored and hyangah committed Jul 13, 2022
1 parent d2f0f1c commit 19f6e6b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 7 deletions.
49 changes: 49 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,36 +273,85 @@ Default: `false`
### `go.inlayHints.assignVariableTypes`

Enable/disable inlay hints for variable types in assign statements.
```go

i /*int*/, j /*int*/ := 0, len(r)-1
```

Default: `false`
### `go.inlayHints.compositeLiteralFields`

Enable/disable inlay hints for composite literal field names.
```go

for _, c := range []struct {in, want string}{
{/*in:*/ "Hello, world", /*want:*/ "dlrow ,olleH"},
{/*in:*/ "Hello, 世界", /*want:*/ "界世 ,olleH"},
{/*in:*/ "", /*want:*/ ""},
} {
...
}
```

Default: `false`
### `go.inlayHints.compositeLiteralTypes`

Enable/disable inlay hints for composite literal types.
```go

for _, c := range []struct {in, want string}{
/*struct{ in, want string }*/{"Hello, world", "dlrow ,olleH"},
/*struct{ in, want string }*/{"Hello, 世界", "界世 ,olleH"},
/*struct{ in, want string }*/{"", ""},
} {
...
}
```

Default: `false`
### `go.inlayHints.constantValues`

Enable/disable inlay hints for constant values.
```go

const (
KindNone = iota /*= 0*/
KindPrint /*= 1*/
KindPrintf /*= 2*/
KindErrorf /*= 3*/
)
```

Default: `false`
### `go.inlayHints.functionTypeParameters`

Enable/disable inlay hints for implicit type parameters on generic functions.
```go

func myFunc[T any](a T) { ... }

func main() {
myFunc/*[int]*/(1)
}
```

Default: `false`
### `go.inlayHints.parameterNames`

Enable/disable inlay hints for parameter names.
```go

http.HandleFunc(/*pattern:*/ "/", /*handler:*/ indexHandler)
```

Default: `false`
### `go.inlayHints.rangeVariableTypes`

Enable/disable inlay hints for variable types in range statements.
```go

for k /*int*/, v /*string*/ := range []string{} { ... }
```

Default: `false`
### `go.installDependenciesWhenBuilding`
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2045,37 +2045,37 @@
},
"go.inlayHints.assignVariableTypes": {
"type": "boolean",
"description": "Enable/disable inlay hints for variable types in assign statements.",
"markdownDescription": "Enable/disable inlay hints for variable types in assign statements.\n```go\n\ni /*int*/, j /*int*/ := 0, len(r)-1\n```",
"default": false
},
"go.inlayHints.compositeLiteralFields": {
"type": "boolean",
"description": "Enable/disable inlay hints for composite literal field names.",
"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```",
"default": false
},
"go.inlayHints.compositeLiteralTypes": {
"type": "boolean",
"description": "Enable/disable inlay hints for composite literal types.",
"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```",
"default": false
},
"go.inlayHints.constantValues": {
"type": "boolean",
"description": "Enable/disable inlay hints for constant values.",
"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```",
"default": false
},
"go.inlayHints.functionTypeParameters": {
"type": "boolean",
"description": "Enable/disable inlay hints for implicit type parameters on generic functions.",
"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```",
"default": false
},
"go.inlayHints.parameterNames": {
"type": "boolean",
"description": "Enable/disable inlay hints for parameter names.",
"markdownDescription": "Enable/disable inlay hints for parameter names.\n```go\n\nhttp.HandleFunc(/*pattern:*/ \"/\", /*handler:*/ indexHandler)\n```",
"default": false
},
"go.inlayHints.rangeVariableTypes": {
"type": "boolean",
"description": "Enable/disable inlay hints for variable types in range statements.",
"markdownDescription": "Enable/disable inlay hints for variable types in range statements.\n```go\n\nfor k /*int*/, v /*string*/ := range []string{} { ... }\n```",
"default": false
},
"gopls": {
Expand Down

0 comments on commit 19f6e6b

Please sign in to comment.