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

adding suggestion to search for extension for files are of unknown mime type #40269

Merged
merged 4 commits into from
Jan 18, 2018

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Dec 15, 2017

When user loads a file of unknown mime type in the editor, suggest searching for an extension in the marketplace supporting that file extension.

@sbatten
Copy link
Member Author

sbatten commented Dec 15, 2017

guessMimeType sometimes returns MIME_UNKNOWN for known extensions. There appears to be a race between this logic and the registration of known mime types.

Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

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

Nice work, left a few tiny comments. Take a look.

JSON.stringify(fileExtensionSuggestionIgnoreList),
StorageScope.GLOBAL
);
return this.ignoreExtensionRecommendations();
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is a remnant of a copy paste :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the new ignore list to the store because I can imagine if a user has a specific file type that never will definitely not have an extension, they would be pretty annoyed by the new message if it repeated. As for the this.ignoreExtensionRecommendations(), I left this as well since this triggers the prompt for ignoring all recommendation notifications and will also work to disable this new message. Let me know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

I got the part about the new ignore list earlier. That's good.
Am not sure about re-purposing this.ignoreExtensionRecommendations() for the file extension search.

Some users may not want any recommendations, but may be ok with the file search or vice versa

);
return this.ignoreExtensionRecommendations();
case 2:
return TPromise.as(null);
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 skip the 3 Promise.as(null) here. They won't end up serving any purpose

this.choiceService.choose(Severity.Info, message, options, 3).done(choice => {
switch (choice) {
case 0:
return searchMarketplaceAction.run();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the telemetry events to track what the user does here just like in the other choiceService?

Copy link
Member Author

@sbatten sbatten left a comment

Choose a reason for hiding this comment

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

this change makes sense and worked for me as expected after adding more important tips

@ramya-rao-a
Copy link
Contributor

@sbatten There are few more things we need to hash out before merging this to master.
The main thing being if we want to prompt for every unknown file or we want to have a whitelist for that as well.
I am out on vacation for the rest of the year, we'll revisit this in Jan.

Thanks for all the work though, this is nice feature to have

@sbatten
Copy link
Member Author

sbatten commented Dec 19, 2017 via email

@ramya-rao-a ramya-rao-a force-pushed the users/stbatt/fbextrec branch from 8fc3a29 to 0208b0c Compare January 18, 2018 03:30
@ramya-rao-a
Copy link
Contributor

#38543

@ramya-rao-a ramya-rao-a merged commit 531d713 into microsoft:master Jan 18, 2018
@ramya-rao-a ramya-rao-a added this to the January 2018 milestone Feb 2, 2018
@sbatten sbatten deleted the users/stbatt/fbextrec branch September 18, 2018 18:02
@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.

2 participants