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

Add suggestions for ext filter in the Settings editor search widget #148076

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

rzhao271
Copy link
Contributor

Ref #145710

This PR adds suggestions for the @ext filter in the Settings editor search widget, so now when a user types @ext:, or when they select the "Extension ID..." option from the funnel button, a list of installed extension IDs will pop up as suggestions to choose from.

@rzhao271 rzhao271 added this to the April 2022 milestone Apr 25, 2022
@rzhao271 rzhao271 self-assigned this Apr 25, 2022
@@ -269,6 +274,10 @@ export class SettingsEditor2 extends EditorPane {
if (ENABLE_LANGUAGE_FILTER && !SettingsEditor2.SUGGESTIONS.includes(`@${LANGUAGE_SETTING_TAG}`)) {
SettingsEditor2.SUGGESTIONS.push(`@${LANGUAGE_SETTING_TAG}`);
}

extensionManagementService.getInstalled(ExtensionType.System).then(extensions => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a similar hack that PreferencesSearchService uses to "unwrap" the result from the async API.

@@ -107,7 +107,7 @@ export class SettingsSearchFilterDropdownMenuActionViewItem extends DropdownMenu
localize('extSettingsSearch', "Extension ID..."),
localize('extSettingsSearchTooltip', "Add extension ID filter"),
`@${EXTENSION_SETTING_TAG}`,
false
true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change makes it so the completions list activates after the user selects the option from the funnel button.

const installedExtensionsTags = this.installedExtensionIds.map(extensionId => {
return `@${EXTENSION_SETTING_TAG}${extensionId} `;
}).sort();
return installedExtensionsTags.filter(extFilter => !query.includes(extFilter));
Copy link
Member

Choose a reason for hiding this comment

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

I wonder whether we can show the "display name" of the extension in the suggest widget as well? Maybe you can return a "detail" or "description" to show next to the ID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look into returning completion items for that case.

@rzhao271 rzhao271 merged commit c229954 into main Apr 25, 2022
@rzhao271 rzhao271 deleted the rzhao271/se-funnel-ext-suggest branch April 25, 2022 21:05
aeschli pushed a commit that referenced this pull request May 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants