-
Notifications
You must be signed in to change notification settings - Fork 97
V1.3 features
You can now format Q# files. Either,
- Configure VS Code to format on save (see https://code.visualstudio.com/updates/v1_6#_format-on-save)
- Use
Format document
from the command palette - Use the
Alt + Shift + F
keyboard shortcut.
You can also select a block of code and format only the selection via the right-click menu (or the keyboard shortcut shown on that menu).
Formatting can be enabled/disabled through a checkbox on the VS Code settings for the Q# language:
Q# now has a linter! There are 3 rules in this first release, two that are on by default (and will show up as warnings in the editor). Example below:
These are the rules included in this release:
needlessParens
divisionByZero
redundantSemicolons
You can override the diagnostic level of each rule to one of three levels: allow
, warn
, or error
.
You can set the lint levels from the qsharp.json
file in a project as follows,
{
"lints": [
{
"lint": "needlessParens",
"level": "allow",
},
{
"lint": "redundantSemicolons",
"level": "warn",
},
{
"lint": "divisionByZero",
"level": "error",
}
]
}
To ease creating the necessary project structure for a multi-file Q# project, there is now a Create Q# project
command. This will create minimal ./qsharp.json
and ./src/Main.qs
files. If you run the command from the Command Palette, these will be created in the root of the open workspace folder. You can also right-click on the folder in the File Explorer to create the files in that folder, as shown below.
You can now authenticate to an Azure Quantum workspace using a connection string, rather than AzureAD authentication. See the Azure Quantum documentation on how to enable and locate a connection string.
When you click to add a quantum workspace (see https://github.com/microsoft/qsharp/wiki/Submitting-jobs-to-Azure-Quantum), you will first be asked to choose between AzureAD or a Connection String to authenticate. If you select Connection String
, enter the connection string found from the Azure portal.
If you need to update the connection string, simply remove and re-add the workspace with the new connection string.
If the connection to an Azure Quantum workspace encounters issues, it will now show with an alert icon, and hovering the workspace will provider error information in the tooltip, as shown below.
Click the refresh icon at the top right of the workspace area to retry (or right-click on the workspace and remove it if necessary).