Fixes #8: SETTINGS page to keep all settings

This commit is contained in:
Zef Hemel
2022-07-15 11:17:02 +02:00
parent a8274d225c
commit a69289f1ab
6 changed files with 103 additions and 27 deletions
+9
View File
@@ -107,6 +107,15 @@ export function findNodeOfType(
return collectNodesMatching(tree, (n) => n.type === nodeType)[0];
}
export function traverseTree(
tree: ParseTree,
// Return value = should stop traversal?
matchFn: (tree: ParseTree) => boolean
): void {
// Do a collect, but ignore the result
collectNodesMatching(tree, matchFn);
}
// Finds non-text node at position
export function nodeAtPos(tree: ParseTree, pos: number): ParseTree | null {
if (pos < tree.from! || pos > tree.to!) {