Add a button to fetch when viewing partial content#1542
Add a button to fetch when viewing partial content#1542RMacfarlane merged 4 commits intomicrosoft:masterfrom
Conversation
|
Hey, thanks for creating this PR! Sorry for the delay in reviewing it! Yes, both comments and the file content would need to be refreshed when this is done. For both of these, the data is stored at the tree node level, in From the command here, I think it would be possible to traverse up from the There are some existing integration tests in |
|
Thanks for the detailed guidance! I will take a shot at gracefully refreshing the content when I get the chance, sometime in the next couple of weeks. |
|
Hi @RMacfarlane, I think I have figured out how to refresh the PR content pretty gracefully. Some documents take a while to finish updating after the onChange event is kicked off, so I wanted there to be a progress notification while that was going on. I found it was necessary to do some more complex stuff to listen for the documents to finish updating. See |
|
Hi @RMacfarlane, please let me know if there's anything I can do to help drive this PR :) |
RMacfarlane
left a comment
There was a problem hiding this comment.
Nice, this looks really great! Just had some extremely minor comments - the tslint warnings print above the compilation output so are easy to miss. Will merge this in after that is fixed. Thank you!
src/commands.ts
Outdated
|
|
||
| context.subscriptions.push(vscode.commands.registerCommand('pr.openDiffView', async (fileChangeNode: GitFileChangeNode | InMemFileChangeNode) => { | ||
| const GIT_FETCH_COMMAND = 'Run \'git fetch\''; | ||
| const TITLE = "GitHub Pull Requests"; |
There was a problem hiding this comment.
tslint warning here: " should be '
| const remainingEditors = initiallyVisibleEditors.slice(); | ||
|
|
||
| const handler = (document: vscode.TextDocument) => { | ||
| const index = remainingEditors.findIndex(editor => editor.document == document); |
There was a problem hiding this comment.
tslint warning: == should be ===
src/commands.ts
Outdated
| } | ||
|
|
||
| vscode.commands.executeCommand('vscode.diff', parentURI, headURI, fileName, opts); | ||
| if (isPartial) { |
There was a problem hiding this comment.
I think this should still be above the vscode.diff command
There was a problem hiding this comment.
Sounds good. I changed 'await' to '.then()' to make sure the diff still comes up when the user hasn't selected an option in the information message yet.
|
@RMacfarlane Thanks for the review! I have addressed your feedback. Sorry about the lint warnings, they must have snuck in last minute. 😄 |
|
Thank you! |

Resolves #1462
This currently works by running a 'git fetch' and then reloading the whole window. I would appreciate some guidance on how to refresh things in a more granular way.
questions I have: