psullivan
psullivan

Reputation: 21

vscode multiroot workspace path environment variable

I am using the multiroot workspace functionality to view source files from my c project along with several external libraries. I am using trying to use cpptools extension for intellisense and other functionality. I would like to set default include paths at the workspace level relative to the .code-workspace file. Using ${workspaceFolder} resolves to the path of the folder containing the viewed file. Is there an environment variable that will always resolve the path of the code-workspace file? Or is the a configuration variable I can set and then use ${config:variable}?

I have tried using variables scoped per workspace as described here: https://code.visualstudio.com/docs/editor/variables-reference#_variables-scoped-per-workspace-folder. But, that did not work either. I could use absolute paths and everything would work fine, but I am trying to keep things portable so other people can check out the repository and simply open the .code-workspace file and have everything set up already.

Upvotes: 1

Views: 1013

Answers (1)

psullivan
psullivan

Reputation: 21

At the time of the question the cpptools extension did not support the ${workspaceFolder:} syntax for enviroment variables. With the latest update, this is now working.

Upvotes: 1

Related Questions