mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 18:27:38 +01:00
Adds comments.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user