vivekmalneedi / veridian

A SystemVerilog Language Server
MIT License
115 stars 14 forks source link

Include the filename in the verilator regex #191

Open jagjordi opened 1 month ago

jagjordi commented 1 month ago

https://github.com/vivekmalneedi/veridian/blob/aca8ee110002bab42435830823db8d569221985e/src/diagnostics.rs#L243

When using includes, verilator will print the errors of the included files. Thus if there are errors in the included file they will be also printed in the "parent" file, but the line numbers will be completely messed up and the errors will appear in random places.

It would be better to include the current file name in the error parsing string.

I am not familiar with rust but the regex should be modified as follows

r"%(?P<severity>Error|Warning)(-(?P<warning_type>[A-Z0-9_]+))?: + file_path + :(?P<line>\d+):((?P<col>\d+):)? ?(?P<message>.*)"

jagjordi commented 1 month ago

Managed to fix it myself with a bit of ChatGPT :)