Sublime Forum

Build system regex improvement 2

#1

I’ve read a seemingly stalled topic (here) that discussed this matter before.

I’m rather new to Sublime Text and this build system it uses to build build systems (and I’m fascinated by it, by the way, so I’m apologizing for the rant) but it’s unbelievable how this issue is not a recurring one and hasn’t been solved yet.

My problem is that the build system expects that the file, line, column, and error message quartet comes in this certain order and it is a quartet at all (no missing members). Yes, it allows right-side missing members, meaning that you can omit error message, or error message and column. But you cannot have column missing and have error message at the same time.

While this order seems to be logical, I’m pretty sure there’s a gazillion of compilers/builder/whatsoever that doesn’t live up to this expectation. Unfortunately, the one I’m using doesn’t either :cry: I’ve read the docs mentioned in that topic and this one about file_regex, here and I find it inexplicable why this is handled the way it is :confused:

The file_regex + line_regex duo with the “if line is found then search for file backwards” seems to be an overly complicated attempt to achieve something that could be simply completed by using named matching groups. Attempt, because it’s complicated and unreliable.

Here’s an example

.
.
.
restore backups and roll back database and code!
ERROR: 
Migration NEJP_KAR_V00.001.0007__kar_sys_app_user.sql failed
------------------------------------------------------------
SQL State  : 42000
Error Code : 1735
Message    : ORA-01735: nem megengedett ALTER TABLE opci�
Location   : D:\Projects\_vp_ws_1\_projects\NEJP\DDL\prepared\KAR Cache\00\001\NEJP_KAR_V00.001.0007__kar_sys_app_user.sql (D:\Projects\_vp_ws_1\_projects\NEJP\DDL\prepared\KAR Cache\00\001\NEJP_KAR_V00.001.0007__kar_sys_app_user.sql)
Line       : 21
Statement  : alter table kar_sys_log add constraint fk_kar_sys_log$sys_app_user                                  foreign key ( sys_app_user_id ) references kar_sys_app_user ( sys_app_user_id ); -- This FK is created with table kar_sys_app_user
.
.
.

Complicated:
The build result I get shows the error message first, the file name second, the line number third and it has no column information. This means that no combination of file_regex and line_regex can retrieve the error message, no matter how hard I try…

And unreliable:
I could fetch the file and the number in one run using
Message.*?\nLocation\s*:.*?\((.+?)\)\nLine\s*:\s*(\d+)
for line_regex. Sadly, that doesn’t work as expected. The Build Result shows the errors and can navigate them using F4 and Shift+F4, however, as soon as the file name and the line numbers are not on the same line in the result, the errors are not shown inline in the files and neither is the editor navigated to the matching file and line :disappointed:

To able to achieve that I have to parse the result using line_regex and then use file_regex to backtrack the file. This shows the error inline, which is the complete match for the file_regex, and thus, irrelevant.

Also, as a side effect, the Build Result navigation no longer highlights the file_regex match, only the line_regex which is much less conspicuous when navigating the results.

2 Likes

#2

we can make file_regex an array to express more complex regexs easily.

0 Likes

#3

And how would that help to move the error message to from the first group to the fourth one so that the build system would recognize it as an error message, without populating the third group with anything?

0 Likes

#4

no, since were talking about improving regex matching, i made a suggestion besides the one you suggested wich i agree with.

0 Likes

#5

You can just add an empty capture for the column if you don’t have one.

I created an issue about this problem with different order of information and the inflexibility of the system. Feel free to add your ideas to that as well. (no link because searching on github on mobile sucks)

0 Likes

#6

Ohh, I see. I’m sorry, my bad. I thought you were suggesting an existing solution.

0 Likes

#7

Good idea. I checked github and found these there:

I suppose one of these was the one you were referring to. However, these issues are ancient, one of them is opened in 2014, and the other one in 2015. Are they still considered alive?

0 Likes

#8

All issues are more or less monitored by the developers and will be considered while someone is working on a related area.

Unfortunately we still have no idea what the current dev cycle is going to be about, but since it’s been a while I hope it will be something big :wink:

3 Likes

#9

Nice! :smiley: Eagerly awaiting :watch:

0 Likes

#10

@wbond, would you consider handling some of the many build system issues in the next dev cycle ?

0 Likes

#11

We have some changes related to build systems coming, but if those issues aren’t marked as “next dev cycle”, then we probably haven’t done anything with them.

0 Likes