Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Adds ${pathListSeparator} (alias ${:}) predefined variable that resolves to the OS-specific path list separator: ; on Windows, : on POSIX. Enables cross-platform configuration of environment variables like PATH, PYTHONPATH, and CLASSPATH.

Changes

  • Variable definition: Added PathListSeparator and PathListSeparatorAlias to VariableKind enum
  • Resolution logic: Returns paths.delimiter for both ${pathListSeparator} and ${:}
  • Autocomplete: Added to configuration-editing extension for launch.json, tasks.json, and .code-workspace files
  • Tests: Added platform-specific tests verifying correct separator resolution

Usage

// tasks.json
{
  "env": {
    "PATH": "${workspaceFolder}/bin${pathListSeparator}${env:PATH}",
    "PYTHONPATH": "${workspaceFolder}/src${:}${workspaceFolder}/lib"
  }
}

Follows the same pattern as existing ${pathSeparator} (alias ${/}) for file path separators.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature Request] Add predefined variable with separator for environment variable PATH (also PYTHONPATH, CLASSPATH etc.)</issue_title>
<issue_description>

I would like to request a new predefined variable, e.g. ${pathListSeparator}, that would be substituted with the separator used in the operating system's PATH environment variable, e.g. : for POSIX or ; for Windows.

Similarly to this feature request regarding ${pathSeparator}, I would also like it to have a shorter alias for improved readability, e.g. ${:}.

The variable could be used for modifications of not only the OS's PATH but also other environment variables that follow the same convention, e.g. Python's PYTHONPATH, Java's CLASSPATH, etc.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add predefined variable for PATH separator Add pathListSeparator predefined variable with : alias Dec 8, 2025
Copilot AI requested a review from alexr00 December 8, 2025 11:17
Copilot finished work on behalf of alexr00 December 8, 2025 11:17
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.

[Feature Request] Add predefined variable with separator for environment variable PATH (also PYTHONPATH, CLASSPATH etc.)

2 participants