Fixes a problem I encountered while testing run/debug

This commit is contained in:
Bob Brown (DEVDIV) 2022-03-31 14:44:02 -07:00
Родитель e3365bbfe4
Коммит f65539f1cd
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -222,7 +222,7 @@ export class CppBuildTaskProvider implements TaskProvider {
const cppBuildTask: CppBuildTask = new Task(definition, TaskScope.Workspace, task.label, ext.CppSourceStr);
cppBuildTask.detail = task.detail;
cppBuildTask.existing = true;
if (task.group.isDefault) {
if (!util.isString(task.group) && task.group?.isDefault) {
cppBuildTask.isDefault = true;
}
return cppBuildTask;
@ -260,8 +260,8 @@ export class CppBuildTaskProvider implements TaskProvider {
// Modify the current default task
rawTasksJson.tasks.forEach((task: any) => {
if (task.label === selectedTask?.definition.label) {
task.group = { kind: "build", "isDefault": true };
} else if (task.group.kind && task.group.kind === "build" && task.group.isDefault && task.group.isDefault === true) {
task.group = { kind: "build", isDefault: true };
} else if (!util.isString(task.group) && task.group?.kind === "build" && task.group?.isDefault) {
task.group = "build";
}
});
@ -270,7 +270,7 @@ export class CppBuildTaskProvider implements TaskProvider {
const newTask: any = {
...selectedTask.definition,
problemMatcher: selectedTask.problemMatchers,
group: { kind: "build", "isDefault": true },
group: { kind: "build", isDefault: true },
detail: localize("task_generated_by_debugger", "Task generated by Debugger.")
};
rawTasksJson.tasks.push(newTask);