MayaSublime
MayaSublime copied to clipboard
Line number in errors is relative to function instead of the whole file.
For example I get an error:
# Error: list index out of range
# Traceback (most recent call last):
# File "<string>", line 72, in submit
# IndexError: list index out of range #
But it's in fact line 72 considering that line 0 is at the beginning of the submit function. The real line number was in fact 121.
This is a problem when used selected text to Maya instead of the whole file. The exception comes from Maya and not Sublime, so Maya only knows the chunk of text that you sent it. I am not sure how to go about faking this unless we ship back serialized traceback details to reformat, or we parse the traceback text and reformat the location information.
Maybe we could send the selected text padded by newlines to fake it to match the offset in the source file.