Skip to content

Fix description not displaying after creating a pull request#1041

Merged
rebornix merged 1 commit intomasterfrom
rmacfarlane/create-pr
Mar 14, 2019
Merged

Fix description not displaying after creating a pull request#1041
rebornix merged 1 commit intomasterfrom
rmacfarlane/create-pr

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