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

Fix description not displaying after creating a pull request #1041

Merged
merged 1 commit into from
Mar 14, 2019

Conversation

RMacfarlane
Copy link
Contributor

@RMacfarlane RMacfarlane commented Mar 8, 2019

Fixes #1040

The openDescription command that's being called expects an argument of type description node, which gets passed whenever it's being called from the tree by clicking on that type of node. The description node is used to get information about which PR to show - if no description node is passed, the currently active PR is used instead:

context.subscriptions.push(vscode.commands.registerCommand('pr.openDescription', async (descriptionNode: DescriptionNode) => {
		if (!descriptionNode) {
			// the command is triggerred from command palette or status bar, which means we are already in checkout mode.
			let rootNodes = await reviewManager.prFileChangesProvider.getChildren();
			descriptionNode = rootNodes[0] as DescriptionNode;
		}
		const pullRequest = ensurePR(prManager, descriptionNode.pullRequestModel);
		// Create and show a new webview
		PullRequestOverviewPanel.createOrShow(context.extensionPath, prManager, pullRequest, descriptionNode);
		telemetry.on('pr.openDescription');
	}));

So the fix is to not pass anything when executing the command, since at this point the new PR is now active

@rebornix rebornix merged commit b0635f0 into master Mar 14, 2019
@RMacfarlane RMacfarlane deleted the rmacfarlane/create-pr branch March 14, 2019 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Unable to find current pull request" error when creating PR
2 participants