Skip to content

Add multi-root workspaceFolder support to path variable expansion #7137

@Seairth

Description

@Seairth

Currently, pyright does not support path variable expansion for tokens in the form of ${workspaceFolder:name}, which is documented by VSCode for multi-root workspaces. Following from the invitation at microsoft/pylance-release#4405 (comment), I added the feature. The current commit can be found at Seairth@37fff57.

Overall changes:

  • Re-ordered the expandPathVariables arguments and added an additional argument for the list of workspaces
  • Enhanced expandPathVariables to iterate over the workspaces and perform variable expansion for tokens in the form of ${workspaceFolder:name}
  • Updated existing tests that used expandPathVariables
  • Added new tests for expandPathVariables (including tests for existing functionality)

All tests pass. I have also built the VSCode extension and verified the new functionality.

Before I submit a PR, I want to make sure the commit meets "Contributing" requirements.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions