提交 4b2fcb84 编写于 作者: R Rob Lourens 提交者: GitHub

Merge pull request #29150 from Microsoft/amqi/experiment-1-4

Change memento for Task Notification
......@@ -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;
......@@ -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',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册