Skip to content

Commit

Permalink
Avoid prompting for same file type in the same session #50537
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed May 29, 2018
1 parent 5625cbc commit 1fa562c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const empty: { [key: string]: any; } = Object.create(null);
const milliSecondsInADay = 1000 * 60 * 60 * 24;
const choiceNever = localize('neverShowAgain', "Don't Show Again");
const searchMarketplace = localize('searchMarketplace', "Search Marketplace");
const processedFileExtensions: string[] = [];

interface IDynamicWorkspaceRecommendations {
remoteSet: string[];
Expand Down Expand Up @@ -357,6 +358,14 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
return;
}

let fileExtension = paths.extname(uri.fsPath);
if (fileExtension) {
if (processedFileExtensions.indexOf(fileExtension) > -1) {
return;
}
processedFileExtensions.push(fileExtension);
}

// re-schedule this bit of the operation to be off
// the critical path - in case glob-match is slow
setImmediate(() => {
Expand Down Expand Up @@ -472,7 +481,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
const fileExtensionSuggestionIgnoreList = <string[]>JSON.parse(this.storageService.get
('extensionsAssistant/fileExtensionsSuggestionIgnore', StorageScope.GLOBAL, '[]'));
const mimeTypes = result[1];
let fileExtension = paths.extname(uri.fsPath);

if (fileExtension) {
fileExtension = fileExtension.substr(1); // Strip the dot
}
Expand Down

0 comments on commit 1fa562c

Please sign in to comment.