Change:
[X] Notebooks (.ipynb files) [ ] Interactive Window and/or Cell Scripts (.py files with #%% markers) I created a notebook through the tool palette and when I tried to save it, it fails because it tries to save as json. Version: 1.66.0 (user setup) Commit: Date: 2022-03-30T05:50:14.623Z Electron: 17.2.0 Chromium: 98.0.4758.109 16.13.0 V8: 9.8.177.11-electron.0 OS: WindowsNT x64 10.0. v2022.3. No response base (Python 3.8.3) No response No response_ Local
Hi When you say that it fails because it tries to save as json, what do you mean? If I try the same operation, my save dialog looks like this: <img width="505" alt="image" src="https://user-"For sure, the fact that the Save As Type dropdown shows JSON is confusing, if I save the file with the ipynb extension, it does save it successfully as a notebook. Are you seeing something different? (Note that an ipynb file is actually a json formatted document. This can explain why you're seeing what you see here).
My save dialog looks like this: [cid:-cf2e-480e-98c4-] ! If I change the extension, it changes it back and it still won't save. Also, I have tried this on two different machines - both Windows.
I also can't save new notebooks. ! !
I'm having the exact same issue. This wasn't happening one month ago, since it was the last time I used the notebook on VS Code, and it worked normally. I have tried reinstalling VS Code, but it didn't work. I have also tried this solution: ! It was posted here: But it still won't save the notebooks. However, VS Code seems to still open them normally, but I can't save anything. When I tried creating a new notebook, at first I was able to run most of the code normally. At some point, though, I also had a bug of some cells disappearing.
I can repro this if I change the dropdown at all and then select .json, but if I don't touch the dropdown and use a filename with a .ipynb extension, it works successfully. Is that the case for others hitting this issue, or does the dialog initially come up with the .json appended to the filename? Does setting the "save as type" dropdown to "no extension" work as a workaround?
This started to happen after the last update. I did not change any dropdown, just Ctrl + S and tried to save the file. Yes, with the ".ipynb" at the end of the file name. This used to work just fine. Never noticed if the file type was anything instead of JSON, but now there is no "IPYNB" or "Jupyter Notebook" file type. !
Transferring to VS code as we don't control saving files in the Jupyter extesnion. /cc
Does setting the dropdown to "no extension" and keeping the .ipynb in the filename help?
yes. Setting to "no extension" allows me to save the notebook. I didn't noticed this option before. Still, this isn't the expected behavior. Before the update I didn't have to change anything in the dropdown menu.
It works for me if I: 1) erase the .json at end of file name in save box 2) save as no extension
Glad to hear that works as a workaround. We're still trying to figure out the issue on our end since it doesn't seem to behave the same way for us when trying to repro.
I think this is just the same issue we discussed back in I think it's just worse than we realized when you have file extensions hidden. I can actually repro it now with file extensions hidden, I wasn't reproing it before. Basically we send a that ends in , and when I have file extensions hidden in windows explorer, I can normally type a different file name, and it will still save with our suggested file extension, even though I don't see it. Here it saves with .json instead. We register ".ipynb" as a file extension for the JSON language, but it's missing from the list of extensions in the save dialog filter list. I see that here we trim this list down to 10 per language: <img width="717" alt="image" src="https://user-"so .ipynb is excluded. If I make sure it is included in this list, there is no problem. is there a reason why we have to limit the list to 10? If it can only be 10, we could make sure that the extension in our defaultPath shows up in the list.
Here we find ipynb in the unsliced list of extensions, then return the sliced list that doesn't include ipynb. The order of this list seems random. I am guessing that 10 is an arbitrary number that looks good to display? We went to 20 then reverted that Or maybe having more than 10 causes some obscure issue on windows. I think we should add the matched extension to the sliced list, if it got cut out. I'll do that if nobody knows any reason not to.

Discussion:
const filter: IFilter = { name: languageName, extensions: distinct(extensions).slice(0, 10).map(e => trim(e, '.')) }; <del> if (!matchingFilter && extensions.indexOf(ext || PLAINTEXT_EXTENSION /* https://github.com/microsoft/vscode/issues/115860 */) >= 0) { </del> <ins> if (!matchingFilter && extensions.includes(ext || PLAINTEXT_EXTENSION /* https://github.com/microsoft/vscode/issues/115860 */)) { </ins> matchingFilter = filter; <ins> const trimmedExt = trim(ext || PLAINTEXT_EXTENSION, '.'); if (!filter.extensions.includes(trimmedExt)) { filter.extensions.push(trimmedExt); } </ins> return null; // first matching filter will be added to the top }