raspberrypi / pico-project-generator

Tool to automatically generate a Pico C SDK Project
BSD 3-Clause "New" or "Revised" License
297 stars 75 forks source link

Backslashes in compilerPath aren't escaped in VSCode JSON (Windows) #67

Open jpbloom opened 1 year ago

jpbloom commented 1 year ago

The compilerPath populated in c_cpp_properties.json can cause a parsing error to be thrown in VSCode due to unescaped backslashes.

eg.,

"compilerPath": "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\12.2 rel1\bin\arm-none-eabi-gcc.EXE",

will fail, but

"compilerPath": "C:\\Program Files (x86)\\Arm GNU Toolchain arm-none-eabi\\12.2 rel1\\bin\\arm-none-eabi-gcc.EXE",

Is fine. Also, converting to forward slashes in the path works.

Might be particular to how certain system configs get the toolchain added to the system environment variables / PATH? Not sure, I'm a bit new to this toolchain.

Current workaround is to manually edit the JSON and then use CMake: Delete Cache and Reconfigure.

JamesH65 commented 1 year ago

I believe this is fixed on the update_vscode_json_to_sdk1_5 branch, and I would welcome any testing.

ndabas commented 1 year ago

That branch looks fine to me, but: