From f19eff5dcb5b9cf94e05829e9443163b1725dd18 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Fri, 24 Feb 2023 11:27:24 +0100 Subject: [PATCH] Copilot: Add explanatory text to settings Change-Id: Ie45d20d77b064e99fbd4cf26f0794a336b02c51a Reviewed-by: hjk --- src/plugins/copilot/copilotoptionspage.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp index 6934999a77e..b74597dcec6 100644 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ b/src/plugins/copilot/copilotoptionspage.cpp @@ -5,7 +5,7 @@ #include "authwidget.h" #include "copilotsettings.h" -#include "copilotsettings.h" +#include "copilottr.h" #include @@ -27,11 +27,30 @@ public: auto authWidget = new AuthWidget(); + QLabel *helpLabel = new QLabel(); + helpLabel->setTextFormat(Qt::MarkdownText); + helpLabel->setWordWrap(true); + helpLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse + | Qt::LinksAccessibleByKeyboard); + helpLabel->setOpenExternalLinks(true); + // clang-format off + helpLabel->setText(Tr::tr(R"( +The Copilot plugin requires node.js and the Copilot neovim plugin. +If you install the neovim plugin as described in the +[README.md](https://github.com/github/copilot.vim), +the plugin will find the agent.js file automatically. + +Otherwise you need to specify the path to the +[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist) +file from the Copilot neovim plugin. + )", "Markdown text for the copilot instruction label")); + Column { authWidget, br, CopilotSettings::instance().nodeJsPath, br, CopilotSettings::instance().distPath, br, + helpLabel, br, st }.attachTo(this); // clang-format on