Skip to content

Commit 63b4bd1

Browse files
committed
tools/generate: include deprecationMessage
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]>
1 parent 9fcd568 commit 63b4bd1

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

docs/settings.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ Allowed Values:`[off error info verbose]`
301301

302302
Default: `error`
303303

304-
### `go.overwriteGoplsMiddleware`
304+
### `go.overwriteGoplsMiddleware (deprecated)`
305305

306+
This option is deprecated.
306307
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.
307308

308309
### `go.playground`

tools/generate.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ type Command struct {
3838
}
3939

4040
type Property struct {
41-
name string // Set by us.
41+
name string `json:"name,omitempty"` // Set by us.
4242

4343
// Below are defined in package.json
44-
Default interface{} `json:"default,omitempty"`
45-
MarkdownDescription string `json:"markdownDescription,omitempty"`
46-
Description string `json:"description,omitempty"`
47-
Type interface{} `json:"type,omitempty"`
48-
Enum []string `json:"enum,omitempty"`
44+
Default interface{} `json:"default,omitempty"`
45+
MarkdownDescription string `json:"markdownDescription,omitempty"`
46+
Description string `json:"description,omitempty"`
47+
MarkdownDeprecationMessage string `json:"markdownDeprecationMessage,omitempty"`
48+
DeprecationMessage string `json:"deprecationMessage,omitempty"`
49+
Type interface{} `json:"type,omitempty"`
50+
Enum []string `json:"enum,omitempty"`
4951
}
5052

5153
func main() {
@@ -127,7 +129,19 @@ func main() {
127129
if p.MarkdownDescription != "" {
128130
desc = p.MarkdownDescription
129131
}
130-
b.WriteString(fmt.Sprintf("### `%s`\n\n%s", p.name, desc))
132+
deprecation := p.DeprecationMessage
133+
if p.MarkdownDeprecationMessage != "" {
134+
deprecation = p.MarkdownDeprecationMessage
135+
}
136+
137+
name := p.name
138+
if deprecation != "" {
139+
name += " (deprecated)"
140+
desc = deprecation + "\n" + desc
141+
}
142+
143+
b.WriteString(fmt.Sprintf("### `%s`\n\n%s", name, desc))
144+
131145
if p.Enum != nil {
132146
b.WriteString(fmt.Sprintf("\n\nAllowed Values:`%v`", p.Enum))
133147
}

0 commit comments

Comments
 (0)