Skip to content

Commit

Permalink
Backport PR #13761: Fix handling of settingEditorType (#13773)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
  • Loading branch information
meeseeksmachine and jtpio committed Jan 15, 2023
1 parent 3da21f3 commit bc1477c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/settingeditor-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,18 @@ function activate(
query?: string;
settingEditorType?: SettingEditorType;
}) => {
void registry.load(plugin.id).then(settings => {
args.settingEditorType ??
(settings.get('settingEditorType').composite as SettingEditorType) ===
if (args.settingEditorType === 'ui') {
void commands.execute(CommandIDs.open, { query: args.query ?? '' });
} else if (args.settingEditorType === 'json') {
void commands.execute(CommandIDs.openJSON);
} else {
void registry.load(plugin.id).then(settings => {
(settings.get('settingEditorType').composite as SettingEditorType) ===
'json'
? void commands.execute(CommandIDs.openJSON)
: void openUi({ query: args.query ?? '' });
});
? void commands.execute(CommandIDs.openJSON)
: void openUi({ query: args.query ?? '' });
});
}
},
label: args => {
if (args.label) {
Expand Down

0 comments on commit bc1477c

Please sign in to comment.