Skip to content

Commit

Permalink
extension/tools/goplssetting: interpret deprecation message from apijson
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
h9jiang authored and gopherbot committed Jan 16, 2025
1 parent fe8bfac commit f10960f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions extension/tools/goplssetting/goplssetting.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func toObject(opt *Option) (*Object, error) {
Scope: "resource",
// TODO: consider 'additionalProperties' if gopls api-json
// outputs acceptable properties.
// TODO: deprecation attribute
DeprecationMessage: opt.DeprecationMessage,
}
if opt.Type != "enum" {
obj.Type = propertyType(opt.Type)
Expand Down Expand Up @@ -410,6 +410,7 @@ type Object struct {
Default interface{} `json:"default,omitempty"`
Scope string `json:"scope,omitempty"`
Properties map[string]*Object `json:"properties,omitempty"`
DeprecationMessage string `json:"deprecationMessage,omitempty"`
}

type Status int
Expand All @@ -432,14 +433,15 @@ type API struct {
}

type Option struct {
Name string
Type string // T = bool | string | int | enum | any | []T | map[T]T | time.Duration
Doc string
EnumKeys EnumKeys
EnumValues []EnumValue
Default string
Status string
Hierarchy string
Name string
Type string // T = bool | string | int | enum | any | []T | map[T]T | time.Duration
Doc string
EnumKeys EnumKeys
EnumValues []EnumValue
Default string
Status string
Hierarchy string
DeprecationMessage string
}

type EnumKeys struct {
Expand Down

0 comments on commit f10960f

Please sign in to comment.