-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canonical way to resolve folder in scoped ${workspaceFolder:<folder>}
variables
#198195
Comments
I have unfortunately no clue what this ask is about, maybe some of the assignees can chime in. |
From the docs you linked, it says "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." My reading of the following two documentation links does not contradict that; the first link is the canonical source.
Sure, a cross-link would make sense. PRs welcome for that 🙂
Sounds like this issue is mainly about having an API to resolve variables for extensions. I think that's @alexr00's domain. Though people have already written npm packages to do this, such as https://www.npmjs.com/package/@c4312/vscode-variables |
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
I was surprised to find that VSCode provides no canonical way to resolve workspace folder when substituting
${workspaceFolder:<folder>}
variables. This leaves how to resolve the scoped${workspaceFolder}
variable up to extension authors, clearly leading to inconsistent behavior (microsoft/vscode-python#22452). In that case the confusion was around named folders in multi-root workspaces.It doesn't help that the official documentation remains ambiguous as to how scoped
${workspaceFolder}
variables should be resolved. For instance, here, the documentation says nothing about thename
attribute in workspace folders. Here, the documentation states that thename
attribute in workspace folders is for display purpose in the Explorer. However, here, the documentation implies that the canonical way to resolve variables is as it happens in Task configurations.Then, if a workspace folder is named, this task will fail:
"echo ${workspaceFolder:<workspace-folder-path-basename>}"
While this one will work:
"echo ${workspaceFolder:<workspace-folder-name>}"
Seeing that the behavior in VSCode is far from obvious, it may be worth to:
resolveFolder()
function in theWorkspaceFolder
class?${workspaceFolder}
variables are resolved with either their explicitly set name or with their path basename.name
attribute in workspace folder is not used only for display in Explorer but also to resolve scoped${workspaceFolder}
variables./cc @karrtikr, who fixed microsoft/vscode-python#22452.
The text was updated successfully, but these errors were encountered: