From cdf7b6321809d39803bf4181cdacb36b7e90b992 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 30 May 2023 16:15:52 +0200 Subject: Doc: Add docs for using the Copilot plugin Fixes: QTCREATORBUG-29219 Change-Id: I58215bcf2de92e4619ebd0256ec5cbef9bad45bc Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Marcus Tillmanns Reviewed-by: --- doc/qtcreator/images/icons/copilot.png | Bin 0 -> 257 bytes doc/qtcreator/images/qtcreator-copilot.gif | Bin 0 -> 135157 bytes .../images/qtcreator-preferences-copilot.webp | Bin 0 -> 7182 bytes doc/qtcreator/src/editors/creator-coding.qdoc | 8 +- .../src/editors/creator-only/creator-copilot.qdoc | 96 +++++++++++++++++++++ .../creator-only/creator-language-server.qdoc | 4 +- .../editors/creator-only/creator-mime-types.qdoc | 4 +- doc/qtcreator/src/qtcreator-toc.qdoc | 1 + 8 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 doc/qtcreator/images/icons/copilot.png create mode 100644 doc/qtcreator/images/qtcreator-copilot.gif create mode 100644 doc/qtcreator/images/qtcreator-preferences-copilot.webp create mode 100644 doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc diff --git a/doc/qtcreator/images/icons/copilot.png b/doc/qtcreator/images/icons/copilot.png new file mode 100644 index 0000000000..94f0b72415 Binary files /dev/null and b/doc/qtcreator/images/icons/copilot.png differ diff --git a/doc/qtcreator/images/qtcreator-copilot.gif b/doc/qtcreator/images/qtcreator-copilot.gif new file mode 100644 index 0000000000..452b102a3c Binary files /dev/null and b/doc/qtcreator/images/qtcreator-copilot.gif differ diff --git a/doc/qtcreator/images/qtcreator-preferences-copilot.webp b/doc/qtcreator/images/qtcreator-preferences-copilot.webp new file mode 100644 index 0000000000..bd0422e534 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-copilot.webp differ diff --git a/doc/qtcreator/src/editors/creator-coding.qdoc b/doc/qtcreator/src/editors/creator-coding.qdoc index 6823bf1c8f..23fd888d57 100644 --- a/doc/qtcreator/src/editors/creator-coding.qdoc +++ b/doc/qtcreator/src/editors/creator-coding.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -79,6 +79,12 @@ programming languages besides C++. In addition, it integrates diagnostics from the language server. + \li \l {Using GitHub Copilot} + + The experimental Copilot plugin integrates + \l{https://github.com/features/copilot}{GitHub Copilot} into \QC. + You can view suggestions from Copilot in the code editor. + \li \l{Editing MIME Types} \QC uses the MIME type of a file to determine which mode and editor diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc new file mode 100644 index 0000000000..16dcf80d4b --- /dev/null +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -0,0 +1,96 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \previouspage creator-language-servers.html + \page creator-copilot.html + \nextpage creator-mime-types.html + + \title Using GitHub Copilot + + The experimental Copilot plugin integrates + \l{https://github.com/features/copilot}{GitHub Copilot} into \QC. + You can view suggestions from Copilot in the \uicontrol Edit mode. + + \section1 Requirements + + To use the Copilot plugin, you need: + + \list + \li An active \l{https://docs.github.com/en/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot} + {GitHub Copilot subscription}. + \li GitHub Copilot Neovim plugin installed, as described in + \l{https://docs.github.com/en/copilot/getting-started-with-github-copilot?tool=neovim} + {About GitHub Copilot and Neovim}. + \endlist + + \section1 Enabling the Copilot Plugin + + To enable the Copilot plugin: + + \list 1 + \li Select \uicontrol Help > \uicontrol {About Plugins} > + \uicontrol Utilities > \uicontrol Copilot to enable the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. + \endlist + + \section1 Setting Copilot Preferences + + To set preferences for using Copilot: + + \list 1 + \li Select \uicontrol Edit > \uicontrol Preferences > + \uicontrol Copilot. + \image qtcreator-preferences-copilot.webp {Copilot tab in Preferences} + \li Select \uicontrol {Sign In} to sign into your subscription, activate + your device, and authorize the GitHub Copilot plugin. + + The button turns into a \uicontrol {Sign Out} button. + \li Select the \uicontrol {Enable Copilot} check box to use Copilot. + \li In the \uicontrol {Node.js path} field, enter the full path to the + Node.js executable. + \li In the \uicontrol {Path to agent.js} field, enter the path to + agent.js in the Copilot Neovim plugin. + \li Select the \uicontrol {Request completions automatically} checkbox to + receive suggestions for the current text cursor position when you + make changes. + \endlist + + \section1 Pair-Programming with Copilot + + When you write code in the \l {Working in Edit Mode}{Edit} mode and + \uicontrol {Request completions automatically} is enabled, Copilot + automatically makes suggestions when you type. + + \image qtcreator-copilot.gif {Receiving suggestions from Copilot in the editor} + + To manually request a suggestion at the current editor's cursor position, + select \uicontrol {Request Copilot Suggestion} in the context menu. + + Hover the mouse over a suggestion to show a toolbar with + \inlineimage icons/prev.png + and \inlineimage icons/next.png + buttons for cycling between Copilot suggestions. + + To apply a suggestion as a whole, select \uicontrol Apply or press + the \key Tab key. + + To apply a suggestion word-by-word, select \uicontrol {Apply Word} + or press \key {Alt+Right}. + + \section1 Enabling and Disabling Copilot + + You can enable and disable the Copilot plugin either globally for all + projects or at project level for a particular project. + + To enable or disable Copilot suggestions globally, select the + \inlineimage icons/copilot.png + (\uicontrol {Toggle Copilot}) button. This also sets the value of the + \uicontrol {Enable Copilot} check box in \uicontrol Edit > + \uicontrol Preferences accordingly. + + To enable or disable Copilot suggestions for a particular project, + select \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol Copilot, and then select or deselect the + \uicontrol {Enable Copilot} check box. +*/ diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 348845a7bd..43697c0f6d 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -1,10 +1,10 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \previouspage creator-markdown-editor.html \page creator-language-servers.html - \nextpage creator-mime-types.html + \nextpage creator-copilot.html \title Using Language Servers diff --git a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc index 7436a9c32a..662b3c0fa2 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,7 +8,7 @@ // ********************************************************************** /*! - \previouspage creator-language-servers.html + \previouspage creator-copilot.html \page creator-mime-types.html \nextpage creator-modeling.html diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index e18f60632b..3215f40270 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -130,6 +130,7 @@ \endlist \li \l{Editing Markdown Files} \li \l{Using Language Servers} + \li \l{Using GitHub Copilot} \li \l{Editing MIME Types} \li \l{Modeling} \li \l{Editing State Charts} -- cgit v1.2.3