Page MenuHomePhabricator

Enhance syntax errors reporting
Open, Needs TriagePublic

Description

Right now, every error message contains the position of what is wrong. However, that position may sometimes be confusing. Here are some examples:

  • Write a filter with content foobar. The unrecognised variable message will mark as position the end of the string (would make sense to mark the beginning)
  • Write a filter with content /*. The unclosed comment will be marked at character 0 no matter how many whitespace there is before it (actually, this was introduced by me with https://gerrit.wikimedia.org/r/#/c/425321/)

More generally, the reported position is the end of the 'wrong part' (as a side comment, Ace doesn't move the caret if the position is equal to the very last position in the rules string). Although T187686 may solve at least a part of this problem, in the meanwhile we should make reported positions more useful.