Repro steps:
- In VS Code, run "Create: new Jupyter notebook" command to create a notebook.
- Type this in a code cell:
%%qsharp
operation Foo() : Unit {
}
- Hit Alt-Shift-F to format the cell.
Expected:
- Code is formatted and the
%%qsharp cell remains at the top
Actual:
I'm fairly sure the code below is the issue. We erase the %%qsharp magic and replace it with whitespace when communicating with the language service, and the formatter of course gets rid of that "whitespace"... Maybe we can replace it with a comment or something instead.
https://github.com/microsoft/qsharp/blob/7c2296061bf46a3ef6203f1fdfa0fc09857033c6/vscode/src/notebook.ts#L200-L203
Repro steps:
Expected:
%%qsharpcell remains at the topActual:
%%qsharpcell is gone.I'm fairly sure the code below is the issue. We erase the
%%qsharpmagic and replace it with whitespace when communicating with the language service, and the formatter of course gets rid of that "whitespace"... Maybe we can replace it with a comment or something instead.https://github.com/microsoft/qsharp/blob/7c2296061bf46a3ef6203f1fdfa0fc09857033c6/vscode/src/notebook.ts#L200-L203