-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Grdowns/launch configs #3215
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
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.
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.
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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.
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. |
bobbrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()