From 63b4bd1c39981e830c103bd0f752547d9a17ab45 Mon Sep 17 00:00:00 2001 From: Hana Date: Tue, 15 Dec 2020 10:30:45 -0500 Subject: [PATCH] tools/generate: include deprecationMessage Change-Id: Ic6b5409801d52f20ea999c0af8cc5f5675665198 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/278352 Trust: Hyang-Ah Hana Kim Trust: Suzy Mueller Run-TryBot: Hyang-Ah Hana Kim Run-TryBot: Suzy Mueller TryBot-Result: kokoro Reviewed-by: Suzy Mueller --- docs/settings.md | 3 ++- tools/generate.go | 28 +++++++++++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/settings.md b/docs/settings.md index 11565421fb..c01a15ea38 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -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` diff --git a/tools/generate.go b/tools/generate.go index 76b5ba52b1..76e067a8ea 100644 --- a/tools/generate.go +++ b/tools/generate.go @@ -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() { @@ -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)) }