Skip to content

Commit 6528023

Browse files
author
Rachel Macfarlane
committed
Add scheme check to pr tree comments provider, fixes #271
1 parent a7a4959 commit 6528023

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/view/prDocumentCommentProvider.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ export class PRDocumentCommentProvider implements vscode.DocumentCommentProvider
2929

3030
async provideDocumentComments(document: vscode.TextDocument, token: vscode.CancellationToken): Promise<vscode.CommentInfo> {
3131
let uri = document.uri;
32-
let params = fromPRUri(uri);
32+
if (uri.scheme === 'pr') {
33+
let params = fromPRUri(uri);
3334

34-
if (!this._prDocumentCommentProviders[params.prNumber]) {
35-
return null;
36-
}
35+
if (!this._prDocumentCommentProviders[params.prNumber]) {
36+
return null;
37+
}
3738

38-
return await this._prDocumentCommentProviders[params.prNumber].provideDocumentComments(document, token);
39+
return await this._prDocumentCommentProviders[params.prNumber].provideDocumentComments(document, token);
40+
}
3941
}
4042

4143
async createNewCommentThread(document: vscode.TextDocument, range: vscode.Range, text: string, token: vscode.CancellationToken): Promise<vscode.CommentThread> {

0 commit comments

Comments
 (0)