Skip to content

Commit

Permalink
Add quick diff provider
Browse files Browse the repository at this point in the history
Fixes #392
  • Loading branch information
alexr00 committed Jan 18, 2023
1 parent 70dd0de commit 5205860
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/@types/vscode.proposed.quickdiffProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/169012

export namespace window {
export function registerQuickDiffProvider(quickDiffProvider: QuickDiffProvider, label: string, rootUri?: Uri): Thenable<Disposable>;
export function registerQuickDiffProvider(selector: DocumentSelector, quickDiffProvider: QuickDiffProvider, label: string, rootUri?: Uri): Disposable;
}
}
4 changes: 2 additions & 2 deletions src/view/reviewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ export class ReviewManager {
}

private registerQuickDiff() {
vscode.window.registerQuickDiffProvider({
this._disposables.push(vscode.window.registerQuickDiffProvider({ scheme: 'file' }, {
provideOriginalResource: (uri: vscode.Uri) => {
const changeNode = this.reviewModel.localFileChanges.find(changeNode => changeNode.changeModel.filePath.toString() === uri.toString());
if (changeNode) {
return changeNode.changeModel.parentFilePath;
}
}
}, 'GitHub Pull Request', this.repository.rootUri);
}, 'GitHub Pull Request', this.repository.rootUri));
}

get statusBarItem() {
Expand Down

0 comments on commit 5205860

Please sign in to comment.