Skip to content

Make "args": "${command:pickArgs}" as default debug configuration #548

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

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

TCPsoftware
Copy link
Contributor

This PR is related to these issues:
microsoft/vscode#225834
microsoft/vscode#232560
#233
#465
#497

I searched repo:microsoft/vscode-python-debugger command:pickArgs filtered by code, and find four snippet in thee files.

request: 'launch',
program: '${file}',
console: 'integratedTerminal',
args: ['${command:pickArgs}'],
};
sendTelemetryEvent(EventName.DEBUGGER_CONFIGURATION_PROMPTS, undefined, {
configurationType: DebugConfigurationType.launchFileWithArgs,

request: 'launch',
program: '${file}',
console: 'integratedTerminal',
args: ['${command:pickArgs}'],
};
expect(state.config).to.be.deep.equal(config);

"args": {
"default": [],
"description": "Command line arguments passed to the program. For string type arguments, it will pass through the shell as is, and therefore all shell variable expansions will apply. But for the array type, the values will be shell-escaped.",
"items": {
"type": "string"
},
"anyOf": [
{
"default": "${command:pickArgs}",
"enum": [
"${command:pickArgs}"
]
},
{
"type": [
"array",
"string"
]
}
]
},

In lines 286 to 306 of package.json, it shows three usages of the args parameter. The first is that the value of the args parameter is "${command:pickArgs}", the second is to provide an array, and the third is to provide a string.

In the vscode documentation, it is also mentioned:

Note: There is a difference in how "${command:pickArgs}" and ["${command:pickArgs}"] are parsed, with specific notice to the usage of []. As an array, all arguments are passed as a single string, without brackets each argument is passed as its own string.

Therefore, I think the two files fileLaunchWithArgs.ts and fileLaunchWithArgs.unit.test.ts are the key factors affecting this problem. Then I delete the [ ] in these two code snippets.


When I wrote this PR, I checked the file modification history and found that the modification in PR #385 added [ ], but this was completely wrong (refer to the discussion of issue #497), and was not the correct way to solve issue #233 (PR #499 solved the problem), and led to a series of issues listed at the beginning.

Just consider this PR to have coincidentally performed a "revert" operation.

@TCPsoftware
Copy link
Contributor Author

@microsoft-github-policy-service agree

@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Jan 16, 2025
@vs-code-engineering vs-code-engineering bot added this to the January 2025 milestone Jan 16, 2025
@eleanorjboyd eleanorjboyd merged commit 4d27e65 into microsoft:main Feb 14, 2025
16 checks passed
eleanorjboyd added a commit to eleanorjboyd/vscode-python-debugger that referenced this pull request Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants