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

Change memento for Task Notification #29150

Merged
merged 4 commits into from
Jun 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,10 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil

private showTaskNotification(): void {
const storageKey = 'workbench.tasks.ranTaskBefore';
if (!this.storageService.get(storageKey) && this.contextService.getWorkspace()) {
const fileName = path.relative(this.contextService.getWorkspace().resource.toString(), this.resource.toString());
const ignoreKey = 'workbench.tasks.ignoreTaskNotification';
if (!this.storageService.get(ignoreKey) && !this.storageService.get(storageKey) && this.contextService.getWorkspace2()
&& this.contextService.getWorkspace2().roots && this.contextService.getWorkspace2().roots.length > 0) {
const fileName = path.relative(this.contextService.getWorkspace2().roots[0].toString(), this.resource.toString());
if (fileName.match(/^gruntfile\.js$/i) || fileName.match(/^gulpfile\.js$/i) || fileName.match(/^tsconfig\.json$/i)) {
const message = localize('taskFileOpened', `Run your {0} in VS Code. Get started here.`, fileName.split('.')[0]);
let action: Action;
Expand All @@ -362,13 +364,12 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
case 0: {
this.telemetryService.publicLog('taskNotificationOptionChoice',
{ choice: 0, test: showDocumentation });
this.storageService.store(storageKey, true, StorageScope.GLOBAL);
return action.run();
}
case 1: {
this.telemetryService.publicLog('taskNotificationOptionChoice',
{ choice: 1, test: showDocumentation });
return this.storageService.store(storageKey, true, StorageScope.GLOBAL);
return this.storageService.store(ignoreKey, true, StorageScope.GLOBAL);
}
case 2: {
this.telemetryService.publicLog('taskNotificationOptionChoice',
Expand Down