Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different debug config for different launch targets #2801

Merged
merged 7 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# What's New?

## 1.16
Features:
- Support different debug config for different targets. [PR #2801](https://github.com/microsoft/vscode-cmake-tools/pull/2801) [@RichardLuo0](https://github.com/RichardLuo0)

## 1.15
Features:
- Added support for the CMake Debugger. [#3093](https://github.com/microsoft/vscode-cmake-tools/issues/3093)
Expand Down
60 changes: 48 additions & 12 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1341,34 +1341,70 @@ export class ExtensionManager implements vscode.Disposable {
return this.runCMakeCommandForProject(cmakeProject => cmakeProject.quickStart(folder));
}

launchTargetPath(folder?: vscode.WorkspaceFolder | string) {
launchTargetPath({ folder, targetName }: { folder?: vscode.WorkspaceFolder | string; targetName?: string }) {
telemetry.logEvent("substitution", { command: "launchTargetPath" });
return this.queryCMakeProject(cmakeProject => cmakeProject.launchTargetPath(), folder);
return this.queryCMakeProject(async cmakeProject => {
if (targetName !== undefined && targetName !== null) {
await cmakeProject.setLaunchTargetByName(targetName);
}
const targetPath = await cmakeProject.launchTargetPath();
return targetPath;
}, folder);
}

launchTargetDirectory(folder?: vscode.WorkspaceFolder | string) {
launchTargetDirectory({ folder, targetName }: { folder?: vscode.WorkspaceFolder | string; targetName?: string }) {
telemetry.logEvent("substitution", { command: "launchTargetDirectory" });
return this.queryCMakeProject(cmakeProject => cmakeProject.launchTargetDirectory(), folder);
return this.queryCMakeProject(async cmakeProject => {
if (targetName !== undefined && targetName !== null) {
await cmakeProject.setLaunchTargetByName(targetName);
}
const targetDirectory = await cmakeProject.launchTargetDirectory();
return targetDirectory;
}, folder);
}

launchTargetFilename(folder?: vscode.WorkspaceFolder | string) {
launchTargetFilename({ folder, targetName }: { folder?: vscode.WorkspaceFolder | string; targetName?: string }) {
telemetry.logEvent("substitution", { command: "launchTargetFilename" });
return this.queryCMakeProject(cmakeProject => cmakeProject.launchTargetFilename(), folder);
return this.queryCMakeProject(async cmakeProject => {
if (targetName !== undefined && targetName !== null) {
await cmakeProject.setLaunchTargetByName(targetName);
}
const targetFilename = await cmakeProject.launchTargetFilename();
return targetFilename;
}, folder);
}

getLaunchTargetPath(folder?: vscode.WorkspaceFolder | string) {
getLaunchTargetPath({ folder, targetName }: { folder?: vscode.WorkspaceFolder | string; targetName?: string }) {
telemetry.logEvent("substitution", { command: "getLaunchTargetPath" });
return this.queryCMakeProject(cmakeProject => cmakeProject.getLaunchTargetPath(), folder);
return this.queryCMakeProject(async cmakeProject => {
if (targetName !== undefined && targetName !== null) {
await cmakeProject.setLaunchTargetByName(targetName);
}
const targetPath = await cmakeProject.getLaunchTargetPath();
return targetPath;
}, folder);
}

getLaunchTargetDirectory(folder?: vscode.WorkspaceFolder | string) {
getLaunchTargetDirectory({ folder, targetName }: { folder?: vscode.WorkspaceFolder | string; targetName?: string }) {
telemetry.logEvent("substitution", { command: "getLaunchTargetDirectory" });
return this.queryCMakeProject(cmakeProject => cmakeProject.getLaunchTargetDirectory(), folder);
return this.queryCMakeProject(async cmakeProject => {
if (targetName !== undefined && targetName !== null) {
await cmakeProject.setLaunchTargetByName(targetName);
}
const targetDirectory = await cmakeProject.getLaunchTargetDirectory();
return targetDirectory;
}, folder);
}

getLaunchTargetFilename(folder?: vscode.WorkspaceFolder | string) {
getLaunchTargetFilename({ folder, targetName }: { folder?: vscode.WorkspaceFolder | string; targetName?: string }) {
telemetry.logEvent("substitution", { command: "getLaunchTargetFilename" });
return this.queryCMakeProject(cmakeProject => cmakeProject.getLaunchTargetFilename(), folder);
return this.queryCMakeProject(async cmakeProject => {
if (targetName !== undefined && targetName !== null) {
await cmakeProject.setLaunchTargetByName(targetName);
}
const targetFilename = await cmakeProject.getLaunchTargetFilename();
return targetFilename;
}, folder);
}

buildTargetName(folder?: vscode.WorkspaceFolder | string) {
Expand Down
Loading