| 49 | } |
| 50 | |
| 51 | QMenu *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 | |
| 80 | void Copilot::replaceSelectedText(const QString &text) |
| 81 | { |
no test coverage detected