Skip to content

Grdowns/launch configs#3215

Merged
sean-mcmanus merged 40 commits into
masterfrom
grdowns/launch-configs
Mar 1, 2019
Merged

Grdowns/launch configs#3215
sean-mcmanus merged 40 commits into
masterfrom
grdowns/launch-configs

Conversation

@grdowns
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread Extension/src/Debugger/configurationProvider.ts Outdated
Comment thread Extension/src/Debugger/extension.ts
Comment thread Extension/src/Debugger/extension.ts Outdated
Comment thread Extension/src/common.ts
}
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
Copy Markdown
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
Copy Markdown
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.

Comment thread Extension/src/common.ts
const fileContents: Buffer = fs.readFileSync(path);
let rawTasks: any = {};
try {
rawTasks = JSON.parse(fileContents.toString());
Copy link
Copy Markdown
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.

Comment thread Extension/src/Debugger/extension.ts Outdated
@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
Copy Markdown
Contributor

I disabled the debug and launch.

Comment thread Extension/src/Debugger/configurationProvider.ts
Comment thread Extension/src/common.ts Outdated
Comment thread Extension/src/LanguageServer/configurations.ts Outdated
Copy link
Copy Markdown
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.

3 participants