Skip to content

Commit

Permalink
tools/generate: make debug property order deterministic
Browse files Browse the repository at this point in the history
Change-Id: Ida5531c44e87ef38f38c0b9c5585cda896a18ff6
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/331129
Trust: Hyang-Ah Hana Kim <[email protected]>
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Rebecca Stambler <[email protected]>
  • Loading branch information
hyangah committed Jun 26, 2021
1 parent 289a9ef commit a5d232d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,16 @@ func describeDebugProperty(p *Property) string {
}

if p.Type == "object" && len(p.Properties) > 0 {

var keys []string
for k := range p.Properties {
keys = append(keys, k)
}
sort.Strings(keys)
fmt.Fprintf(b, "<ul>")
for k, v := range p.Properties {

for _, k := range keys {
v := p.Properties[k]
fmt.Fprintf(b, "<li>`%q`: %v</li>", k, describeDebugProperty(v))
}
fmt.Fprintf(b, "</ul>")
Expand Down

0 comments on commit a5d232d

Please sign in to comment.