Skip to content

Commit e83892d

Browse files
committed
update
1 parent acef780 commit e83892d

File tree

7 files changed

+293
-177
lines changed

7 files changed

+293
-177
lines changed

package.json

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -184,41 +184,43 @@
184184
"icon": "$(sort-precedence)"
185185
},
186186
{
187-
"command": "mywiki.commentcreateNote",
188-
"title": "Create Note",
189-
"enablement": "!commentIsEmpty"
187+
"command": "lcpr.remarkCreateNote",
188+
"title": "Create Note"
190189
},
191190
{
192-
"command": "mywiki.commentreplyNote",
193-
"title": "Reply",
194-
"enablement": "!commentIsEmpty"
191+
"command": "lcpr.remarkAdd",
192+
"title": "测试新加线程?"
195193
},
196194
{
197-
"command": "mywiki.commenteditNote",
198-
"title": "Edit",
195+
"command": "lcpr.remarkReplyNote",
196+
"title": "New Note"
197+
},
198+
{
199+
"command": "lcpr.remarkEditNote",
200+
"title": "Edit Note",
199201
"icon": {
200202
"dark": "resources/edit_inverse.svg",
201203
"light": "resources/edit.svg"
202204
}
203205
},
204206
{
205-
"command": "mywiki.commentdeleteNoteComment",
206-
"title": "Delete",
207+
"command": "lcpr.remarkDeleteNoteComment",
208+
"title": "Delete Note",
207209
"icon": {
208210
"dark": "resources/close_inverse.svg",
209211
"light": "resources/close.svg"
210212
}
211213
},
212214
{
213-
"command": "mywiki.commentsaveNote",
214-
"title": "Save"
215+
"command": "lcpr.remarkSaveNote",
216+
"title": "Save Note"
215217
},
216218
{
217-
"command": "mywiki.commentcancelsaveNote",
218-
"title": "Cancel"
219+
"command": "lcpr.remarkCancelsaveNote",
220+
"title": "Cancel Note"
219221
},
220222
{
221-
"command": "mywiki.commentdispose",
223+
"command": "lcpr.remarkDispose",
222224
"title": "Remove All Notes"
223225
}
224226
],
@@ -246,51 +248,57 @@
246248
"menus": {
247249
"commandPalette": [
248250
{
249-
"command": "mywiki.commentcreateNote",
251+
"command": "lcpr.remarkCreateNote",
250252
"when": "false"
251253
},
252254
{
253-
"command": "mywiki.commentreplyNote",
255+
"command": "lcpr.remarkReplyNote",
254256
"when": "false"
255257
},
256258
{
257-
"command": "mywiki.commentdeleteNoteComment",
259+
"command": "lcpr.remarkDeleteNoteComment",
258260
"when": "false"
259261
}
260262
],
261-
"comments/commentThread/title": [],
263+
"comments/commentThread/title": [
264+
{
265+
"command": "lcpr.remarkAdd",
266+
"group": "inline",
267+
"when": "commentController == comment-sample"
268+
}
269+
],
262270
"comments/commentThread/context": [
263271
{
264-
"command": "mywiki.commentcreateNote",
272+
"command": "lcpr.remarkCreateNote",
265273
"group": "inline",
266274
"when": "commentController == comment-sample && commentThreadIsEmpty"
267275
},
268276
{
269-
"command": "mywiki.commentreplyNote",
277+
"command": "lcpr.remarkReplyNote",
270278
"group": "inline",
271279
"when": "commentController == comment-sample && !commentThreadIsEmpty"
272280
}
273281
],
274282
"comments/comment/title": [
275283
{
276-
"command": "mywiki.commenteditNote",
284+
"command": "lcpr.remarkEditNote",
277285
"group": "group@1",
278286
"when": "commentController == comment-sample"
279287
},
280288
{
281-
"command": "mywiki.commentdeleteNoteComment",
289+
"command": "lcpr.remarkDeleteNoteComment",
282290
"group": "group@2",
283291
"when": "commentController == comment-sample && comment == canDelete"
284292
}
285293
],
286294
"comments/comment/context": [
287295
{
288-
"command": "mywiki.commentcancelsaveNote",
296+
"command": "lcpr.remarkCancelsaveNote",
289297
"group": "inline@1",
290298
"when": "commentController == comment-sample"
291299
},
292300
{
293-
"command": "mywiki.commentsaveNote",
301+
"command": "lcpr.remarkSaveNote",
294302
"group": "inline@2",
295303
"when": "commentController == comment-sample"
296304
}

src/controller/RemarkController.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Filename: /home/cc/vscode-leetcode-problem-rating/src/controller/RemarkController.ts
3+
* Path: /home/cc/vscode-leetcode-problem-rating
4+
* Created Date: Monday, November 28th 2022, 3:29:37 pm
5+
* Author: ccagml
6+
*
7+
* Copyright (c) 2022 ccagml . All rights reserved.
8+
*/
9+
10+
import { CommentReply, Disposable, TextDocument } from "vscode";
11+
import { RemarkComment } from "../model/Model";
12+
import { remarkService } from "../service/RemarkService";
13+
14+
// 视图控制器
15+
class RemarkController implements Disposable {
16+
public dispose(): void {}
17+
18+
public remarkAdd(a, b, c, d) {
19+
console.log(a);
20+
console.log(b);
21+
console.log(c);
22+
console.log(d);
23+
}
24+
25+
public remarkCreateNote(reply: CommentReply) {
26+
remarkService.remarkCreateNote(reply);
27+
}
28+
29+
public remarkReplyNote(reply: CommentReply) {
30+
remarkService.remarkReplyNote(reply);
31+
}
32+
33+
public remarkDeleteNoteComment(comment: RemarkComment) {
34+
remarkService.remarkDeleteNoteComment(comment);
35+
}
36+
public startRemark(document: TextDocument) {
37+
remarkService.startRemark(document);
38+
}
39+
40+
public remarkCancelsaveNote(comment: RemarkComment) {
41+
remarkService.remarkCancelsaveNote(comment);
42+
}
43+
public remarkSaveNote(comment: RemarkComment) {
44+
remarkService.remarkSaveNote(comment);
45+
}
46+
public remarkEditNote(comment: RemarkComment) {
47+
remarkService.remarkEditNote(comment);
48+
}
49+
}
50+
51+
export const remarkController: RemarkController = new RemarkController();

src/controller/TreeViewController.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,10 @@ class TreeViewController implements Disposable {
13911391
return this.getNodeById(this.qidToFid.get(qid) || "");
13921392
}
13931393

1394+
public getQidByFid(id: string) {
1395+
return this.fidToQid.get(id);
1396+
}
1397+
13941398
public getFavoriteNodes(): NodeModel[] {
13951399
const res: NodeModel[] = [];
13961400
for (const node of this.explorerNodeMap.values()) {

0 commit comments

Comments
 (0)