Page MenuHomePhabricator

Deactivate the remarkup autosuggest once text can't match "[[" or "((" rules
ClosedPublic

Authored by epriestley on Apr 1 2019, 9:18 PM.
Tags
None
Referenced Files
F18799321: D20365.id.diff
Fri, Oct 17, 1:12 PM
F18789487: D20365.diff
Wed, Oct 15, 9:55 AM
F18620138: D20365.id48590.diff
Sep 15 2025, 4:22 AM
F18618357: D20365.id48585.diff
Sep 14 2025, 11:53 PM
F18518626: D20365.diff
Sep 5 2025, 3:28 PM
F18111266: D20365.id.diff
Aug 12 2025, 9:49 AM
F18110034: D20365.diff
Aug 11 2025, 3:41 PM
F17805546: D20365.id48590.diff
Jul 25 2025, 12:43 PM
Subscribers
None

Details

Summary

See PHI1185, which reports a performance issue with "(" in remarkup in certain contexts.

I can't reproduce the performance issue, but I can reproduce the autosuggester incorrectly remaining active and swallowing return characters.

When the user types ( or [, we wait for a prefix for the (( (Phurl) or [[ (Phriction) rules. We currently continue looking for that prefix until a character is entered that explicitly interrupts the search.

For example, typing (xxx<return> does not insert a return character, because we're stuck on matching the prefix.

Instead, as soon as the user has entered text that we know won't ever match the prefix, deactivate the autocomplete. We can slightly cheat through this by just looking for at least one character of text, since all prefixes are exactly one character long. If we eventually have some kind of ~~@(xyz) rule we might need to add a more complicated piece of rejection logic.

Test Plan

Typed (xxx<return>, got a return. Used (( and [[ autosuggest rules normally. Used JX.log() to sanity check that nothing too crazy seems to be happening.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable