Skip to content

Commit

Permalink
tools/generate: include deprecationMessage
Browse files Browse the repository at this point in the history
Change-Id: Ic6b5409801d52f20ea999c0af8cc5f5675665198
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/278352
Trust: Hyang-Ah Hana Kim <[email protected]>
Trust: Suzy Mueller <[email protected]>
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
Run-TryBot: Suzy Mueller <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
  • Loading branch information
hyangah committed Dec 15, 2020
1 parent 9fcd568 commit 63b4bd1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ Allowed Values:`[off error info verbose]`

Default: `error`

### `go.overwriteGoplsMiddleware`
### `go.overwriteGoplsMiddleware (deprecated)`

This option is deprecated.
This option provides a set of flags which determine if vscode-go should intercept certain commands from gopls. These flags assume the `gopls` settings, which enable codelens from gopls, are also present.

### `go.playground`
Expand Down
28 changes: 21 additions & 7 deletions tools/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ type Command struct {
}

type Property struct {
name string // Set by us.
name string `json:"name,omitempty"` // Set by us.

// Below are defined in package.json
Default interface{} `json:"default,omitempty"`
MarkdownDescription string `json:"markdownDescription,omitempty"`
Description string `json:"description,omitempty"`
Type interface{} `json:"type,omitempty"`
Enum []string `json:"enum,omitempty"`
Default interface{} `json:"default,omitempty"`
MarkdownDescription string `json:"markdownDescription,omitempty"`
Description string `json:"description,omitempty"`
MarkdownDeprecationMessage string `json:"markdownDeprecationMessage,omitempty"`
DeprecationMessage string `json:"deprecationMessage,omitempty"`
Type interface{} `json:"type,omitempty"`
Enum []string `json:"enum,omitempty"`
}

func main() {
Expand Down Expand Up @@ -127,7 +129,19 @@ func main() {
if p.MarkdownDescription != "" {
desc = p.MarkdownDescription
}
b.WriteString(fmt.Sprintf("### `%s`\n\n%s", p.name, desc))
deprecation := p.DeprecationMessage
if p.MarkdownDeprecationMessage != "" {
deprecation = p.MarkdownDeprecationMessage
}

name := p.name
if deprecation != "" {
name += " (deprecated)"
desc = deprecation + "\n" + desc
}

b.WriteString(fmt.Sprintf("### `%s`\n\n%s", name, desc))

if p.Enum != nil {
b.WriteString(fmt.Sprintf("\n\nAllowed Values:`%v`", p.Enum))
}
Expand Down

0 comments on commit 63b4bd1

Please sign in to comment.