提交 070d4f38 编写于 作者: P Peng Lyu

filter comments by file

上级 faa4bd1f
......@@ -162,7 +162,6 @@ export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | Pul
};
const _onDidChangeCommentThreads = new vscode.EventEmitter<vscode.CommentThreadChangedEvent>();
setTimeout(() => _onDidChangeCommentThreads.fire({ changed: [], added: [], removed: [] }), 5000);
vscode.workspace.registerDocumentCommentProvider({
onDidChangeCommentThreads: _onDidChangeCommentThreads.event,
provideDocumentComments: async (document: vscode.TextDocument, token: vscode.CancellationToken) => {
......
......@@ -281,9 +281,13 @@ export class ReviewMode implements vscode.DecorationProvider {
return [];
}
let sections = _.groupBy(comments, comment => comment.position);
let fileCommentGroups = _.groupBy(comments, comment => comment.path);
let ret: vscode.CommentThread[] = [];
for (let file in fileCommentGroups) {
let fileComments = fileCommentGroups[file];
let sections = _.groupBy(fileComments, comment => comment.position);
for (let i in sections) {
let comments = sections[i];
......@@ -311,6 +315,7 @@ export class ReviewMode implements vscode.DecorationProvider {
});
}
}
return ret;
}
......@@ -391,12 +396,12 @@ export class ReviewMode implements vscode.DecorationProvider {
async switch(pr: PullRequest) {
try {
if (pr.prItem.maintainer_can_modify) {
await this._repository.checkoutPR(pr);
} else {
// if (pr.prItem.maintainer_can_modify) {
// await this._repository.checkoutPR(pr);
// } else {
await this._repository.fetch(pr.remote.remoteName, `pull/${pr.prItem.number}/head:pull-request-${pr.prItem.number}`);
await this._repository.checkout(`pull-request-${pr.prItem.number}`);
}
// }
} catch (e) {
vscode.window.showErrorMessage(e);
return;
......
......@@ -192,7 +192,7 @@ export class ReviewZoneWidget extends ZoneWidget {
this._actionbarWidget = new ActionBar(actionsContainer.getHTMLElement(), {});
this._disposables.push(this._actionbarWidget);
this._toggleAction = new Action('review.expand', nls.localize('label.expand', "Expand"), this._isCollapsed ? EXPAND_ACTION_CLASS : COLLAPSE_ACTION_CLASS, true, () => {
/* this._toggleAction = new Action('review.expand', nls.localize('label.expand', "Expand"), this._isCollapsed ? EXPAND_ACTION_CLASS : COLLAPSE_ACTION_CLASS, true, () => {
if (this._isCollapsed) {
}
else {
......@@ -201,7 +201,7 @@ export class ReviewZoneWidget extends ZoneWidget {
return null;
});
this._actionbarWidget.push(this._toggleAction, { label: false, icon: true });
this._actionbarWidget.push(this._toggleAction, { label: false, icon: true }); */
}
toggleExpand() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册