-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fixes Magic Getting Erased by Format in Notebooks #1310
Conversation
fixed bug in notebooks
Benchmark for c80daabClick to view benchmark
|
Benchmark for bef7150Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a dumb question, but looking at the test, does this end up replacing %%qsharp
with //qsharp
in notebooks?
No, the text found in the notebook is only changed by the edits the formatter makes. Since there is nothing wrong format-wise with |
Benchmark for 12728e9Click to view benchmark
|
Fix regression in #1310 Bug: ![auto-open-broke](https://github.com/microsoft/qsharp/assets/16928427/0c313bc4-69f1-4b19-a779-d9c483339123) Fix: ![auto-open-fixed-2](https://github.com/microsoft/qsharp/assets/16928427/4029d801-1818-4399-9a51-1ffe34ce3f11) ![auto-open-fixed-1](https://github.com/microsoft/qsharp/assets/16928427/d8cacd35-1414-4b50-bf23-c50bc1eba8f7)
This was caused by two different bugs that are addressed in this PR:
\r\n
line endings, the raw token lexer would only consider the\n
line ending, resulting in comment tokens with trailing\r
characters in them.In order to preserve the magic command in the notebooks from getting removed as leading whitespace in a file (a formatter rule), the magic command is replaced by a comment instead of whitespace.
Fixes #1308