Navigation to diff view from description page - #750
Merged
Peng Lyu (rebornix) merged 11 commits intoJan 7, 2019
Merged
Conversation
| context.subscriptions.push(vscode.commands.registerCommand('pr.openDescription', async (pr: IPullRequestModel) => { | ||
| const pullRequest = ensurePR(prManager, pr); | ||
| context.subscriptions.push(vscode.commands.registerCommand('pr.openDescription', async (descriptionNode: DescriptionNode) => { | ||
| const pullRequest = ensurePR(prManager, descriptionNode.pullRequestModel); |
Contributor
There was a problem hiding this comment.
when opening the description from the command palette or the status bar, descriptionNode can be undefined
Contributor
Author
There was a problem hiding this comment.
fixed ;)
Contributor
There was a problem hiding this comment.
nice
Contributor
Author
| const diffPath: HTMLSpanElement = document.createElement('span'); | ||
| diffPath.className = outdated ? 'diffPath outdated' : 'diffPath'; | ||
| diffPath.textContent = comments[0].path; | ||
| diffPath.addEventListener('click', () => this.openDiff(comments[0])); |
Contributor
There was a problem hiding this comment.
should the event listener only be added if the comment isn't outdated?
| if ((prContainer as TreeNode | Revealable<TreeNode>).revealComment) { | ||
| (prContainer as TreeNode | Revealable<TreeNode>).revealComment(comment); | ||
| } | ||
| } catch (e) { |
Contributor
There was a problem hiding this comment.
log something to debug if reveal fails?
| }); | ||
| } | ||
|
|
||
| let outdated = comments[0].position !== comments[0].original_position; |
Contributor
There was a problem hiding this comment.
in other places we check if position is null to determine if a comment is outdated. I think we should do that here too
Contributor
Author
|
Rachel Macfarlane (@RMacfarlane) comments addressed ;) |
Rachel Macfarlane (RMacfarlane)
approved these changes
Jan 4, 2019
…iffhunk-from-descriptionview
…iffhunk-from-descriptionview
Rachel Macfarlane (RMacfarlane)
deleted the
rebornix/navigate-diffhunk-from-descriptionview
branch
February 16, 2019 00:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Uh oh!
There was an error while loading. Please reload this page.