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

Different behavior using legacy options #296

Open
klezm opened this issue Aug 21, 2023 · 2 comments
Open

Different behavior using legacy options #296

klezm opened this issue Aug 21, 2023 · 2 comments

Comments

@klezm
Copy link

klezm commented Aug 21, 2023

Problem

Using the deprecated properties settings and extensions will overwrite/reset all other user settings and not install any other extensions than defined in the property extensions.
Using the properties inside the customizations property will only change the defined settings and install the defined extensions additionally to the user extensions.

Deprecated properties (legacy mode):

"settings": {},
"extensions": ["ms-python.python"]

Current usage of these properties:

"customizations": {
	"vscode": {
		"settings": {},
		"extensions": ["ms-python.python"]
	}
}

The customizations property was discussed in #1.

Proposal

It should be possible to reset any user settings/extensions in customizationsvscodesettings / extensions.
Maybe add a property reset:

"customizations": {
	"vscode": {
		"reset": {
			"settings": true,
			"extensions": true,
		}
	}
}
@samruddhikhandale
Copy link
Member

Hi 👋

Thanks for opening the issue.

Using the deprecated properties settings and extensions will overwrite/reset all other user settings

@klezm When you say user-settings, are these the one which gets added by the Features?

If that's the case, then I think it seems like a change in behavior is a result of https://containers.dev/implementors/spec/#merge-logic ; where the devcontainers/cli merges the customization property from devcontainer.json and devcontainer-feature.json. The merge logic might not be added to the deprecated extensions & settings property.

If you are looking to turn off all the customizations property, you could use the experimental --skip-persisting-customizations-from-features flag for the devcontainer build command. It omits all the Feature specified customizations ie. if your devcontainer.json referred to a set of Features, then their corresponding customizations (which includes extensions) will not be applied to your dev container.

We also have a similar issue open for opting out of extensions, see devcontainers/features#386

@klezm
Copy link
Author

klezm commented Aug 22, 2023

The issue is independent from the features. My guess is that setting extensions but not customizationsvscodeextensions will leave the latter to be [] therefore omitting locally installed vscode extensions. But If you set customizationsvscodeextensions to e.g. ["ms-python.python"] the merge logic of vscode will add that extensions to the locally installed ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants