microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.24k stars 28.56k forks source link

Jupyter files are marked dirty upon activation, before editing #140147

Open oscarrutt opened 2 years ago

oscarrutt commented 2 years ago

Issue Type: Bug

Quit VS Code with a tab containing a Jupyter notebook. Re-open VS Code. When the Jupyter tab is made active, either because it was active when VS Code was quit or by clicking on its tab to activate it, the file is marked dirty, as evidenced by the color outline of the tab, even though the contents have not changed, at least by an action of the user.

My Jupyter notebooks contain Julia and markdown. This behavior does not happen with other files including Julia source files, .jl.

VS Code version: Code 1.63.0 (7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e, 2021-12-07T05:15:48.091Z) OS version: Darwin x64 15.6.0 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz (2 x 2400)| |GPU Status|2d_canvas: unavailable_software
gpu_compositing: disabled_software
metal: disabled_off
multiple_raster_threads: disabled_off
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: disabled_software
webgl: unavailable_software
webgl2: unavailable_software| |Load (avg)|3, 4, 5| |Memory (System)|8.00GB (0.02GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (40) Extension|Author (truncated)|Version ---|---|--- ada|Ada|23.0.1 Bookmarks|ale|13.2.2 pascal|ale|9.4.0 pascal-formatter|ale|2.6.0 project-manager|ale|12.4.0 octave-hacking|apj|0.2.12 vscode-svgviewer|css|2.0.0 vcard|cst|1.0.1 vscode-mac-color-picker|dae|1.0.2 textpad-icon-theme|dam|1.19.21 vscode-markdownlint|Dav|0.45.0 ada-snippets|Ent|0.3.0 gc-excelviewer|Gra|4.0.45 vscode-back-forward-button|gri|0.1.6 vscode-lyx|gyt|0.0.4 latex-workshop|Jam|8.23.0 svn-scm|joh|2.15.2 language-julia|jul|1.5.8 keen-neutral-icon-theme|kee|1.0.8 octave|lea|0.1.1 eps-preview|mkv|0.3.0 python|ms-|2021.12.1559732655 jupyter|ms-|2021.11.1001550889 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.4 cpptools|ms-|1.7.1 cpptools-extension-pack|ms-|1.1.0 postscript|mxs|1.0.1 vscode-json-editor|nic|0.3.0 vsc-octave-debugger|pau|0.4.23 bib|phr|0.3.0 ipf|qms|1.0.1 vscode-data-preview|Ran|2.3.0 markdown-preview-enhanced|shd|0.6.1 octave|toa|0.0.3 pdf|tom|1.2.0 debug|web|0.25.1 txt-syntax|xsh|0.2.0 markdown-all-in-one|yzh|3.4.0 json|Zai|2.0.2 (3 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythontb:30283811 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 vscop804:30404766 vs360:30404995 vsrem710cf:30416617 py55gd98:30411514 vscexrecpromp3t1:30407762 ```
rebornix commented 2 years ago

@roblourens this is likely the same issue with cell language you mentioned before.

roblourens commented 2 years ago

We support cell magics for language by editing the language after the notebook is opened, which makes the cell dirty. We can

@rebornix we discussed this and I think we came to some decision, which I didn't write down? Did we prefer adding a "transient language" option?

roblourens commented 1 year ago

Unfortunately I can't remember what needs to be done here, do you know @rebornix? I think either of the options I described above make sense.

rebornix commented 1 year ago

@roblourens I don't think we reach any consensus that how we handle cell magics (whether cell language should be saved, is there an upcoming JEP for supporting cell language, etc).