bracketMatching function

Extension bracketMatching([
  1. BracketMatchingConfig config = const BracketMatchingConfig()
])

Create an extension that enables bracket matching.

Whenever the cursor is next to a bracket, that bracket and the one it matches are highlighted. Or, when no matching bracket is found, another highlighting style is used to indicate this.

Example

EditorState.create(
  extensions: [
    bracketMatching(),
  ],
);

Implementation

Extension bracketMatching([BracketMatchingConfig config = const BracketMatchingConfig()]) {
  return ExtensionList([
    _bracketMatchingConfig.of(config),
    _bracketMatchingState,
    _bracketMatchingDecorations.extension, // Use .extension to include viewPlugin registration
  ]);
}