Skip to content

Commit 5f24242

Browse files
authored
docs(reference): clarify platform and workspace behavior for variables (#9191)
* docs(reference): add platform and workspace considerations for variables * Revise variables reference for clarity and consistency Updated section titles and improved clarity of platform-specific behavior and workspace context.
1 parent bf3432a commit 5f24242

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/reference/variables-reference.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ This leads to the following values for each of the variables:
6464
> [!TIP]
6565
> Use IntelliSense inside string values for `tasks.json` and `launch.json` to get a full list of predefined variables.
6666
67+
## Platform and workspace considerations
68+
69+
### Platform-specific behavior
70+
71+
Some predefined variables may resolve differently depending on the operating system:
72+
73+
- On **Windows**, file paths use backslashes (`\`). When composing paths in JSON files such as `tasks.json` or `launch.json`, ensure backslashes are properly escaped (for example: `"${workspaceFolder}\\subdir"`).
74+
- On **macOS** and **Linux**, file paths use forward slashes (`/`).
75+
76+
It's recommended to use `${pathSeparator}` or `${/}` to make configurations portable across platforms.
77+
78+
6779
### Variables scoped per workspace folder
6880

6981
By appending the root folder's name to a variable (separated by a colon), it is possible to reach into sibling root folders of a workspace. Without the root folder name, the variable is scoped to the same folder where it is used.

0 commit comments

Comments
 (0)