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

user defined variables for all .json configuration files #137660

Closed
wants to merge 3 commits into from
Closed

user defined variables for all .json configuration files #137660

wants to merge 3 commits into from

Conversation

Lakshmikanth2001
Copy link

This PR fixes #2809

	const configuration = {
		'params': {
			'git_version': '2.30.0',
			'node_version': '14.16.1',
			'python_version': '3.8',
			'port': '5858',
		},
		'node_version': '${params:node_version}',
		'port': '${params:port}',
		'virtual_env': 'virtualenv .venv --python=python${params:python_version}'
	};
		assert.deepStrictEqual({ ...result }, {
			'params': {
				'git_version': '2.30.0',
				'node_version': '14.16.1',
				'python_version': '3.8',
				'port': '5858',
			},
			'node_version': '14.16.1',
			'port': '5858',
			'virtual_env': 'virtualenv .venv --python=python3.8'
		});

This is the expected behaviour

@ghost
Copy link

ghost commented Nov 22, 2021

CLA assistant check
All CLA requirements met.

@alexr00 alexr00 assigned sandy081 and unassigned alexr00 Nov 23, 2021
@sandy081 sandy081 removed their assignment Nov 29, 2021
@sandy081
Copy link
Member

I am not the owner of Configuration Resolver. Probably @weinand / @isidorn (before) ?

@alexr00 alexr00 assigned alexr00 and unassigned weinand Nov 29, 2021
@alexr00
Copy link
Member

alexr00 commented Nov 29, 2021

This actually is for me. I mistakenly read it as configuration, not configuration resolver.

@alexr00
Copy link
Member

alexr00 commented Nov 29, 2021

@Lakshmikanth2001 thank you for the pull request. Since ${} style variables are only set by VS Code and are uniform (i.e., the variables evaluate to the same thing no matter where they are used), it is confusing to have user-defined variables that can change per file. Additionally, it wouldn't work with the json schema for each file.

Instead, if you want the have some kind of variable expansion, you can set environment variables.

@alexr00 alexr00 closed this Nov 29, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support variables when resolving values in settings
4 participants