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

editor.quickSuggestions doesn't render in the Settings editor #148163

Closed
rzhao271 opened this issue Apr 26, 2022 · 4 comments · Fixed by #148773
Closed

editor.quickSuggestions doesn't render in the Settings editor #148163

rzhao271 opened this issue Apr 26, 2022 · 4 comments · Fixed by #148773
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders settings-editor VS Code settings editor issues verified Verification succeeded
Milestone

Comments

@rzhao271
Copy link
Contributor

rzhao271 commented Apr 26, 2022

Currently, the editor.quickSuggestions setting doesn't render in the Settings editor, because the Settings editor cannot handle settings with anyOf types.
The current accepted values are of the form

anyOf: [{
	type: 'boolean',
}, {
	type: 'object',
	properties: {
		strings: {
			anyOf: types,
			default: defaults.strings,
			description: nls.localize('quickSuggestions.strings', "Enable quick suggestions inside strings.")
		},
		comments: {
			anyOf: types,
			default: defaults.comments,
			description: nls.localize('quickSuggestions.comments', "Enable quick suggestions inside comments.")
		},
		other: {
			anyOf: types,
			default: defaults.other,
			description: nls.localize('quickSuggestions.other', "Enable quick suggestions outside of strings and comments.")
		},
	}
}],

Questions:

  1. What is the difference between true and "on" or false and "off" for each field?
  2. Is editor.quickSuggestions: true just a shorthand for setting each field to true?

If we can change the setting configuration so that it is just an object with fields "strings", "comments", and "other", and the value for each field is an enum of options ["inline", "on", "off"], then the setting can render in the Settings editor UI. Along with changing the type over, we'll have to migrate the setting value for users still using the old setting value. I believe Emmet has example code for this process for the setting emmet.extensionsPath.

@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug settings-editor VS Code settings editor issues labels Apr 26, 2022
@rzhao271 rzhao271 added this to the May 2022 milestone Apr 26, 2022
@jrieken
Copy link
Member

jrieken commented Apr 26, 2022

Yeah, there is a lot of history: it started with a simple boolean, become an object with booleans, and it now an object with enum values. When working on #126375 I tried to simplify the setting but without success, I couldn't get the editor to render this...

I'll try to simplify the setting to be a simple object with just (string) enum values

@jrieken
Copy link
Member

jrieken commented May 4, 2022

@rzhao271 I have started on this, the setting is now just an object but the settings editor still doesn't show it. What is missing?

@rzhao271
Copy link
Contributor Author

rzhao271 commented May 4, 2022

I don't believe we currently support anyOf bool string, still. Are you expecting it to render as an enum like true, false, "on", "inline", "off"?
Also, additionalProperties needs to be set to false.

@jrieken
Copy link
Member

jrieken commented May 5, 2022

Also, additionalProperties needs to be set to false.

Cool. Thanks! That did make the difference here

Screenshot 2022-05-05 at 09 22 08

@meganrogge meganrogge added the verified Verification succeeded label Jun 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2022
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 insiders-released Patch has been released in VS Code Insiders settings-editor VS Code settings editor issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@jrieken @rzhao271 @meganrogge and others