microsoft / microsoft/vscode-remote-release
Support ALL doc'd variables.
@chrmarti is already working on this.
Since Apr 6, 2020.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
In general with VS Code, it's a pain that variable support is so patchy.
My expectation is that any string value in any VS Code .json file should respect any variable substitution doc'd in https://code.visualstudio.com/docs/editor/variables-reference - but actually, it's a matter for the developers of any feature whether or not they choose to implement variable expansion and, if so, how much of it.
That much is clearly an issue with VS Code, not Remote. And clearly, there's context of which I know not.
Given that Code is patchy in this regard, could Remote offer fuller support?
The behaviour I'd expect as a new user would be for variable expansion to be done on any string values but not keys. Any leaf node that's a string.
I believe from the issues that this would make sense to a lot of people.
Examples:
remoteUserdoes not expand${env:USERNAME}. (workaround:"runArgs": ["--user", "${env:USERNAME}"])initializeCommandexpands env but not config, so I can't use this:"initializeCommand": ["bash", "-c", ".devcontainer/initializeCommand.sh ${env:STACKNAME} ${config:docker.host}"](logs show it's trying to run.devcontainer/initializeCommand.sh fsackur ${config:docker.host}). Therefore I have to hard-code a docker host or set it in whatever launches VS Code.
Breaking cases:
if you intend to send a literal string with a colon, like '${env:STACKNAME}' or '${config:docker.host}'. I'm not aware of a reason to do that, but it does currently work without escaping.
To mitigate that, I suggest an extension setting key "greedyVariableInterpolation" that defaults to True to cater for new users.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.