Via T261857: Implement bracket matching in CodeMirror behind a feature flag we already merged all of the customizations we made to the upstream addon, notably this commit. While the quality of this code isn't bad, it was created as proof-of-concept code and never fully finished:
- There should be a comment in the file that points to the original source: https://github.com/codemirror/CodeMirror/blob/a966b5d115af09983d37f7c9aa034b78ac954ca4/addon/edit/matchbrackets.js
- The same comment should briefly explain our customizations, and possibly point to a diff or patch.
- There are multiple FIXME comments in the code. These need to be fixed, or the comments removed.
- The new code doesn't respect any limits. (Also see the related task T270237.)
- Is the performance still ok when the wikitext is very complex, with very long lines, and many brackets must be skipped?
- There are no tests → moved to T270240.
Here are some flame graphs for wikitexts with varying complexity. While the matchbrackets code is not an obvious issue, it's not free either.