Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix up opening diffs and changes #170

Merged
merged 2 commits into from
Apr 12, 2017
Merged

Fix up opening diffs and changes #170

merged 2 commits into from
Apr 12, 2017

Conversation

jeffyoung
Copy link
Contributor

This prevents the undefined error we were seeing previously but only allows either Open Diff or Open File (not both). Will need to debug later.

@@ -110,14 +110,16 @@ export class TfvcExtension {
const right: Uri = TfvcSCMProvider.GetRightResource(resource);
const title: string = resource.GetTitle();

if (!right) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't see how this change actually helps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logically, it doesn't. It just keeps us aligned with the similar changes in the Git extension.

}

return commands.executeCommand<void>("vscode.diff", left, right, title);
Copy link
Member

Choose a reason for hiding this comment

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

probably want to add an await here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, certainly to be consistent. I'm a little under-informed about when to 'return await' on a function that returns a Promise while you're inside of a function that's async. I've read in several places that you shouldn't actually need it as it can/does create an additional promise (the await I'll be adding here). The act of returning should also create a promise. But, again, I'll need to read up more to get clarity. And, of course, there's a linting rule for this. :-)

Copy link
Member

@jpricket jpricket left a comment

Choose a reason for hiding this comment

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

Oh Yeah!

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.

None yet

3 participants