Completions
Code completions are text suggestions that appear inline as you type in an editor. These suggestions can be lines or blocks of code based on the context of what you’re writing. Other names for code completions include inline suggestions, ghost text, or inline completions.
Positron Assistant enables completions by default when you authenticate with a language model provider that generates completions, such as GitHub Copilot. Interact with suggestions by:
- Pressing the TabTab key to accept the entire suggestion.
- Pressing to accept the suggestion word-by-word for a single line suggestion, or line-by-line for multi-line suggestions.
- Pressing EscEsc or continuing to type to dismiss the suggestion.
If you are not receiving suggestions:
- Make sure you are authenticated with GitHub Copilot in the language model provider configuration.
- Check the developer tools console logs or the Assistant output logs to see if there are any errors logged.
Set minimum delay before showing completions
By default, completion suggestions are shown immediately as you write code.
To configure a minimum delay before showing completions, modify the setting editor.inlineSuggest.minShowDelay, which defaults to 0 milliseconds. For example, setting this value to 500 introduces a half-second delay before showing completion suggestions.
Pause code completions
Completions from an LLM such as GitHub Copilot can be super useful, but sometimes they can be distracting or interfere with other completions from the Python or R LSP.
To pause code completions temporarily:
- Open the Command Palette and run the command Snooze Inline Suggestions and select the duration to snooze completions for; or
- Click on the Assistant status bar icon, then the Snooze button to snooze completions
To view the remaining time on a snooze, hover over the Assistant status bar icon to see a popup with the remaining time.
To cancel the snooze early:
- Open the Command Palette and run the command Cancel Snooze Inline Suggestions; or
- Click on the Assistant status bar icon, then the stop button
Toggle completions on or off for all files
Toggle via the Command Palette
- Open the Command Palette and run the command Positron Assistant: Toggle (Enable/Disable) Completions
- Completions are now disabled altogether, until you run the command again to enable them
Toggle via the Assistant status bar popup
- Click the Assistant status bar icon
- In the popup, uncheck All files to disable completions for all files
Enable or disable inline completions by language
Configure via settings
- Open the Command Palette and run the command Preferences: Open User Settings
- Search for the setting
positron.assistant.inlineCompletions.enable - Modify the list of languages and whether completions should be enabled or disabled
Configure via the Assistant status bar popup
- Click the Assistant status bar icon
- In the popup, uncheck the current file type to disable completions for that file type
Disable inline completions by glob pattern
- Open the Command Palette and run the command Preferences: Open User Settings
- Search for the setting
positron.assistant.inlineCompletionExcludes - Modify the list of glob patterns