Skip to content

findBracketMatchAtCaret

findBracketMatchAtCaret(brackets, caretOffset, scanBudget?): BracketMatch | null

Matching bracket pair for a caret, or null when the caret touches no bracket, the partner is missing, or the source is unbalanced at that point.

Brackets come from the syntax worker, so string and comment contents are already excluded — the reason this is not a text scan.

readonly BracketInfo[]

number

number

BracketMatch | null