-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adding ability to click to go to cell / line in Jupyter Notebooks like currently exists in normal scripts #18202
Comments
This would be handled by the formatter in python. Might be necessary for the formatter to be updated to output something VS code understands. |
I'm not sure that VS code understands the structure of .ipynb files at all though right? Like it doesn't have the concept of going into a file at a specific cell. I was suggesting the addition of this knowledge |
There's a URI that vscode does understand that would allow jumping to a specific cell. But it's VS code specific. Something like so:
where ch00001 points to the second cell. I would hazard a guess if the formatter outputted that format, it would work. |
Oh thanks, that's really helpful. Is there any documentation that shows what the ch###### actually means? Does it then allow for line + cursor position on line? I think this cell_i:line:cursor or even just cell:line:cursor is a pretty standard format amongst python tools, could be worth adding the ability to recognise this. Thanks for the info |
Not that I could find. I don't believe the schemes for URIs are documented anywhere. (That may be on purpose so they can change). They are in the vscode source though: Looks like I had the wrong scheme. Should have been |
What's more likely to happen is we are going to put all linters and formatters behind LSP, so as long as LSP understands notebook structure that will be how that works. This is being tracked in #17235 and what I'm closing this issue in favour of. Otherwise that output format is unique to |
I will explain this through example as it's easiest. When I run a linter, say flake8 over a .py file, it gives me a list of issues with the associated place that the issue is located using filename.py:linenum:charnum, which I can then click on to take my cursor to that exact location
When I run the same tool over a notebook, I get a similar information. However, whilst I can ctrl+click the filename.ipynb:cell_num:line_num_within_cell:charnum, I get no such results as shown at the bottom.
I am requesting that VS Code recognize the cell_num aspect of these tools to allow for quickly going to the right location. Cheers!
The text was updated successfully, but these errors were encountered: