Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
jpbloom opened this issue Feb 12, 2023 · 2 comments
Open

Comments

@jpbloom
Copy link

jpbloom commented Feb 12, 2023

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
Copy link
Contributor

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

@ndabas
Copy link

ndabas commented Sep 1, 2023

That branch looks fine to me, but:

  • I would use the PICO_INSTALL_PATH environment variable instead of hard-coding the path to the C/C++ compiler, so that any future updates to the installed SDK are automatically picked up and do not require a manual fix-up.
  • I would also welcome discussion about keeping the VS Code config in a central location, mentioned previously here: Multi-line f-string for vs code configuration file contents #87 (comment)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants