2.5 Copilot
Copilot offers autocomplete-style suggestions as you code as “ghost text”.
GitHub Copilot primarily relies on the context in the file you are actively editing. Any comments, code, or other context provided within the active document will be used as a “prompt” that Copilot will then use to provide a suggested completion.
To expand the scope of the context used by Copilot beyond just the active document, there is a setting to also index and read from other R, Python, or SQL files in the current project. This setting can be toggled on or off in the Tools > Global Options > Copilot > “Index project files with GitHub Copilot” setting.
At times, normal autocomplete and Copilot may seem to conflict with each other. In these cases, it is best to review the Copilot suggestion and determine if it is appropriate for the current context. If it is, you can accept the suggestion by pressing
Tab
. If it is not, you can ignore the suggestion and continue typing or force the normal autocomplete to show by pressingCtrl+Space
.Issue:
Ctrl+Space
crash with spotlight shortcut. ❗️Only show Copilot suggestions when evoke mannually using
Ctrl + Backslash (\)
.The Copilot suggestions can be very distracting and clutter your script.
For general advice on how to use Copilot, please see: