Skip to content

Task Experiment 1.4#28909

Merged
Lixire merged 9 commits intomasterfrom
amqi/experiment-1-4
Jun 20, 2017
Merged

Task Experiment 1.4#28909
Lixire merged 9 commits intomasterfrom
amqi/experiment-1-4

Conversation

@Lixire
Copy link
Copy Markdown
Contributor

@Lixire Lixire commented Jun 16, 2017

Adds a notification when a grunt/gulp/tsconfig file is opened to check out tasks. Uses the memento from before to not bother people who have already run tasks.

@Lixire Lixire self-assigned this Jun 16, 2017
@Lixire Lixire requested a review from roblourens June 16, 2017 19:49
etag = this.lastResolvedDiskStat.etag; // otherwise respect etag to support caching
}

const storageKey = 'workbench.tasks.ranTaskBefore';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you put this in its own method?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(all the green stuff)

private taskNotification(): void {
const storageKey = 'workbench.tasks.ranTaskBefore';
const fileName = path.relative(this.storageService['workspaceKey'], this.resource['_formatted']);
const fileName = path.relative(this.contextService.getWorkspace().resource.toString(), this.resource.toString());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you only do this check if the storageService check succeeds, to avoid extra work, since most of the time, it won't be needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

true

etag = this.lastResolvedDiskStat.etag; // otherwise respect etag to support caching
}

this.taskNotification();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe this should only happen after opening the file succeeds? Partly to avoid slowing down the file open with extra work, but also, a file can fail to open, in which case you don't want to show the notification.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where are the extension recommendations being shown from?

.then(content => this.handleLoadSuccess(content), error => this.handleLoadError(error));
}

private taskNotification(): void {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

More verb-y name like showTaskNotification or something

@Lixire
Copy link
Copy Markdown
Contributor Author

Lixire commented Jun 19, 2017

@chrmarti is this how you did AB testing for the welcome page?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can use telemetryService.getExperiments().showTaskDocumentation instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not needed then (see below). The welcome page one (you probably looked at) was a special case I'm about to remove.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gotcha. Thanks Christof :D . You're the best!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going to fail the main build, or not work - localized strings have to be constant string literals. But you can add a placeholder like this:

localize('id', 'foo {0} bar {1}', 'string inserted at {0}', 'inserted at {1}' ...)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah that's actually what travis is complaining about: https://travis-ci.org/Microsoft/vscode/jobs/244707435#L3648

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the product name should be "VS Code"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Type as Action instead of any

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mfw you have to import it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code style wise, this is totally fine, even though it feels weird to declare action and messageTest above then duplicate the assignments like this. But JS doesn't really give you better tools and this is one way I would write it.

@Lixire Lixire force-pushed the amqi/experiment-1-4 branch from 1506017 to f7d900d Compare June 19, 2017 22:25
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

C ode! 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

:')

@roblourens
Copy link
Copy Markdown
Member

Lixire added 7 commits June 19, 2017 16:18
- when user opens grunt/gulp/tsconfig file and hasn't run a task, points user to command palette (>tasks)
- add common actions for quickopen
@Lixire Lixire force-pushed the amqi/experiment-1-4 branch from 28a1b9d to f6a02f8 Compare June 19, 2017 23:23
@Lixire Lixire merged commit 0d27a8c into master Jun 20, 2017
@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.

4 participants