MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / getMenu

Method getMenu

src/plugins/chat/copilot.cpp:51–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51QMenu *Copilot::getMenu()
52{
53 QMenu *menu = new QMenu();
54 menu->setTitle("Chat");
55
56 QAction *addComment = new QAction(tr("Add Comment"));
57 QAction *fixBug = new QAction(tr("Fix Bug"));
58 QAction *explain = new QAction(tr("Explain Code"));
59 QAction *review = new QAction(tr("Review Code"));
60 QAction *tests = new QAction(tr("Generate Unit Tests"));
61 QAction *commits = new QAction(tr("Generate git commits"));
62
63 menu->addAction(addComment);
64 menu->addAction(fixBug);
65 menu->addAction(explain);
66 menu->addAction(review);
67 menu->addAction(tests);
68 menu->addAction(commits);
69
70 connect(addComment, &QAction::triggered, this, &Copilot::addComment);
71 connect(fixBug, &QAction::triggered, this, &Copilot::fixBug);
72 connect(explain, &QAction::triggered, this, &Copilot::explain);
73 connect(review, &QAction::triggered, this, &Copilot::review);
74 connect(tests, &QAction::triggered, this, &Copilot::tests);
75 connect(commits, &QAction::triggered, this, &Copilot::commits);
76
77 return menu;
78}
79
80void Copilot::replaceSelectedText(const QString &text)
81{

Callers 1

Calls 3

connectFunction · 0.85
setTitleMethod · 0.45
addActionMethod · 0.45

Tested by

no test coverage detected