I propose we add a basic syntax highlighting configuration for column placeholders (Bug 23390), defined as any string surrounded by square brackets: [[itemnumber|Item number]].
Created attachment 117146 [details] [review] Bug 27747: Add CodeMirror custom syntax highlighting for column placeholders This patch adds some additional configuration to CodeMirror so that column placeholders have a distinct color in the CodeMirror SQL editor. To test, apply the patch and create or edit an SQL report which contains one or more column placeholders, e.g. [[itemnumber|Item number]], [[borrowernumber|Borrower number]], etc. Confirm that when editing the SQL, these placeholders should appear as red text. Save your report and view it. The syntax highlighting should be updated in this view too.
Created attachment 120849 [details] [review] Bug 27747: Add CodeMirror custom syntax highlighting for column placeholders This patch adds some additional configuration to CodeMirror so that column placeholders have a distinct color in the CodeMirror SQL editor. To test, apply the patch and create or edit an SQL report which contains one or more column placeholders, e.g. [[itemnumber|Item number]], [[borrowernumber|Borrower number]], etc. Confirm that when editing the SQL, these placeholders should appear as red text. Save your report and view it. The syntax highlighting should be updated in this view too. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 123108 [details] [review] Bug 27747: Add CodeMirror custom syntax highlighting for column placeholders This patch adds some additional configuration to CodeMirror so that column placeholders have a distinct color in the CodeMirror SQL editor. To test, apply the patch and create or edit an SQL report which contains one or more column placeholders, e.g. [[itemnumber|Item number]], [[borrowernumber|Borrower number]], etc. Confirm that when editing the SQL, these placeholders should appear as red text. Save your report and view it. The syntax highlighting should be updated in this view too. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 123109 [details] [review] Bug 27747: (QA follow-up) Make code consistent and add explicit brackets The while statements were including the next statement, I add brackets to make it more obvious Also the highlighting was applying to [[borrowernumber|Borrow number] I removed the break to match code above and only highlight when syntax complete and correct Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.11, thanks to everybody involved!
Enhancement not backported for 21.05