Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unusual line number and column format in output #287

Closed
Timmmm opened this issue Aug 11, 2023 · 5 comments
Closed

Unusual line number and column format in output #287

Timmmm opened this issue Aug 11, 2023 · 5 comments

Comments

@Timmmm
Copy link
Contributor

Timmmm commented Aug 11, 2023

Sail gives the complete line and column range for error messages by default:

Warning: Redundant case sail-riscv/model/riscv_sys_control.sail:206.6-7:
206 |      _ => false
    |      ^

Laudable, but this is an unusual format that tools like IDEs don't recognise by default. Would you accept a PR changing it to the far more standard format filename:line:column:?

@Alasdair
Copy link
Collaborator

Removing the range shouldn't be needed, switching to:

sail-riscv/model/riscv_sys_control.sail:206.6-7: Warning: Redundant case
206 |      _ => false
    |      ^

should be enough for most editors to pick it up correctly

@Timmmm
Copy link
Contributor Author

Timmmm commented Aug 11, 2023

Not VSCode unfortunately. It has no issue with the position - just the 206.6-7 ending. It's link parsing code is extremely complex and supports a lot of formats but this isn't one of them. :-(

Based on that file you could do this:

Warning: Redundant case sail-riscv/model/riscv_sys_control.sail line 206-208 col 4-5

But I doubt that would be well supported by other editors. Perhaps something like this would be best:

Warning: Redundant case sail-riscv/model/riscv_sys_control.sail:206:4 - 208:5

I believe that would be recognised by most IDEs (including VSCode) and it retains the ending line/column.

@Alasdair
Copy link
Collaborator

We are following the GNU document https://www.gnu.org/prep/standards/html_node/Errors.html so I'm suprised VSCode doesn't like it

@Timmmm
Copy link
Contributor Author

Timmmm commented Aug 12, 2023

Ah interesting. Maybe you're the first people to actually use that format! I can't say I've seen it anywhere else.

I'll see how easy it is to add that format to VSCode.

@Timmmm
Copy link
Contributor Author

Timmmm commented Aug 29, 2023

This is fixed in VSCode now (on master), except for the :startline-endline, which is difficult to distinguish from :startline.startcol-endcol with regex. Not very important though; it will still pick up the start line.

@Timmmm Timmmm closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants