diff --git a/src/suggestion.ts b/src/suggestion.ts index 82758d1..de373ec 100644 --- a/src/suggestion.ts +++ b/src/suggestion.ts @@ -38,7 +38,7 @@ export class Suggestion extends TreeItem { this.getChildren() .sort((a, b) => a.value.line - b.value.line) .forEach((child) => { - this.appendChild(child); + this.childrenWrapper.appendChild(child); child.sortChildren(); }); } @@ -65,9 +65,13 @@ export class Occurrence extends TreeItem { } public sortChildren(): void { - this.getChildren().sort( - (a, b) => a.value.rank.codePointAt(0)! - b.value.rank.codePointAt(0)! - ); + this.getChildren() + .sort( + (a, b) => a.value.rank.codePointAt(0)! - b.value.rank.codePointAt(0)! + ) + .forEach((child) => { + this.childrenWrapper.appendChild(child); + }); } }