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

Announce results of extension search #59128

Merged
merged 2 commits into from
Sep 21, 2018
Merged

Conversation

ramya-rao-a
Copy link
Contributor

This PR fixes #52611 by announcing the number of search results when an extension search is made.

@ramya-rao-a ramya-rao-a self-assigned this Sep 21, 2018
@@ -69,6 +70,18 @@ const SearchBuiltInExtensionsContext = new RawContextKey<boolean>('searchBuiltIn
const RecommendedExtensionsContext = new RawContextKey<boolean>('recommendedExtensions', false);
const DefaultRecommendedExtensionsContext = new RawContextKey<boolean>('defaultRecommendedExtensions', false);
const GroupByServersContext = new RawContextKey<boolean>('groupByServersContext', false);
const viewIdNameMappings: { [id: string]: string } = {
'extensions.listView': localize('marketPlace', "Marketplace"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Use consistent quoting style. For example always prefer single quotes over double quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is true, but not when we localize strings. If we use single quotes on the string that is to be localized, then the localization doesnt work.

We have an exception on our pre check in hook for this. If double quotes were used elsewhere, then I wouldnt have been able to commit in the first place

Copy link
Contributor

Choose a reason for hiding this comment

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

You can still prefer single quotes first and fallback to backtick if string includes single quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rest of the file is using double quotes, so I'll keep so for consistency's sake

return;
}
if (viewIdNameMappings[viewId]) {
alert(localize('extensionsFoundInSection', "{0} extensions found in the {1} section.", count, viewIdNameMappings[viewId]));
Copy link
Contributor

Choose a reason for hiding this comment

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

When count is 1, extensions is wrong.

if (viewIdNameMappings[viewId]) {
alert(localize('extensionsFoundInSection', "{0} extensions found in the {1} section.", count, viewIdNameMappings[viewId]));
} else {
alert(localize('extensionsFound', "{0} extensions found.", count));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

@ramya-rao-a ramya-rao-a merged commit 529f705 into master Sep 21, 2018
@ramya-rao-a ramya-rao-a deleted the ramyar/announce-results branch September 25, 2018 21:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
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.

Extensions view: extensions list state not being read out
2 participants