Skip to content

Commit 92b63ac

Browse files
committed
fix: param value.
1 parent 341736b commit 92b63ac

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

package.json

+11
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
"command": "codingPlugin.diff.replyComment",
7171
"title": "Reply",
7272
"enablement": "!commentIsEmpty"
73+
},
74+
{
75+
"command": "extension.diff.deleteComment",
76+
"title": "Delete comment",
77+
"#enablement": "!commentIsEmpty"
7378
}
7479
],
7580
"menus": {
@@ -106,6 +111,12 @@
106111
"group": "inline",
107112
"when": "commentController == mrDiffComment && !commentThreadIsEmpty"
108113
}
114+
],
115+
"comments/comment/title": [
116+
{
117+
"command": "extension.diff.deleteComment",
118+
"when": "comment == editable"
119+
}
109120
]
110121
},
111122
"viewsWelcome": [

src/codingServer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,8 @@ export class CodingServer {
723723
try {
724724
const { repoApiPrefix } = await this.getApiPrefix();
725725
const resp: IFileDiffResp = await got
726-
.get(`http://127.0.0.1:5000/api/git/compare_with_path`, {
727-
// .get(`${repoApiPrefix}/compare_with_path`, {
726+
// .get(`http://127.0.0.1:5000/api/git/compare_with_path`, {
727+
.get(`${repoApiPrefix}/compare_with_path`, {
728728
searchParams: {
729729
access_token: this._session?.accessToken,
730730
base: param.base,

src/extension.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { IFileNode, MRTreeDataProvider } from 'src/tree/mrTree';
88
import { ReleaseTreeDataProvider } from 'src/tree/releaseTree';
99
import { IRepoInfo, IMRWebViewDetail, ISessionData } from 'src/typings/commonTypes';
1010
import { GitService } from 'src/common/gitService';
11-
import { ReviewComment, replyNote } from './reviewCommentController';
1211
import { MRUriScheme } from 'src/common/contants';
1312
import { IDiffComment, IMRData, IFileDiffParam } from 'src/typings/respResult';
13+
import { replyNote } from './reviewCommentController';
1414
import { getDiffLineNumber, isHunkLine } from 'src/common/utils';
1515

1616
export async function activate(context: vscode.ExtensionContext) {
@@ -82,7 +82,7 @@ export async function activate(context: vscode.ExtensionContext) {
8282
}
8383

8484
const [left, right] = getDiffLineNumber(i.text);
85-
const [start, end] = params.get('right') ? right : left;
85+
const [start, end] = params.get('right') === `true` ? right : left;
8686
result.push(new vscode.Range(start, 0, end, 0));
8787
return result;
8888
}, [] as vscode.Range[]);

src/reviewCommentController.ts

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function replyNote(reply: vscode.CommentReply, context: vscode.ExtensionC
3131
};
3232
const thread = reply.thread;
3333
thread.contextValue = `editable`;
34+
const params = new URLSearchParams(decodeURIComponent(thread.uri.query));
3435
const newComment = new ReviewComment(
3536
reply.text,
3637
vscode.CommentMode.Preview,

src/tree/inMemMRContentProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class InMemMRContentProvider implements vscode.TextDocumentContentProvide
3030
token: vscode.CancellationToken,
3131
): Promise<string> {
3232
const params = new URLSearchParams(decodeURIComponent(uri.query));
33-
const commit = params.get(`right`) ? params.get(`rightSha`) : params.get('leftSha');
33+
const commit = params.get(`right`) === `true` ? params.get(`rightSha`) : params.get('leftSha');
3434
const path = params.get(`path`);
3535
return await this._service.getRemoteFileContent(`${commit}/${path}`);
3636
}

0 commit comments

Comments
 (0)