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

'Edit in settings.json' does not add default for object-type setting #99854

Closed
gjsjohnmurray opened this issue Jun 11, 2020 · 2 comments · Fixed by #99912
Closed

'Edit in settings.json' does not add default for object-type setting #99854

gjsjohnmurray opened this issue Jun 11, 2020 · 2 comments · Fixed by #99912
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug config VS Code configuration, set up issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@gjsjohnmurray
Copy link
Contributor

Issue Type: Bug

My extension's settings.json contributes a configuration property that is object-type, i.e. something like this:

	"contributes": {
		"configuration": {
			"title": "FooBar Servers",
			"properties": {
				"foobar.server": {
					"type": "object",
					"description": "Connection to server",
					"scope": "resource",
					"default": {
							"host": "127.0.0.1",
							"port": 80
						}
					},
...

The UI-mode settings editor offers me an 'Edit in settings.json' option which adds an entry for foobar.server but doesn't populate the object with its default property values. In contrast, if I manually add foobar.server in JSON-mode settings editor using completion, the defaults are inserted.

VS Code version: Code - Insiders 1.47.0-insider (6efc0b6, 2020-06-11T05:46:14.594Z)
OS version: Windows_NT x64 10.0.18363

gjsjohnmurray added a commit to gjsjohnmurray/vscode that referenced this issue Jun 11, 2020
@sandy081 sandy081 self-assigned this Jun 12, 2020
@sandy081 sandy081 added config VS Code configuration, set up issues feature-request Request for new features or functionality labels Jun 12, 2020
@sandy081 sandy081 added this to the Backlog milestone Jun 12, 2020
sandy081 added a commit that referenced this issue Jun 12, 2020
fix #99854 make 'Edit in settings.json' add object-type default
@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Jun 12, 2020
@sandy081 sandy081 modified the milestones: Backlog, June 2020 Jun 12, 2020
@jrieken jrieken added the verified Verification succeeded label Jul 2, 2020
@jrieken
Copy link
Member

jrieken commented Jul 2, 2020

It does insert a default value but it also triggers suggest in an unexpected location. @sandy081 what's up with that?

Screenshot 2020-07-02 at 11 14 07

@sandy081
Copy link
Member

sandy081 commented Jul 2, 2020

Yeah not good given that there are no suggestions which is hard to know. I think better is to avoid prompting suggest for array or object types.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug config VS Code configuration, set up issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@jrieken @gjsjohnmurray @sandy081 and others