Adding spec compat mode for editing openqasm files - #3649
Draft
Ian Davis (idavis) wants to merge 1 commit into
Draft
Adding spec compat mode for editing openqasm files#3649Ian Davis (idavis) wants to merge 1 commit into
Ian Davis (idavis) wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This branch adds an editor-focused compatibility mode for OpenQASM programs that are valid under the OpenQASM specification but use constructs the QDK cannot compile. It separates editing and specification validation from QDK execution so these programs remain useful in VS Code while their runtime limitations stay explicit.
Editing Modes
The new
qdk.openqasm.modesetting controls how the editor handles OpenQASM files.autoqdkspecAn explicit
qdkorspecselection takes precedence over automaticdetection. A temporary per-compilation override takes precedence over the
workspace setting, and resetting the override restores the configured mode.
Editor Experience
limitation and offers to switch back to QDK mode
Spec mode disables features that require QDK compilation, including:
OpenQASM editing services remain registered, including diagnostics, completions, definition lookup, references, and rename support.
OpenQASM Compatibility
Spec mode allows specification validation of programs that use constructs outside the QDK compilation subset without treating the QDK limitation as a source error. Examples include:
defcaldefinitionsdelayexterndeclarationsSpec mode is an editing and validation mode, not an alternative execution backend. A program must run in QDK mode before it can use simulation, debugging, circuit generation, resource estimation, QIR generation, or Azure Quantum submission.
Language Service Integration
The effective mode is resolved in the Rust language service and propagated through the WASM and
qsharp-langAPIs to the VS Code extension. The branch adds:auto,qdk, andspec