Skip to content

Commit

Permalink
Fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Jun 25, 2024
1 parent 227d254 commit d8f8655
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/markers/src/browser/problem/problem-tree-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export class ProblemTree extends MarkerTree<Diagnostic> {
super(markerManager, markerOptions);
}

override get root(): MarkerRootNode | undefined {
const superRoot = super.root;
return MarkerRootNode.is(superRoot) ? superRoot : undefined;
}

protected override getMarkerNodes(parent: MarkerInfoNode, markers: Marker<Diagnostic>[]): MarkerNode[] {
const nodes = super.getMarkerNodes(parent, markers);
return nodes.sort((a, b) => this.sortMarkers(a, b));
Expand Down Expand Up @@ -92,11 +87,13 @@ export class ProblemTree extends MarkerTree<Diagnostic> {
}

protected doInsertNodesWithMarkers = debounce(() => {
if (!this.root) {
const root = this.root;
// Sanity check; This should always be of type `MarkerRootNode`
if (!MarkerRootNode.is(root)) {
return;
}
const queuedItems = Array.from(this.queuedMarkers.values());
ProblemCompositeTreeNode.addChildren(this.root, queuedItems);
ProblemCompositeTreeNode.addChildren(root, queuedItems);

for (const { node, markers } of queuedItems) {
const children = this.getMarkerNodes(node, markers);
Expand Down

0 comments on commit d8f8655

Please sign in to comment.