Skip to content
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

Q# notebook magic command syntax highlighting support #10772

Closed
adrianleh opened this issue Jul 11, 2022 · 3 comments
Closed

Q# notebook magic command syntax highlighting support #10772

adrianleh opened this issue Jul 11, 2022 · 3 comments
Labels
feature-request Request for new features or functionality

Comments

@adrianleh
Copy link

Current situation:
When using Q#, one can create Jupyter notebooks that run python and then change cells to contain Q# code with a magic command %%qsharp in the first line of a cell (see https://docs.microsoft.com/en-us/azure/quantum/how-to-python-qdk-local#the-qsharp-magic-command). Right now, this causes there to be not proper syntax highlighting as VSCode still tries to highlight code as python. While there is an option to change the language mode (see screenshot below), Q# is not an option to change to.
If one opens up a notebook as a pure iqsharp, the syntax highlighting works as expected. Though, in this mode users cannot include python code interacting with Q# code. Such interoperation is often required for classical operations (i.e., preparation of quantum program, data visualization, etc.)

Desired behavior:
Ideally, VSCode would recognize the %%qsharp magic command and change the syntax highlighting of a given Jupyter cell to Q#. Barring that, it would be nice to have an option to switch cells manually to Q# highlighting.

Issue_vscode_lang

@rebornix rebornix added the feature-request Request for new features or functionality label Jul 11, 2022
@rebornix rebornix transferred this issue from microsoft/vscode Jul 11, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jul 11, 2022
@rebornix
Copy link
Member

Moving to Jupyter for now as the magic command is a Jupyter knowledge. To support this we might need changes or APIs from VS Code core though.

@rchiodo
Copy link
Contributor

rchiodo commented Jul 12, 2022

See #4588

@rchiodo
Copy link
Contributor

rchiodo commented Jul 14, 2022

Adding the relevant data to the original issue. Closing as a dupe. Thanks.

@rchiodo rchiodo closed this as completed Jul 14, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants
@rebornix @rchiodo @adrianleh and others