I just ran into a bit of a headache with the properties file not supporting the new ${workspaceFolder} variable. I was updating my older configuration files to use the new variable and ended up spending some time trying to figure out why includes simply would not resolve. Then I stumbled across this comment:
We don't support the variable ${workspaceFolder} only ${workspaceRoot}, but we should probably add that so users don't get confused.
https://github.com/Microsoft/vscode-cpptools/issues/1392#issuecomment-354736588
According to the official documentation, ${workspaceRoot} is deprecated and this is a nasty trap waiting for new users of the C++ extension.
As a side note, the fact that the properties file doesn't allow comments or trailing commas causes some friction. At this point I think all the other configuration files support it (tasks, launch, settings, etc) so it catches me off guard when I have to edit a C++ config file.
Yeah, I think https://github.com/Microsoft/vscode-cpptools/issues/1392 is tracking adding ${workspaceFolder}. I wanted to get it added for March, but looks like Bob removed it.
We're planning to migrate away from c_cpp_properties.json and move to settings.json, which allows comments (our current json parser is the strict kind).
Did I? Oops. I'll add it back.
I see why I removed it. I thought that item was tracking a different feature (a new workspace variable). I renamed the issue so that I don't get confused again.
${workspaceFolder} is now supported in our Insiders build: https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.16.0-insiders . Let us know if you find are any issues we should fix before our final release next week.
The insiders build solved this issue for me. However, I'm trying to work in a workspace with multiple folders and according to this post I should be able to specify the paths to the individual folders with something like ${workspaceFolder:FolderName}. The relevant note is:
For example, in a multi root workspace with folders Server and Client, a ${workspaceFolder:Client} refers to the path of the Client root.
This doesn't appear to work with the insiders version.
@Jvinniec Thanks for letting us know about that -- it's the 1st time I've seen that. Yeah, we should support that too. It might not get added in time for the March release (next week), but it probably will by the next one.
I moved it to a new issue...
@Jvinniec 0.17.3 added support for ${workspaceFolder:folderName}.