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

ability to manipulate configuration variables #92218

Closed
amir-arad opened this issue Mar 7, 2020 · 8 comments
Closed

ability to manipulate configuration variables #92218

amir-arad opened this issue Mar 7, 2020 · 8 comments
Assignees
Labels
config VS Code configuration, set up issues *duplicate Issue identified as a duplicate of another issue(s)

Comments

@amir-arad
Copy link

I've encountered a similar need to #73888 . I pass ${workspaceFolder} as a parameter to some (ms-vscode.cmake-tools plugin) and it parses the string, producing the following error:

[cmake]   Syntax error in cmake code when parsing string
[cmake] 
[cmake]     c:\workspace\EmptyEpsilon/../SeriousProton/src/soundManager.cpp

So for my specific case I need a version of workspaceFolder with either backward slashes, or double forward slashes. But in general I think a way to manipulate the value (replace?) can come in handy.

@weinand
Copy link
Contributor

weinand commented Mar 8, 2020

Where are you passing ${workspaceFolder} as a parameter?
Please be aware that in general variables like ${workspaceFolder} can only be used in launch.json and tasks.json, but non in settings.json.

@weinand weinand added the info-needed Issue requires more information from poster label Mar 8, 2020
@amir-arad
Copy link
Author

amir-arad commented Mar 9, 2020

Where are you passing ${workspaceFolder} as a parameter?

as part of a parameter in settings.json. This is a workspace configuration I wrote, which several people use, and for some reason no longer works.

Please be aware that in general variables like ${workspaceFolder} can only be used in launch.json and tasks.json.

could you please show me a reference to what configuration should go where?so that I can re-write my configuration, or at least offer a heads up to the vscode-cmake-tools people

@weinand
Copy link
Contributor

weinand commented Mar 9, 2020

The variables available in launch.json and tasks.json are specified here: https://code.visualstudio.com/docs/editor/variables-reference

In that document is an FAQ entry for settings.json:
https://code.visualstudio.com/docs/editor/variables-reference#_is-variable-substitution-supported-in-user-and-workspace-settings

@bpasero do we have a complete list of variables that can be used in settings.json?

@weinand weinand removed the info-needed Issue requires more information from poster label Mar 9, 2020
@bpasero
Copy link
Member

bpasero commented Mar 10, 2020

Forwarding to @roblourens @sandy081 do we have a complete list of variables that can be used in settings.json?

Maybe they should be showing up in IntelliSense?

@bpasero bpasero assigned sandy081 and unassigned bpasero Mar 10, 2020
@bpasero bpasero added the config VS Code configuration, set up issues label Mar 10, 2020
@roblourens
Copy link
Member

roblourens commented Mar 11, 2020

They do show up in intellisense, but they are only supported as special cases for specific settings like window.title.

@sandy081
Copy link
Member

We do not support any variables in settings. Its up to each setting to define their own variable and resolve them.

See - #2809

@sandy081
Copy link
Member

/duplicate

@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
config VS Code configuration, set up issues *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

6 participants
@roblourens @bpasero @weinand @amir-arad @sandy081 and others