I would like to request the feature where a regular expression can be specified to extract the line number for a line in the Messages or Compiler tags in the Message Window. If a line number can be extracted, then jump to that line. I am using Geany with Swordfish Basic, used for PIC microcontroller programming. If the Swordfish compiler detects bugs, it display the error message and a line number in the Compiler tag. Multiple lines are added together with the error message line which contains the line number. By clicking on that line, it should jump to the reported line number.
![Capture](https://user-images.githubusercontent.com/49414842/55752988-91fe8600-5a49-11...)
`Menu->Build->Set Build Commands->Error Regular Expression` two places. See [the manual](https://www.geany.org/manual/current/index.html#build-settings-section) for the regular expression use.
Closed #2121.
Hi
Thanks very much for your reply to my previous email.
This is the regex I came up with: (\b[A-Z][:].*.bas\b)|(\b(\d+)\b)
It parses the following line into filename (a BAS file) and the line number:
Error[] F:\Projects\GSM Controller\GSM Controller No WiFi\18F27K40 GSM Controller No WiFi Only GSM.bas 1431 : Identifier not declared : sendAndChec1k
It was tested with the website www.regextester.com and I pasted it into the two mentioned error regular expression fields.
However, I see no difference in the lines in the Compiler tag. The big thing is by clicking on the line it does not take me to the corresponding line number.
Sorry for this nuisance request, please assist with some more pointers on what I am doing wrong to get to be able to click through from the error message line to the line number in the code.
Thanks very much in advance
Bernard
On Tue, Apr 9, 2019 at 12:22 AM elextr notifications@github.com wrote:
Menu->Build->Set Build Commands->Error Regular Expression two places. See the manual https://www.geany.org/manual/current/index.html#build-settings-section for the regular expression use.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/2121#issuecomment-481030030, or mute the thread https://github.com/notifications/unsubscribe-auth/AvICuiacqbZgwBWmg1eyJ03MqV3la8Zuks5ve8ESgaJpZM4ci_bT .
Some observations on your regex:
1. it has the parts that match the filename and parts that match the line number as alternates `|` so it will never match both, and
2. it has three subpatterns `()`, not just two, thats ok, but be aware Geany will only look at the first two.
Hi
I changed the regex to this ^.*(\b[A-Z][:].*bas\b)[ ](\b\d+\b)\b.*
and its working beautifully!! : The line is highlighted and I can jump to it with a click - awesome!
It was a learning curve with regular expressions and their power is incredible.
Thanks very much for your assistance and patience. I am very pleased with the outcome. My migration to Geany as the preferred editor for Swordfish Basic is now complete.
Big time appreciated!!
Regards
Bernard
On Thu, Apr 11, 2019 at 12:49 AM elextr notifications@github.com wrote:
Some observations on your regex:
it has the parts that match the filename and parts that match the line number as alternates | so it will never match both, and 2.
it has three subpatterns (), not just two, thats ok, but be aware Geany will only look at the first two.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/2121#issuecomment-481896574, or mute the thread https://github.com/notifications/unsubscribe-auth/AvICuglDVm_o0k9od0pCrhn-OuG77EFsks5vfmpkgaJpZM4ci_bT .
github-comments@lists.geany.org