Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add script mode and ability to connect to externally launched CMake process. #3277
Add script mode and ability to connect to externally launched CMake process. #3277
Changes from 24 commits
c706bc7
a61c8bc
b517b8a
bded134
2c7b854
e3d3703
5c1d651
ee83c45
ea036b9
a8a3721
663fa08
264a800
0484233
fedd875
08511df
921de87
b63c7d3
496e4e0
c0e5b9e
9f1b1b5
bd2846b
bb7a69f
7185e97
4dd775f
1987139
25dccb3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
can this get an optional
"command" : []
field/array? So that VS code executes the command I would normally use to start the cmake pipe externally?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.
To help me think through the possible design implications, could you go into more detail regarding your use case for the
external
mode?What kind of external processes are you expecting? It is a CMake invocation? Or is it invoking something else that internally invokes CMake?
What are you expecting or hoping to use in the
"command"
field?Thanks!
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.
Could be both of those.
For example I could write a (CMake) script (not the debug target) which does the following:
cmake -P
which could be debuggedcmake
in configure mode which could be debuggedThe intention of having a
command
field is to automate the process. E.g."command" : ["cmake", "-P", "my-internal-cmake-caller-script.cmake", "-DDEBUGGER_PIPE_NAME=<name_of_debugger_pipe>"]
DEBUGGER_PIPE_NAME
is internally passed on to some process calling cmake. (doesn't really matter what it is)But if "command" is added "workingDir" probably also makes sense to define where the command is executed.
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.
That being said I am also happy with the current approach. It is just that it takes more manual labor for startup.
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.
Understood. I wonder if using a
preLaunchTask
is what you want. This way the pre launch task can be fully arbitrary. Do you think using that would suit your needs?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.
Don't know about that. If there is a possibility to detach then probably yes if it needs to return than probably no. Need to read up on that first.
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 just tested and found that if you set up a tasks.json task with the following settings as part of that task:
then you can successfully have a preLaunch task.
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.
Hmm I need some delay or some retry count to connect the debugger to the pipe since the debugger wants to start before the prelaunch task reached the point where the pipe is opened. (That being said: Hitting the run button simply twice works as expected; somehow vs code sees that the task is still running and does not rerun it.)
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.
OK I think there is nothing to do here. I can just define a task and let it run via VS Code directly instead of manually typing it. Never used task since I mainly use CMake presets. Would be nice if there is a way to somehow get the pipename from a task.json via some variable.