-
-
Notifications
You must be signed in to change notification settings - Fork 924
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
Incorrect line numbers in error messsages #2334
Comments
@emlyn - which version of Sonic Pi? |
@ethancrawford this was in 3.2.2, though I think it's been there for a couple of versions at least. You can see it also in some forum posts, such as here. |
I've noticed this a couple of times too. I haven't spent the time to figure it out. I will eventually unless some on here beats me to it. |
I've been contemplating investigating/creating a fix of some kind for a similar issue for a while - see #2336. |
Not to mention that in some of the above cases, the error is reported as coming from 'buffer X' and in others, 'workspace_X' - this would be good to address at the same time if possible! |
Looking at the last of the above screenshots, it appears that the SyntaxError there is reported in a similar fashion to what happens with external files, as described in my linked issue above - the original line triggering the error is from runtime.rb line 781. So at first glance it would seem related to it. |
Yes I agree. Cetainly recently (in 3.2.2) I have noticed that the error line number is one too few. Also if the error is a mssing end statement it gives the error line 781 (presumably the max size of the buffer) even though it doesn't exist. |
@rbnpi - see my above comment - I suspect that errors not triggered from code directly in a buffer are what those line numbers such as 781 refer to... |
I'm currently working on the |
So I believe the syntax error case seen in the last of the above screenshots is at least partly caused by 80dcdce |
I'm close to having a PR ready for both the instances raised in this issue as well as #2336 🥳 |
This has been fixed on the main branch here : 1746ddc |
I've noticed that the error messages often have the line number (and marker) off by one:
If the error is on the first line, then the line number and marker are omitted:
And for some errors, the line number is completely off:
The text was updated successfully, but these errors were encountered: