QuantumKatas icon indicating copy to clipboard operation
QuantumKatas copied to clipboard

error message points to a wrong line number

Open sandreenko opened this issue 2 years ago • 3 comments

image the problem is that on line 6 the bracket is not closed but the error message tells us about line 5.

sandreenko avatar Sep 13 '21 20:09 sandreenko

Good point! I suspect the culprit is https://github.com/microsoft/QuantumKatas/blob/852009b3ef96db0a7eed0bcc02bbe8b706452697/utilities/Microsoft.Quantum.Katas/KataMagic.cs#L98 - we're stripping the first line (the magic) from the code in the cell before compiling it, so it ends up reporting line numbers that don't match the cell line numbers.

I think it makes sense to wait with the fix until https://github.com/microsoft/QuantumKatas/pull/620 is complete, since that PR refactors the magics, but after that it should be fixable by appending an extra empty line before the rest of the code in the cell before compiling it.

Thank you for the report!

tcNickolas avatar Sep 13 '21 22:09 tcNickolas

Hi @tcNickolas, I would love to work on this issue. Maybe I can take care of this is in #620 itself

Manvi-Agrawal avatar Sep 14 '21 02:09 Manvi-Agrawal

@Manvi-Agrawal That will be great! Generally it's cleaner to keep unrelated changes separate, since this makes troubleshooting easier if anything breaks (allows to check which of the changes was breaking one). Let's wait until #620 is done and do the fix afterwards.

tcNickolas avatar Sep 14 '21 17:09 tcNickolas

We will be migrating the Katas to the new QDK that will use a different infrastructure (see https://devblogs.microsoft.com/qsharp/introducing-the-azure-quantum-development-kit-preview/ for the announcement), so we won't continue to improve the existing infrastructure of Q# notebooks magics. Closing this issue as "won't fix".

tcNickolas avatar Sep 28 '23 23:09 tcNickolas

Thanks @tcNickolas for your valuable guidance.

Looking forward to the new kata experience. Just had a look at https://quantum.microsoft.com/en-us/experience/quantum-katas, and the experience looks way more polished :-)

Manvi-Agrawal avatar Oct 12 '23 01:10 Manvi-Agrawal