diff --git a/src/vs/editor/common/model/bracketPairColorizer/concat23Trees.ts b/src/vs/editor/common/model/bracketPairColorizer/concat23Trees.ts index 8fb21788fde..1756fa9e577 100644 --- a/src/vs/editor/common/model/bracketPairColorizer/concat23Trees.ts +++ b/src/vs/editor/common/model/bracketPairColorizer/concat23Trees.ts @@ -8,6 +8,8 @@ import { AstNode, ListAstNode } from './ast'; /** * Concatenates a list of (2,3) AstNode's into a single (2,3) AstNode. * This mutates the items of the input array! + * If all items have the same height, this method has runtime O(items.length). + * Otherwise, it has runtime O(items.length * max(log(items.length), items.max(i => i.height))). */ export function concat23Trees(items: AstNode[]): AstNode | null { if (items.length === 0) { diff --git a/src/vs/editor/common/model/bracketPairColorizer/nodeReader.ts b/src/vs/editor/common/model/bracketPairColorizer/nodeReader.ts index af56e6deba4..cc938d38b15 100644 --- a/src/vs/editor/common/model/bracketPairColorizer/nodeReader.ts +++ b/src/vs/editor/common/model/bracketPairColorizer/nodeReader.ts @@ -24,6 +24,7 @@ export class NodeReader { /** * Returns the longest node at `offset` that satisfies the predicate. + * Has runtime O(log n) where n is the number of nodes in the tree. * @param offset must be greater than or equal to the last offset this method has been called with! */ readLongestNodeAt(offset: Length, predicate: (node: AstNode) => boolean): AstNode | undefined {