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

Line numbers not aligned #16150

Open
1 of 2 tasks
e-vissch opened this issue Oct 26, 2024 · 1 comment
Open
1 of 2 tasks

Line numbers not aligned #16150

e-vissch opened this issue Oct 26, 2024 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers output-renderer

Comments

@e-vissch
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Can see in image that the line numbers do not align with the error, can see this then leads to incorrect underlining with error message in next image.

I also tried switching to the latest release version with same problem. The issue goes away if there is text in the first line.

Image

Image

VS Code Version

Version: 1.94.2 Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427 Date: 2024-10-09T16:08:44.566Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Darwin arm64 23.1.0

Jupyter Extension Version

v2024.11.2024102401 (pre-release)

Jupyter logs

No response

Coding Language and Runtime Version

Python 3.10

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

None

@e-vissch e-vissch added the bug Issue identified by VS Code Team member as probable bug label Oct 26, 2024
@vs-code-engineering vs-code-engineering bot added the triage-needed Issue needs to be triaged label Oct 26, 2024
@DonJayamanne DonJayamanne added notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) and removed triage-needed Issue needs to be triaged labels Dec 11, 2024
@DonJayamanne
Copy link
Contributor

DonJayamanne commented Dec 11, 2024

Simple enough fix, we need to ignore the leading empty lines, in Jupyter kernel the leading empty lines are always truncated before executing the code.
We can shift the line numbers in the tracback accordingly.

Note: Diagnostics are provided by core, however the stack trace is provided by Jupyter ext, and the line numbers provided are off.

@DonJayamanne DonJayamanne assigned amunger and rebornix and unassigned DonJayamanne Dec 11, 2024
@DonJayamanne DonJayamanne added output-renderer good first issue Good for newcomers and removed notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers output-renderer
Projects
None yet
Development

No branches or pull requests

4 participants