Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@grdowns
Copy link
Contributor

@grdowns grdowns commented Feb 25, 2019

  • Implement debug configurations that will build the active C/C++ file and launch a debugger
  • Add command to run the configuration
  • Modify build tasks to resolve the compiler via PATH instead of hard-coding path

@grdowns
Copy link
Contributor Author

grdowns commented Feb 25, 2019

TODO:

  • Get working scenario for workspaceFolder open but active file outside of workspaceFolder
  • Test Mac debugger name; should be lldb for Mac and lldb-mi I believe

}
rawTasksJson.tasks.push(selectedTask.definition);
// TODO: It's dangerous to overwrite this file. We could be wiping out comments.
await writeFileText(getTasksJsonPath(), JSON.stringify(rawTasksJson, null, 2));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way we can use the vscode API to write to this file? I would like to avoid losing existing comments in the file and it might be a bit of work to parse them out ourselves. Perhaps the jsonc parser can help us out, but I'm unfamiliar with the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure! One possible solution is to invoke the "Configure Tasks" command, however it will pop up a quickpick menu for the user to select, and as far as I know the command itself doesn't take any arguments (gross). Otherwise the VS Code API does not expose any means as far as my research goes.

Another idea is to look at how VS Code does it to derive some possible solutions.

const fileContents: Buffer = fs.readFileSync(path);
let rawTasks: any = {};
try {
rawTasks = JSON.parse(fileContents.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will likely fail. We should probably use the jsonc parser instead.

@sean-mcmanus

This comment has been minimized.

@sean-mcmanus sean-mcmanus self-assigned this Feb 25, 2019
@bobbrow

This comment has been minimized.

@sean-mcmanus

This comment has been minimized.

@sean-mcmanus

This comment has been minimized.

@sean-mcmanus

This comment has been minimized.

@sean-mcmanus
Copy link
Contributor

I disabled the debug and launch.

Copy link
Member

@bobbrow bobbrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@sean-mcmanus sean-mcmanus merged commit 3d7937f into master Mar 1, 2019
@sean-mcmanus sean-mcmanus deleted the grdowns/launch-configs branch March 1, 2019 00:46
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants