Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions source/vscode/src/debugger/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function registerCommands(context: vscode.ExtensionContext) {
}
startQdkDebugging(resource, {
name: "QDK: Debug Program",
stopOnEntry: true,
entry: expr,
});
},
Expand All @@ -83,7 +82,6 @@ function registerCommands(context: vscode.ExtensionContext) {
resource,
{
name: "QDK: Run and Show Circuit",
stopOnEntry: false,
showCircuit: true,
},
{ noDebug: true },
Expand Down Expand Up @@ -159,18 +157,11 @@ class QsDebugConfigProvider implements vscode.DebugConfigurationProvider {
path: fileUri.path,
})
.toString();
} else {
// if launch.json is missing or empty, try to launch the active Q# document
} else if (!config.programUri) {
// if config.programUri is not already set, try to default to the currently active document
const docUri = getActiveQdkDocumentUri();
if (docUri) {
config.type = "qsharp";
config.name = "Launch";
config.request = "launch";
config.programUri = docUri.toString();
config.shots = 1;
config.noDebug = "noDebug" in config ? config.noDebug : false;
config.stopOnEntry = !config.noDebug;
config.entry = config.entry ?? "";
}
}

Expand Down Expand Up @@ -208,9 +199,9 @@ class QsDebugConfigProvider implements vscode.DebugConfigurationProvider {
// noDebug is set to true when the user runs the program without debugging.
// otherwise it usually isn't set, but we default to false.
config.noDebug = config.noDebug ?? false;
// stopOnEntry is set to true when the user runs the program with debugging.
// stopOnEntry is set to false when the user runs the program with debugging.
// unless overridden.
config.stopOnEntry = config.stopOnEntry ?? !config.noDebug;
config.stopOnEntry = config.stopOnEntry ?? false;

return config;
}
Expand Down
Loading