Add several basic predefined variables for use in launch.json - e.g. ${uid}, ${gid}, ${user}, ${home}
See original GitHub issuePlease expose several basic predefined variables for use in launch.json
like ${uid}
, ${gid}
, ${user}
, ${home}
(and potentially in settings.json
too, as per https://github.com/microsoft/vscode/issues/2809).
Example use cases:
- Extremely useful for multi-user environments to avoid port or path conflicts. (See YAML below)
- Generally similar use cases to https://github.com/microsoft/vscode/issues/2809 where one needs to specify paths to SDKs, GOPATHs and alike.
{
"version": "0.2.0",
"configurations": [
{
"type": "perl",
"request": "launch",
"name": "Perl-Debug",
"console": "remote",
"port": "${uid}", // <---- HERE!
"root": "${workspaceFolder}/.vscode/root",
"program": "${workspaceFolder}/${relativeFile}",
"stopOnEntry": false,
"reloadModules": false,
"sessions": "watch",
}
]
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Variables reference - Visual Studio Code
json files using ${variableName} syntax. Predefined variables. The following predefined variables are supported: ${userHome} - the path of the user's home ...
Read more >Provide a homeDir system variable for use in launch.json
Set paths that start at the Home Directory (eg: %USERPROFILE% on Windows, $HOME / ~ on Linux). It would be nice to have...
Read more >Dev Container metadata reference
Environment and pre-defined variables may be referenced in the values. ... to use a different user than the one for the container, see...
Read more >Dockerize your projects in Visual Studio Code
The application in this example uses three different services. Important are the environment variables which need to be configured here for ...
Read more >podman-build
Add an image label (e.g. label=value) to the image metadata. Can be used multiple times. Users can set a special LABEL io.containers.capabilities=CAP1,CAP2,CAP3 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ssbarnea did you try to use an environment variable that is defined outside of VS Code? You can easily access that as `${env:variable}´.
@ssbarnea I was actually suggesting to introduce a new env variable and assign it to different values on the different platforms.