-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polyglot VSCode thinks F# notebooks generated by FSharp.Formatting are C# notebooks #2685
Comments
@nhirschey adding the This situation, however, is interesting and something that should probably work. The fix on our end will likely be to use the notebook's kernelspec language if the cell metadata isn't present. |
On a related note, we provide a library for reading a writing the file formats we understand: https://www.nuget.org/packages/Microsoft.DotNet.Interactive.Documents You can use this library to read and write |
@brettfo, thank you for making this fix so quickly! That's a real help to the F# community. Additionally, I will update the FSharp.Formatting tool so that it adds @jonsequitur thank you, I was not aware. I'll keep that in mind. One of the F# formatting library's todo's is to allow generating documentation from a notebook, and your notebook parser could help with that. Thanks! |
@nhirschey we published a new extension to our insiders channel, can you give it a shot to see if it fixes this issue? You'll need to install VS Code - Insiders and then install the extension like normal, it should automatically pick up the correct version, which should be 1.0.4108061. |
@brettfo yes I checked docs from a few repos and it's fixed in the insiders version of VS Code. Thank you! |
Describe the bug
Details follow:
The F# Formatting Library generates .NET interactive notebooks. The VSCode extension previously recognized the code cells as F#, but now the polyglot extension converts them to C#. As far as I can tell it's necessary to manually go through every cell and change it to F# (not practical). This breaks all documentation notebooks previously created by F# Formatting.
For example, the extension now thinks the F# code in this notebook from the F# Data Library is C# code:
Regarding metadata ... A simple notebook generated by the F# formatting tool looks like this below in json and is what used to work with the old VSCode extension.
From experimentation, it looks like if we change
"metadata": {}
in code cells to what I have here then the cells are recognized as being F# code. Is this correct, is there anything else that you suggest?Please complete the following:
Which version of .NET Interactive are you using? (In a notebook, run the
#!about
magic command. ):.NET Interactive
Version: 1.0.360602+9bf026dabac44a6256a65168fa93dcb7e2edcca4
Library version: 1.0.0-beta.22606.2+9bf026dabac44a6256a65168fa93dcb7e2edcca4
Build date: 2023-01-31T11:33:36.0115292Z
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: