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

A VS Code extension configurationDefault does not work #12713 #12758

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

jfaltermeier
Copy link
Contributor

@jfaltermeier jfaltermeier commented Jul 26, 2023

What it does

Fixes: #12713

  • plugin contribution handler will now also register configurationDefault for non language related configuration changes
  • extend preference-contribution#doSetSchema to allow modifying default values for existing schemas when contributed via a special schema id
  • also update select options in preference-select-input, since the default value may change now, which requires the SelectOptions to recreate

The solution is based on the existing implementation for providing language specific editor settings:
#3540
#4296
In the existing solution we are using a special defaultOverrides PreferenceSchema that gets registered. I've adapted the registration code to also work for existing preference keys when provided via this special schema.

I am open for suggestions to implement this in a different way, however we should probably refactor the language specific editor overrides then as well.

How to test

See the bug report for a reproducer: #12713
Check the preference's (default) value when installing/uninstalling the extension.
Check the preference UI (default highlight in drop down) and test resetting to the default value

Please be aware of this bug during testing with the vsix from the reproducer: #10812

Review checklist

Reminder for reviewers

* plugin contribution handler will now also register
configurationDefault for non language related configuration changes
* extend preference-contribution#doSetSchema to allow modifying default
values for existing schemas when contributed via a special schema id
* also update select options in preference-select-input, since the
default value may change now, which requires the SelectOptions to
recreate
@jfaltermeier jfaltermeier marked this pull request as ready for review July 26, 2023 13:23
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me. I've used this extension for testing, which changes the editor.fontSize configuration for all editors to 20 and for markdown editors to 30. 👍

  • The defaults are correctly applied in the preferences.
  • Changing to the original default value highlights the preference as changed and resetting it changes it back to the config default override.
  • Deinstalling the plugin and reloading the app correctly resets the preference defaults.
  • Changing the preferences without installing a plugin that changes the defaults still works as expected.

I have a minor suggestion, see below.

@vince-fugnitto vince-fugnitto added preferences issues related to preferences vscode issues related to VSCode compatibility labels Aug 3, 2023
@jfaltermeier jfaltermeier requested a review from msujew August 7, 2023 14:31
@msujew msujew merged commit 1e16b08 into master Aug 8, 2023
@msujew msujew deleted the jf/configurationDefaults branch August 8, 2023 09:02
@github-actions github-actions bot added this to the 1.41.0 milestone Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences issues related to preferences vscode issues related to VSCode compatibility
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

A VS Code extension contributing a configurationDefault doesn't seem to work
3 participants