Open SwordTechCorp opened 8 months ago
This issue just literally saved me a huge headache, thank you so much.
I just read about pickArgs
in the documentation, and I was banging my head against a wall trying to figure out why I couldn't debug a CLI application properly (I'd do something like pass an option in my program + it's value, and the whole option+value was being interpreted as a string instead of separate arguments for the command). Removing the brackets solved it, and now it's properly parsing and debugging things like I expect.
Really think it's worth updating the documentation to make this more obvious. The mention of pickArgs
is right under a code example that shows args
values in brackets, so I had incorrectly assumed that the same syntax would be required.
For others landing here because ${command:pickArgs}
is collecting all your args into a single string (len(sys.argv) == 2
), this is the line you want:
"args": "${command:pickArgs}",
As previously stated, there are no square brackets on this line.
Type: Bug
Behaviour
Expected vs. Actual
Expected:
"args": ["${command:pickArgs}"] Actuall: "args": "${command:pickArgs}"
Steps to reproduce:
Activate Python Extension and create new
launch.json
fileClick Add Configuration, select Python Debugger -> Python File with Arguments
Without representing
args
as an array, the paths sent to the terminal will not be enclosed by quotes and launch will fail if there is a space in the path.Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` XXX ```
User Settings
``` languageServer: "Pylance" ```
Extension version: 2024.2.0 VS Code version: Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:41:44.469Z) OS version: Windows_NT x64 10.0.22621 Modes:
System Info
|Item|Value| |---|---| |CPUs|AMD Ryzen 7 4800H with Radeon Graphics (16 x 2895)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.36GB (5.79GB free)| |Process Argv|--crash-reporter-id 2167e4d6-9976-4c5a-bc63-a6fb896ad659| |Screen Reader|no| |VM|20%|
A/B Experiments
``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:30968133 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 pydisww2:30959801 d34g3935:30971562 edj9j583:30969295 a89i1917:30973842 e3gdj431:30958358 ccp1r3:30958155 dsvsc020:30973508 ```