Fixes children appending bug *finally*

This commit is contained in:
Simon Schödler 2023-04-04 13:10:57 +02:00
parent 65033102fa
commit e9a9332e1f

View file

@ -38,7 +38,7 @@ export class Suggestion extends TreeItem<string> {
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<EditorPosition> {
}
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);
});
}
}