Skip to content

Bracket pair parsing runs twice on keypress #163304

@Tyriar

Description

@Tyriar

Part of #161622

Bracket pair parsing appears to happen twice on a single keypress as it happens when content changes and when tokenization happens. Typically on simple input "cheap" tokenization runs in the same task:

image

Consider using a microtask to execute the parsing at the end of the task a single time (which may get deferred to later depending on the outcome of #163235), rather than eagerly during the content changed event. I haven't looked much at the code but could we do bracket matching more incrementally so it's not taking several milliseconds?

The impact of this running twice is that input latency is pushed out several milliseconds on lower end/average hardware.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions