Skip to content

Commit f10960f

Browse files
h9jianggopherbot
authored andcommitted
extension/tools/goplssetting: interpret deprecation message from apijson
When generating package.json based on gopls api-json output, vscode-go release tool will interpret deprecation message and write the message to package.json and settings.md. In settings.md, deprecation message is put above description. Gopls side CL 642998, Test CL 643057. For #3632 Change-Id: Ica21fcc446dd1c5a5d4ef9b66101b3a9b0a47e80 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/643056 kokoro-CI: kokoro <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Hongxiang Jiang <[email protected]> Commit-Queue: Hongxiang Jiang <[email protected]>
1 parent fe8bfac commit f10960f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

extension/tools/goplssetting/goplssetting.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func toObject(opt *Option) (*Object, error) {
269269
Scope: "resource",
270270
// TODO: consider 'additionalProperties' if gopls api-json
271271
// outputs acceptable properties.
272-
// TODO: deprecation attribute
272+
DeprecationMessage: opt.DeprecationMessage,
273273
}
274274
if opt.Type != "enum" {
275275
obj.Type = propertyType(opt.Type)
@@ -410,6 +410,7 @@ type Object struct {
410410
Default interface{} `json:"default,omitempty"`
411411
Scope string `json:"scope,omitempty"`
412412
Properties map[string]*Object `json:"properties,omitempty"`
413+
DeprecationMessage string `json:"deprecationMessage,omitempty"`
413414
}
414415

415416
type Status int
@@ -432,14 +433,15 @@ type API struct {
432433
}
433434

434435
type Option struct {
435-
Name string
436-
Type string // T = bool | string | int | enum | any | []T | map[T]T | time.Duration
437-
Doc string
438-
EnumKeys EnumKeys
439-
EnumValues []EnumValue
440-
Default string
441-
Status string
442-
Hierarchy string
436+
Name string
437+
Type string // T = bool | string | int | enum | any | []T | map[T]T | time.Duration
438+
Doc string
439+
EnumKeys EnumKeys
440+
EnumValues []EnumValue
441+
Default string
442+
Status string
443+
Hierarchy string
444+
DeprecationMessage string
443445
}
444446

445447
type EnumKeys struct {

0 commit comments

Comments
 (0)