The extension contributes breakpoints for OpenQASM and a `wai-quantum` debugger whose launch settings (program, stopOnEntry, inputs, noise, method, outcomes) are the ones `wai-quantum dap` reads; it starts the adapter as the command line's dap verb, and "Debug the program" debugs the file in the editor. The Lua configuration registers the adapter with the debug adapter plugin, and languages.toml declares it with a launch template. test/check.mjs holds the manifest to the adapter's source and checks the client starts it; the editors workflow runs the debugger's module tests and tests/dap.rs on Linux and macOS. Co-Authored-By: Claude Opus 5.5 <[email protected]>
39 lines
1.3 KiB
TOML
39 lines
1.3 KiB
TOML
# OpenQASM for an editor configured by languages.toml: the language server,
|
|
# the formatter, the debugger (`wai-quantum dap`) and the tree-sitter
|
|
# grammar. Add this to languages.toml in your configuration directory, put
|
|
# runtime/queries/openqasm/ under its runtime/ directory, then fetch and build
|
|
# the grammar with the editor's `--grammar fetch` and `--grammar build`.
|
|
#
|
|
# `rev` names a branch here; pin it to a commit for a build that never moves.
|
|
|
|
[language-server.wai-quantum]
|
|
command = "wai-quantum"
|
|
args = ["lsp"]
|
|
|
|
[[language]]
|
|
name = "openqasm"
|
|
scope = "source.openqasm"
|
|
file-types = ["qasm"]
|
|
comment-tokens = "//"
|
|
block-comment-tokens = { start = "/*", end = "*/" }
|
|
indent = { tab-width = 2, unit = " " }
|
|
language-servers = ["wai-quantum"]
|
|
formatter = { command = "wai-quantum", args = ["fmt"] }
|
|
auto-format = false
|
|
|
|
# The engine's debugger: breakpoints by line, steps, and the state's probes.
|
|
[language.debugger]
|
|
name = "wai-quantum"
|
|
transport = "stdio"
|
|
command = "wai-quantum"
|
|
args = ["dap"]
|
|
|
|
[[language.debugger.templates]]
|
|
name = "program"
|
|
request = "launch"
|
|
completion = [{ name = "the program", completion = "filename", default = "." }]
|
|
args = { program = "{0}", stopOnEntry = true }
|
|
|
|
[[grammar]]
|
|
name = "openqasm"
|
|
source = { git = "https://git.transaction.science/Transaction-Science/open-standards", rev = "main", subpath = "wai/tools/tree-sitter-openqasm" }
|