From 89f1a2dfeb6ad5889e472e059c0721e2379f8dde Mon Sep 17 00:00:00 2001 From: al Date: Mon, 29 Mar 2021 10:37:47 +0800 Subject: [PATCH] fix(comment): show reply button correctly. --- package.json | 4 ++-- src/extension.ts | 4 +--- src/reviewCommentController.ts | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 880c22b..7d7471b 100644 --- a/package.json +++ b/package.json @@ -104,12 +104,12 @@ { "command": "codingPlugin.diff.createComment", "group": "inline", - "when": "commentController == mrDiffComment && commentThreadIsEmpty" + "when": "commentThreadIsEmpty" }, { "command": "codingPlugin.diff.replyComment", "group": "inline", - "when": "commentController == mrDiffComment && !commentThreadIsEmpty" + "when": "!commentThreadIsEmpty" } ], "comments/comment/title": [ diff --git a/src/extension.ts b/src/extension.ts index 28678fe..a3b0a9f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -15,9 +15,8 @@ import { } from 'src/typings/commonTypes'; import { GitService } from 'src/common/gitService'; import { MRUriScheme } from 'src/common/contants'; -import { IDiffComment, IMRData, IFileDiffParam, IDiffFile } from 'src/typings/respResult'; +import { IDiffComment, IMRData, IDiffFile } from 'src/typings/respResult'; import { replyNote, ReviewComment, makeCommentRangeProvider } from 'src/reviewCommentController'; -import { getDiffLineNumber, isHunkLine } from 'src/common/utils'; export async function activate(context: vscode.ExtensionContext) { await GitService.init(); @@ -226,7 +225,6 @@ export async function activate(context: vscode.ExtensionContext) { ); const cacheId = `${mr.iid}/${file.path}`; - // cachedCommentControllers[cacheId]?.dispose(); cachedCommentThreads[cacheId]?.forEach((c) => { c?.dispose(); }); diff --git a/src/reviewCommentController.ts b/src/reviewCommentController.ts index 905812c..042d946 100644 --- a/src/reviewCommentController.ts +++ b/src/reviewCommentController.ts @@ -1,9 +1,9 @@ import * as vscode from 'vscode'; -import { ISessionData, IDiffFileData, ICachedCommentThreads } from 'src/typings/commonTypes'; +import { ISessionData, IDiffFileData } from 'src/typings/commonTypes'; import { EmptyUserAvatar, MRUriScheme } from 'src/common/contants'; import { CodingServer } from 'src/codingServer'; -import { IDiffComment, IMRData, IFileDiffParam, IDiffFile } from 'src/typings/respResult'; +import { IFileDiffParam } from 'src/typings/respResult'; import { getDiffLineNumber, isHunkLine } from 'src/common/utils'; let commentIdx = 0;