You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see in the above screenshot, when the user types a replacement text with $1, $_ or $', we should check the regex syntax in Find text field and warn the user if the regex syntax is wrong (or won't work as expected).
The text was updated successfully, but these errors were encountered:
Comment by peterflynn Monday Jul 07, 2014 at 19:57 GMT
Reviewed. Low priority@larz0 to think about what kind of guidance & feedback we want to give for replacement in general:
Should we give syntax guidance about how to insert regexp groups? ($1 vs. \1, how to escape the $, etc.). Some editors have a very fancy UI where you can insert (and drag to rearrange) little placeholder icons in the string so you don't have to think about syntax... pretty sure we don't want anything that elaborate here, but you could imagine a little button that just inserts '$1' into the string, with a tooltip or link to more info from there. Etc.
Should we give warnings if the user puts $1/etc. in the replacement string but the query isn't regexp mode?
Should we give warnings if the user appears to be misusing the replacement syntax? (E.g. if we see n they probably meant $n; if we see $n they probably meant $$n; etc.)
Should we give errors/warnings if the user puts $n where n is out of range? (E.g. in the example above there are zero capturing groups in the regexp, so $1 to reference the 1st capturing group is essentially invalid).
Nominated for 1.0 since we've seen a few people get confused about replacement syntax in general (it's pretty inconsistent across editors), so some kind of usability polish here is probably worthwhile.
Issue by RaymondLim
Friday Jun 20, 2014 at 16:56 GMT
Originally opened as adobe/brackets#8202
As you can see in the above screenshot, when the user types a replacement text with
$1
,$_
or$'
, we should check the regex syntax in Find text field and warn the user if the regex syntax is wrong (or won't work as expected).The text was updated successfully, but these errors were encountered: