Skip to content

Commit 30f742a

Browse files
committed
Fix #193. Show notification when only partial view is being displayed.
1 parent 447c3ba commit 30f742a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
"title": "Open File in GitHub",
8888
"category": "GitHub Pull Requests"
8989
},
90+
{
91+
"command": "pr.openDiffView",
92+
"title": "Open Diff View",
93+
"category": "GitHub Pull Requests"
94+
},
9095
{
9196
"command": "pr.openDescription",
9297
"title": "View Pull Request Description",

src/commands.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ export function registerCommands(context: vscode.ExtensionContext, prManager: IP
5151
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(e.blobUrl));
5252
}));
5353

54+
context.subscriptions.push(vscode.commands.registerCommand('pr.openDiffView', (parentFilePath: string, filePath: string, fileName: string, isPartial: boolean, opts: any) => {
55+
if (isPartial) {
56+
vscode.window.showInformationMessage('Your local repository is not up to date so only partial content is being displayed');
57+
}
58+
vscode.commands.executeCommand('vscode.diff', parentFilePath, filePath, fileName, opts);
59+
}));
60+
5461
context.subscriptions.push(vscode.commands.registerCommand('pr.deleteLocalBranch', async (e: PRNode) => {
5562
const pullRequestModel = ensurePR(prManager, e);
5663
try {

src/view/treeNodes/fileChangeNode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ export class FileChangeNode extends TreeNode implements vscode.TreeItem {
9595

9696
this.command = {
9797
title: 'show diff',
98-
command: 'vscode.diff',
98+
command: 'pr.openDiffView',
9999
arguments: [
100100
this.parentFilePath,
101101
this.filePath,
102102
this.fileName,
103+
this.isPartial,
103104
opts
104105
]
105106
};

0 commit comments

Comments
 (0)