Skip to content

Code Completion

CodeBuddy IDE provides intelligent code completion as you type, helping you write code faster and more efficiently.

About code completion

CodeBuddy offers inline completions as you type. Based on the current code content and project context analysis, it provides multi-line code completions that help you complete your code more efficiently.

CodeBuddy provides completions for numerous languages and a wide variety of frameworks, including Python, JavaScript, TypeScript, Java, C/C++, Go, Ruby, and more.

Triggering code completion

Automatic triggering

Code completions are triggered automatically as you type. When you:

  • Start a new line
  • Type after indentation
  • Enter brackets or other delimiters
  • Move the cursor to the end of a line

CodeBuddy analyzes your context and generates appropriate completions.

Manual triggering

You can manually trigger code completion using the keyboard shortcut:

PlatformShortcut
macOSOption + \
Windows/LinuxAlt + \

Accepting completions

When a completion appears, you have several options:

Accept entire completion

Press Tab to accept the complete completion.

Accept line by line

Accept only the next line of the completion:

PlatformShortcut
macOSCmd + Down
Windows/LinuxCtrl + Down

Accept word by word

Accept only the next word of the completion:

PlatformShortcut
macOSCmd + Right
Windows/LinuxCtrl + Right

Dismissing completions

To dismiss a completion without accepting it, press Escape.

Next Edit Suggestions (NES)

Next Edit Suggestions is an advanced feature that predicts your next editing operation based on your editing history and context. Unlike traditional inline completions that only continue writing from your cursor position, NES can suggest edits at different locations in your code.

How NES works

  • Analyzes your recent editing patterns
  • Predicts what you might want to edit next
  • Shows suggestions that may span multiple lines or affect different parts of your code

Triggering NES manually

PlatformShortcut
All platformsCtrl + Shift + Enter

Accepting NES suggestions

When an NES suggestion appears, press Tab to accept it. Press Escape to dismiss.

Enabling/Disabling NES

NES is enabled by default. To toggle it:

  1. Open the Command Palette (Cmd/Ctrl + Shift + P)
  2. Search for "CodeBuddy: Quick Settings"
  3. Toggle "Next Edit Suggestions"

Or configure it in settings:

  1. Open Settings (Cmd/Ctrl + ,)
  2. Search for codingcopilot.enableNextEditSuggestions
  3. Toggle the setting

Changing the completion model

You can switch between different AI models for code completion:

  1. Open the Command Palette (Cmd/Ctrl + Shift + P)
  2. Search for "CodeBuddy: Change Completions Model"
  3. Select the model you want to use

Or access it through Quick Settings:

  1. Click the CodeBuddy icon in the status bar
  2. Select "Change Completions Model"

Configuring code completion

Enable/Disable auto completion globally

  1. Open Settings (Cmd/Ctrl + ,)
  2. Search for codingcopilot.enableAutoCompletions
  3. Toggle the setting

Or use Quick Settings:

  1. Open the Command Palette (Cmd/Ctrl + Shift + P)
  2. Search for "CodeBuddy: Quick Settings"
  3. Toggle "Auto Completions"

Enable/Disable for specific languages

You can control code completion for specific programming languages:

  1. Open Settings (Cmd/Ctrl + ,)
  2. Search for codingcopilot.enableCompletionLanguage
  3. Configure the language-specific settings

Example configuration in settings.json:

json
{
  "codingcopilot.enableCompletionLanguage": {
    "python": true,
    "javascript": true,
    "markdown": false,
    "plaintext": false
  }
}

You can also toggle completions for the current file's language through Quick Settings.

Generation preference

Control the style of code completions:

  1. Open Settings (Cmd/Ctrl + ,)
  2. Search for codingcopilot.generationPreference
  3. Choose between:
    • Intelligent Mode: Provides multi-line completions based on context
    • One Line Mode: Restricts completions to single lines

IDE Settings configuration

You can also configure code completion through the IDE Settings panel:

  1. Click the CodeBuddy icon in the sidebar or status bar
  2. Open Settings
  3. Navigate to the Tab section

alt text

The Tab settings page provides:

  • Auto Completion: Toggle to enable/disable real-time code completions as you type
  • Language Rules: Configure whether auto completion is enabled for individual languages. Language-level rules override the global setting - even when Auto Completion is turned off, any language explicitly enabled here will still provide completions
  • Generation Preference: Choose between Intelligent Mode (multi-line completions based on context) or One Line Mode

Keyboard shortcuts reference

ActionmacOSWindows/Linux
Trigger completionOption + \Alt + \
Accept allTabTab
Accept lineCmd + DownCtrl + Down
Accept wordCmd + RightCtrl + Right
DismissEscapeEscape
Trigger NESCtrl + Shift + EnterCtrl + Shift + Enter