Closed petetronic closed 9 months ago
@jjallaire @petetronic Were you thinking of something like this (imagine these had colors as they do in the UI)?
AttributeError: Can't pickle local object 'plot.<locals>.money'
--> 228 plt.show()
Or maybe with the file too, or is that going to be the currently active file 90% of the time?
AttributeError: Can't pickle local object 'plot.<locals>.money'
File ~/posit/bluebook-for-bulldozers/main.py:228
--> 228 plt.show()
Or the whole first stack item?
AttributeError: Can't pickle local object 'plot.<locals>.money'
File ~/posit/bluebook-for-bulldozers/main.py:228
226 y_lin = x_lin + torch.randn_like(x_lin)
227 plt.scatter(x_lin, y_lin)
--> 228 plt.show()
230 xs_lin = x_lin.unsqueeze(1)
231 x_lin.shape,xs_lin.shape
Here's a neat example of an R dplyr error message:
Or the whole first stack item?
AttributeError: Can't pickle local object 'plot.<locals>.money' File ~/posit/bluebook-for-bulldozers/main.py:228 226 y_lin = x_lin + torch.randn_like(x_lin) 227 plt.scatter(x_lin, y_lin) --> 228 plt.show() 230 xs_lin = x_lin.unsqueeze(1) 231 x_lin.shape,xs_lin.shape
I like the whole item and if we have file information we should show it. Even better, based on a follow on discussion with JJ, he had also mentioned RStudio navigates the editor to the source of the error too (if known).
@petetronic Agreed, I like the whole item too. I'd also love if Positron navigated to the source. We'd need to do https://github.com/posit-dev/positron/issues/762 first, which would also open the door to https://github.com/posit-dev/positron/issues/761
Confirmed we now have clickable traceback links, which jump to the line in the editor. On version:
Positron Version: 2023.12.0 (Universal) build 1734
Code - OSS Version: 1.85.0
Commit: 2c5283f10482585b1d9df1925d46f7002741633d
Date: 2024-01-03T03:10:14.636Z
Electron: 25.9.7
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.2.0
https://github.com/posit-dev/positron/assets/54685329/c2d290f4-2d55-42a6-8e03-af1390437ffd
Feedback requested "if we could get trackbacks to automatically display the line of code they originate from (top of the stack) that would save a lot of extra clicking. Then I'd be more okay with having the full traceback hidden by default (as things currently stand if you are in multiple line execution mode in the editor you always need to expand the traceback to find out what line caused the error."
Bonus if we can focus the editor to the source line, if known.