Grdowns/launch configs#3215
Conversation
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
|
TODO:
|
…/vscode-cpptools into grdowns/launch-configs
…/vscode-cpptools into grdowns/launch-configs
| } | ||
| 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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
This will likely fail. We should probably use the jsonc parser instead.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…/vscode-cpptools into grdowns/launch-configs
…/vscode-cpptools into grdowns/launch-configs
|
I disabled the debug and launch. |