Change:
Type: <bBug</bI have noticed two problems with my vscode-insiders installation which I assume may form one issue. a notebook in nbformat 4.5 is opened, new cells do not receive cell ids, even though this is required by the format spec and is a documented feature of vscode: a new notebook is created, the format is always 4.2. I am not sure whether this is expected. Steps to reproduce: a notebook with jupyterlab or any other way (jupytext etc.), and verify that it has nbformat = 4.5 the notebook in vscode, and generate a new cell, then save. the JSON of the saved notebook - the new cell does not have a cell id. Some additional points which may be of interest The issue persists when all extensions except jupyter/python are disabled. I have recent versions of nbformat etc. installed, but I would assume this is bundled with vscode anyway. The issue also exists on the current pre-release version of the jupyter extension. I haven't found any configuration option which would enable or disable support of notebook formats 4.2 Maybe I have missed a configuration option which I should have set? VS Code version: Code - Insiders 1.84.0-insider (, 2023-10-23T05:33:33.712Z) OS version: Linux x64 6.2.0-35-generic Modes: <details<summarySystem Info</summary </details<details<summaryExtensions (18)</summaryExtensionVersion ------ vscode-neovim0.9.1 vscode-eslint2.4.2 githistory0.6.20 fuzzy-search0.0.3 black-formatter2023.5. python2023.19. vscode-pylance2023.7.40 jupyter2023.10. jupyter-keymap1.1.2 jupyter-renderers1.0.17 vscode-jupyter-cell-tags0.1.8 remote-ssh0.107. remote-ssh-edit0.86.0 remote-explorer0.5. remote-server1.5. even-better-toml0.19.2 my-vscode-utils0.0.2 pyexec0.0.1 </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
Thank you for filing this issue and sorry you are running into this. I can replicate this at my end as well. Will look into this.

Discussion:
"publisher": "vscode", "version": "1.0.0", "license": "MIT", <del> "icon": "media/icon.png", </del> <ins> "icon": "media/icon.png", </ins> "engines": { "vscode": "^1.57.0" },

"command": "ipynb.cleanInvalidImageAttachment", "title": "%cleanInvalidImageAttachment.title%" }, <del> { "command": "notebook.cellOutput.copy", "title": "%copyCellOutput.title%" } </del> <ins> { "command": "notebook.cellOutput.copy", "title": "%copyCellOutput.title%" } </ins> ], "notebooks": [ {

"when": "false" } ], <del> "webview/context": [ { "command": "notebook.cellOutput.copy", "when": "webviewId == 'notebook.output' && webviewSection == 'image'" } ] </del> <ins> "webview/context": [ { "command": "notebook.cellOutput.copy", "when": "webviewId == 'notebook.output' && webviewSection == 'image'" } ] </ins> } }, "scripts": {

}, "dependencies": { "@enonic/fnv-plus": "^1.3.0", <del> "detect-indent": "^6.0.0", "uuid": "^8.3.2" </del> <ins> "detect-indent": "^6.0.0" </ins> }, "devDependencies": { "@jupyterlab/nbformat": "^3.2.9", <del> "@types/markdown-it": "12.2.3", "@types/uuid": "^8.3.1" </del> <ins> "@types/markdown-it": "12.2.3" </ins> }, "repository": { "type": "git",

*--------------------------------------------------------------------------------------------*/ import { ExtensionContext, NotebookDocument, NotebookDocumentChangeEvent, NotebookEdit, workspace, WorkspaceEdit } from 'vscode'; <del> import { v4 as uuid } from 'uuid'; </del> import { getCellMetadata } from './serializers'; import { CellMetadata } from './common'; import { getNotebookMetadata } from './notebookSerializer';

while (true) { // Details of the id can be found here https://jupyter.org/enhancement-proposals/62-cell-id/cell-id.html#adding-an-id-field, // & here https://jupyter.org/enhancement-proposals/62-cell-id/cell-id.html#updating-older-formats <del> const id = uuid().replace(/-/g, '').substring(0, 8); </del> <ins> const id = generateUuid().replace(/-/g, '').substring(0, 8); </ins> let duplicate = false; for (let index = 0; index < notebook.cellCount; index++) { const cell = notebook.cellAt(index);

} } } <ins> /** * Copied from src/vs/base/common/uuid.ts */ function generateUuid() { // use `randomValues` if possible function getRandomValues(bucket: Uint8Array): Uint8Array { for (let i = 0; i < bucket.length; i++) { bucket[i] = Math.floor(Math.random() * 256); } return bucket; } // prep-work const _data = new Uint8Array(16); const _hex: string[] = []; for (let i = 0; i < 256; i++) { _hex.push(i.toString(16).padStart(2, '0')); } // get data getRandomValues(_data); // set version bits _data[6] = (_data[6] & 0x0f) | 0x40; _data[8] = (_data[8] & 0x3f) | 0x80; // print as string let i = 0; let result = ''; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += '-'; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += '-'; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += '-'; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += '-'; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += _hex[_data[i++]]; result += _hex[_data[i++]]; return result; } </ins>

resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== <del> "@types/uuid@^8.3.1": version "8.3.4" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== </del> detect-indent@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== <del> uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== </del>