Repository: vscode
Issue: Jupyter cell line numbers don't match error message line numbers
Labels: bug,notebook-output

Type: <b>Bug</b>

If I have blank lines at the beginning of a Jupyter notebook cell, and if there is an error in that cell, the error messages have line numbers apparently coming from code for which the blanks were stripped.  So the numbers don't match:

![image](https://github.com/microsoft/vscode/assets/3851891/e3e5487f-6aa7-4f4e-ab07-199fd0776303)
VS Code version: Code 1.84.1 (2b35e1e6d88f1ce073683991d1eff5284a32690f, 2023-11-06T12:37:18.666Z)
OS version: Darwin x64 23.0.0
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|7, 12, 8|
|Memory (System)|16.00GB (0.04GB free)|
|Process Argv|--crash-reporter-id edac0617-f8bb-4a37-afe0-4577dde914e6|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (32)</summary>

Extension|Author (truncated)|Version
---|---|---
atlascode|atl|3.0.7
markdown-checkbox|bie|0.4.0
markdown-mermaid|bie|1.20.0
mermaid-markdown-syntax-highlighting|bpr|1.6.0
gitignore|cod|0.9.0
auto-dark-mode-windows|dan|1.0.11
vscode-diff|fab|1.4.2
copilot-chat|Git|0.10.1
vscode-drawio|hed|1.6.6
vscode-emacs-friendly|lfs|0.9.0
zotero|mbl|0.1.11
rainbow-csv|mec|3.8.0
gather|ms-|2022.3.2
mypy-type-checker|ms-|2023.6.0
pylint|ms-|2023.10.0
python|ms-|2023.20.0
vscode-pylance|ms-|2023.11.10
jupyter|ms-|2023.10.1003070148
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.0.17
vscode-jupyter-slideshow|ms-|0.1.5
remote-ssh|ms-|0.107.0
remote-ssh-edit|ms-|0.86.0
vscode-remote-extensionpack|ms-|0.24.0
remote-explorer|ms-|0.4.1
remote-server|ms-|1.5.0
vscode-drawio-plugin-mermaid|nop|0.1.5
vscode-yaml|red|1.14.0
vscode-mermaid-editor|tom|0.19.1
vscode-icons|vsc|12.6.0
vscode-mermaid-preview|vst|1.6.3
vscode-todo-highlight|way|1.0.5

(6 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30880072
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
f6dab269:30613381
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialog:30882109
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixtcf:30871695
pythonregdiag2:30871582
pyreplss1:30886140
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
dsvsc016cf:30886111
dsvsc017:30886112
dsvsc018cf:30886115
aa_t_chat:30882232

```

</details>

<!-- generated by issue reporter -->