interactive icon indicating copy to clipboard operation
interactive copied to clipboard

Creating a new F# notebook switches initial cell to C# after saving

Open bmitc opened this issue 3 years ago • 5 comments
trafficstars

Describe the bug

  1. Open Visual Studio Code
  2. Create a new blank notebook
  3. Select "Create as '.dib'" (note: this bug doesn't happen if the .ipynb format is selected at this step)
  4. Select "F#" as default language
  5. Note that the initial cell is an F# cell
  6. Save the notebook to disk
  7. Note that the initial cell has now switched to a C# cell

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):

Version: 1.0.340501+e6a4bd71118e0f7b202c761dd208cfa38bd5683b

Library version: 1.0.0-beta.22405.1+e6a4bd71118e0f7b202c761dd208cfa38bd5683b

Build date: 2022-08-12T03:08:59.0408371Z
  • OS
    • [x] Windows 11
    • [ ] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Browser
    • [ ] Chrome
    • [ ] Edge
    • [ ] Firefox
    • [ ] Safari
  • Frontend
    • [ ] Jupyter Notebook
    • [ ] Jupyter Lab
    • [ ] nteract
    • [x] Visual Studio Code
    • [ ] Visual Studio Code Insiders
    • [ ] Visual Studio
    • [ ] Other (please specify)

Screenshots

If applicable, add screenshots to help explain your problem.

bmitc avatar Aug 14 '22 21:08 bmitc

Gave this a quick shot today and this only repros if the first cell is empty. We also coalesce multiple empty cells and reset the language to C#. While the coalescing makes sense, we would want to review why we reset the language.

AbhitejJohn avatar Aug 16 '22 17:08 AbhitejJohn

As a note, I have realized this only happens when creating .dib notebooks and not .ipynb notebooks.

bmitc avatar Aug 20 '22 04:08 bmitc

This may be related to https://github.com/dotnet/interactive/issues/1324

bmitc avatar Aug 26 '22 05:08 bmitc

In Visual Studio it happens for .ipynb too https://marketplace.visualstudio.com/items?itemName=MLNET.notebook

xperiandri avatar Aug 26 '22 14:08 xperiandri

Like I described in https://github.com/dotnet/interactive/issues/1827

xperiandri avatar Aug 26 '22 14:08 xperiandri

Closed as duplicate of #2289

colombod avatar Sep 27 '22 17:09 colombod

How are they connected?

xperiandri avatar Sep 27 '22 17:09 xperiandri

They relate to a bug in document metadata handling causing default languages to changedDr Diego Colombo PhDOn 27 Sep 2022, at 18:38, Andrii Chebukin @.***> wrote: How are they connected?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: @.***>

colombod avatar Sep 27 '22 18:09 colombod

Ah, sorry. I was not attentive enough

xperiandri avatar Sep 27 '22 18:09 xperiandri