Unfortunately, there is no way to do what you want. Arguments can only be passed as an array, but not as a string with spaces. The argument with spaces is wrapped in quotation marks and passed as one whole argument.
Quote from the documentation:
args - arguments passed to the program to debug. This attribute is of
type array and expects individual arguments as array elements.
Answer from one of the developers on github:
The rule to translate a command line to the "args" is simple: every command line argument separated by whitespace needs to become a separate item of the "args" attribute.
Examples:
Command:
tar -cvf test-14-09-12.tar /home/test/
Args:
"args": ["-cvf", "test-14-09-12.tar", "/home/test/"]
Command:
tar -c --file new.tar --include='*foo*' old.tgz
Args:
"args": ["-c", "--file", "new.tar", "--include='*foo*'", "old.tgz"]
Update:
I found solution, using snippets.
You can add snippet to global snippets or project snippets, as described here:
"args_transform": {
"scope": "jsonc",
"prefix": "args_transform",
"body": "${1/((\"(.*?)\")|('(.*?)')|([^ ]+))( )?/\"$3$6$5\"${7:+, }/g}"
}
Write args_transform where you need to write args in launch.json (or any other json with comments file), press tab, insert your args and then press tab again
But it, probably, not works correctly with some kind of arguments, please write errors in comments if snippet fix needed