Skip to content
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

Allow to target a setting in a workspace file to one of the roots #182191

Open
gjsjohnmurray opened this issue May 11, 2023 · 3 comments
Open

Allow to target a setting in a workspace file to one of the roots #182191

gjsjohnmurray opened this issue May 11, 2023 · 3 comments
Labels
config VS Code configuration, set up issues feature-request Request for new features or functionality keep Issues we should not close as out of scope workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@gjsjohnmurray
Copy link
Contributor

I had discussions about this with others from the team in the past, even in the context of #45177 and I think what is missing is some variable you can use as part of the glob pattern to point to one of the entries in the workspace file. If someone has good ideas how to do that, we can have a discussion in a separate issue.

Originally posted by @bpasero in #4873 (comment)

A previous suggestion from @roblourens is at #70438 (comment)

This aligns with the existing feature for scoping variables per workspace folder:

https://code.visualstudio.com/docs/editor/variables-reference#_variables-scoped-per-workspace-folder

@ulugbekna ulugbekna assigned bpasero and unassigned ulugbekna May 11, 2023
@bpasero bpasero added the workbench-multiroot Multi-root (multiple folders) issues label May 11, 2023
@bpasero bpasero changed the title Discuss folder-relative referencing in glob patterns Allow to target a setting in a workspace file to one of the roots May 11, 2023
@bpasero bpasero added feature-request Request for new features or functionality keep Issues we should not close as out of scope labels May 11, 2023
@bpasero bpasero added this to the Backlog milestone May 11, 2023
@bpasero bpasero removed their assignment May 11, 2023
@bpasero bpasero added the config VS Code configuration, set up issues label May 11, 2023
@bpasero
Copy link
Member

bpasero commented May 11, 2023

In my own words and from my ideas in #45177 (comment): Today you cannot easily reference one of the roots of a .code-workspace file from within that file. The use case is that you might want to craft a glob pattern in a setting such as files.readonlyInclude to target a specific root of the workspace without having to use an absolute path.

//cc @sandy081

@bpasero
Copy link
Member

bpasero commented Aug 21, 2023

It seems like the C++ extension supports the following syntax from a .code-workspace file:

"C_Cpp.default.includePath": [
  "${workspaceFolder:cna-mme_s1}/**",
  "${workspaceFolder:cna-mme_s1}/working/s1/config/",
]

I think we can think about expanding this syntax to more settings that are about paths.

@sandy081 do you know if this is something we support built-in to core or is this something the C++ extension implemented only for their use case?

@sandy081
Copy link
Member

We do not support variables in settings. At present the owner of the setting should resolve itself - #2809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config VS Code configuration, set up issues feature-request Request for new features or functionality keep Issues we should not close as out of scope workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

5 participants