Skip to content
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

How to setup launch.json? #26

Closed
JanKok opened this issue Feb 23, 2016 · 2 comments
Closed

How to setup launch.json? #26

JanKok opened this issue Feb 23, 2016 · 2 comments
Labels

Comments

@JanKok
Copy link

JanKok commented Feb 23, 2016

Please provide clear basic documentation about how to set up launch.json. A link to documentation in the Microsoft/vscode project would be fine, if there is such documentation.

Note that I don't know Node.js and would rather not spend a day learning it, just to be able to use Code for developing my C code app. The Code getting started guide suggests developing a Node.js app in order to get familiar with how Code works. Unfortunately, it's not clear which version of Node.js should be installed, how to install it (I get various errors), how to install the example files, etc. The learning curve is way too steep. A quick reference guide for setting up launch.json tailored to C/C++ code development would be great.

Some questions:

Regarding "cwd": "${workspaceRoot}", if I have my source and object files all in one directory and I start Code in that directory, can I leave that line as is? When might I want to change cwd to some different value?

Is ${workspaceRoot} a Node.js variable? How can I view its value?

Is "target": "./myapp" or "target": "myapp" OK if the myapp executable is in the cwd directory? I'm guessing the file path (for example ".") is relative to cwd, is that right?

How does Code know where to find the source files?

How can I set the default command line args for my application?

I'm having a hard time getting Code to stop at breakpoints. Can I start my app and have Code/gdb break immediately so I can set breakpoints and have gdb break when a breakpoint is reached? This is for local debugging.

Can I have my app's stdin, stdout and stderr go to a separate window from the gdb dialog?

How can I run a make from within Code, i.e. how can I set up the launch.json or similar file to enable this?

@WebFreak001
Copy link
Owner

Right, I didn't include command line args yet. You can view all the descriptions of the json value in vscode if you just hit ctrl-space, like in every other editor. ${workspaceRoot} is a vscode value, just leave it as it is. Both targets are fine, cwd and target work just like in gdb. So in cwd there are the source files (the folder where you compile your code in) and target can also target subfolders so you can use it. stdin is not available because the input is for debugger commands, I might add launching it in a separate terminal in the future.

Tasks before debugging are done with the visual studio default "preLaunchTasks" value. You can see everything you could write in ctrl-space, its really helpful. However vscode debuggers in general do not cover that, because its provider by vscode. Please read up on tasks on the vscode documentation.

I'm going to create 2 separate issues for command line arguments & launching in a terminal window.

Most of the questions are already below the images in the README. I can't make it more easy to learn than putting it into the README and into the ctrl-space completions

@JanKok
Copy link
Author

JanKok commented Feb 24, 2016

Thanks @WebFreak001 for addressing the documentation and feature requests. I'm in the process of reinstalling Code and code-debug to see if the new-user experience has improved, and I'll file more issues if I run into more problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants