-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
Description
Issue Type: Bug
Description: Using --run with inputs causes the ipynb output file to crash the C# Language Server in VS Code when opening with Polyglot Notebooks v1.0.4403010 resulting in the notebook's Output cells being cleared. Possible fix below.
Command
dotnet-repl --run input.ipynb --exit-after-run --input id=1 --output-path output.ipynbRepro Files
VS Code C# Terminal Output Error
[LanguageServerHost]System.InvalidOperationException: didOpen received for vscode-notebook-cell:/c:/Users/xxxxxxxxxxx/repos/polyglot/playground/dotnet-repl-error/dotnet-repl-output.ipynb#W1sZmlsZQ== which is already open. - line 106
at Roslyn.Utilities.Contract.Fail(String message, Int32 lineNumber) in /_/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs:line 154
...
...Cause
dotnet-repl writes the following json key into the output file:
"language_info": {
"file_extension": ".cs",
"mimetype": "text/x-csharp",
"name": "C#",
"pygments_lexer": "csharp",
"version": "10.0"
},Fix
Replacing this key with how VS Code writes it results in the dotnet-repl file successfully loading in VS Code:
"language_info": {
"name": "polyglot-notebook"
},