Skip to content

docs(reference): clarify platform and workspace behavior for variables#9191

Merged
ntrogh merged 2 commits intomicrosoft:mainfrom
DakotaB75:patch-1
Dec 22, 2025
Merged

docs(reference): clarify platform and workspace behavior for variables#9191
ntrogh merged 2 commits intomicrosoft:mainfrom
DakotaB75:patch-1

Conversation

@DakotaB75
Copy link
Copy Markdown
Contributor

This pull request adds clarification about platform-specific path behavior and workspace context for predefined variables used in VS Code configurations.

The added notes aim to help users better understand how variables resolve across different operating systems and workspace setups, improving portability and reducing configuration issues.

@DakotaB75
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Collaborator

@ntrogh ntrogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DakotaB75 Thanks for contributing. Left some comments to apply to the PR.

Comment thread docs/reference/variables-reference.md Outdated
> [!TIP]
> Use IntelliSense inside string values for `tasks.json` and `launch.json` to get a full list of predefined variables.

## Platform and Workspace Considerations
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Platform and Workspace Considerations
## Platform and workspace considerations

Comment thread docs/reference/variables-reference.md Outdated
- 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"`).
- On **macOS** and **Linux**, file paths use forward slashes (`/`).

Using `${pathSeparator}` or `${/}` can help make configurations portable across platforms.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Using `${pathSeparator}` or `${/}` can help make configurations portable across platforms.
It's recommended to use `${pathSeparator}` or `${/}` to make configurations portable across platforms.

Comment thread docs/reference/variables-reference.md Outdated

### Workspace context

- Variables such as `${workspaceFolder}` and `${workspaceFolderBasename}` resolve to the first root folder of the workspace.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use a separate section but include this information in the table of predefined variables above.

Updated section titles and improved clarity of platform-specific behavior and workspace context.
@DakotaB75
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've applied the requested changes and updated the content accordingly.

@ntrogh ntrogh merged commit 5f24242 into microsoft:main Dec 22, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants