matchBrackets

fun matchBrackets(state: EditorState, pos: DocPos, dir: Int = -1, config: BracketMatchingConfig = BracketMatchingConfig()): MatchResult?

Match brackets at a given position in the document.

Uses the syntax tree's NodeProp.closedBy/NodeProp.openedBy props when available, and falls back to character scanning for basic brackets.