Handle QIR generation errors when there's no profile specified
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 212
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 65
Description
In VS Code, if you write Q# code and don't specify a target profile in qsharp.json or on the entrypoint:
1. The editor acts like you selected profile Unrestricted
2. The QIR generation command acts like you selected profile Adaptive
Since the latter is more restrictive, it may produce additional errors (e.g. if you call a simulation-only intrinsic) and it's not clear how to surface them. Right now, I believe we pick the first and give it a special error code so that it can be dismissed with a quick fix.
Another way to handle this might be to ask for a profile selection in the command palette (which can have steps for collecting user input) and then persist that choice to the file or project so that the editor naturally displays the errors that would arise during QIR generation.
That's just one idea - this will require further thought and discussion.
Contributor guide
Research direction
Start by comparing how the VS Code editor and the QIR generation command resolve profiles from qsharp.json and the entrypoint. Review the existing special error-code and quick-fix behavior, then define and document the agreed profile-selection or persistence behavior and how generation errors should be surfaced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- compilers, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100