Skip to content

coder-mtj/popoCompletionAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

popoCompletionAI

πŸš€ AI-Powered Inline Code Completion for IntelliJ IDEA
Type code, get suggestions. Ask questions in comments, get answers.

Stars Release License IntelliJ


What is popoCompletionAI?

popoCompletionAI is a lightweight IntelliJ IDEA plugin that brings DeepSeek V4 AI code completion directly into your editor. It shows ghost text suggestions as you type β€” just like GitHub Copilot, but powered by DeepSeek's latest models.

πŸ’‘ Works offline? No, it calls the DeepSeek API. You need an API key from platform.deepseek.com.

🀦 Why I Built This

The built-in code completion models in my IDE were just too dumb. They'd suggest random variable names, ignore my project context, and couldn't handle even basic logic. I got tired of hitting Tab only to immediately undo. So I decided: if the local models can't cut it, let's bring in DeepSeek V4 β€” a 1M-context model that actually understands your codebase. This plugin replaces the garbage inline suggestions with real AI-powered completions that know your types, your classes, and your intent.


✨ Features

🧠 Smart Inline Completion

As you type, ghost text suggestions appear at the cursor. Press Tab to accept, Esc to dismiss, or keep typing to override.

public class UserService {
    private final UserDao userDao
    //              ↑ ghost text: = new UserDao();
}

πŸ’¬ Comment-to-Answer

Write a question inside a code comment β€” popoCompletionAI detects the intent and answers inline.

// Why does this overlap split fail?
// β†’ The overlap doesn't split because you're passing the
//   same object reference. Try creating a new instance.

Works in //, /* */, #, and -- comments. Supports both Chinese and English.

πŸ“‚ Cross-File Context Awareness

Automatically reads imported classes and same-package files to understand your project context. The model sees the full implementation of your dependencies, not just method signatures.

⚑ Built for Speed

  • 100ms debounce for questions (respond instantly)
  • 300ms debounce for code (balance API usage and responsiveness)
  • java.net.http.HttpClient β€” zero extra dependencies
  • Plugin size: 1.6 MB only

πŸ“¦ Installation

From ZIP (recommended)

  1. Download the latest .zip from Releases
  2. Open IntelliJ IDEA β†’ Settings β†’ Plugins β†’ βš™οΈ β†’ Install Plugin from Disk
  3. Select the zip file and restart your IDE

From Source

git clone https://github.com/coder-mtj/popoCompletionAI.git
cd popoCompletionAI
./gradlew buildPlugin
# Artifact: build/distributions/DeepSeekInLineCompletion-*.zip

🌐 Multi-Provider Support

popoCompletionAI uses OpenAI-compatible APIs under the hood. By changing the Base URL and Model in settings, you can use it with virtually any provider:

Provider Base URL Model Example
DeepSeek (default) https://api.deepseek.com deepseek-v4-pro / deepseek-v4-flash
OpenAI https://api.openai.com gpt-4o / gpt-4o-mini
Ollama (local) http://localhost:11434 codellama:7b / deepseek-coder:6.7b
LM Studio (local) http://localhost:1234 local-model
vLLM / TGI http://your-server:8000 whatever model you serve
Any OpenAI-compatible proxy your proxy URL your model name

⚠️ The provider must support both /beta/completions (or /v1/completions) for code FIM and /chat/completions for Q&A. Most OpenAI-compatible servers support at least chat completions. For pure code completion without Q&A, FIM support is all you need.


βš™οΈ Configuration

After installation, go to Settings β†’ Tools β†’ DeepSeek Completion:

Setting Description Default
API Key DeepSeek API key (get one here) β€”
Base URL API endpoint (change for other providers) https://api.deepseek.com
Model Language model deepseek-v4-pro
Max Tokens Max output per completion (1–4000) 512
Include Context Read imported files for context βœ… On

πŸ’‘ You can also set the environment variable DEEPSEEK_API_KEY instead of entering it in settings.


🧠 How It Works

You type
    β”‚
    β–Ό
Intent Detection ──→ CODE? ──→ FIM API (/beta/completions)
    β”‚                    "DeepSeek, fill between prefix and suffix"
    └──→ QUESTION? ──→ Chat API (/chat/completions)
                         "DeepSeek, answer this question about the code"
    β”‚
    β–Ό
Context Builder
β”œβ”€β”€ PSI structure (class name, fields, methods)
β”œβ”€β”€ 200K chars prefix + 50K chars suffix
└── Full content of imported project files (up to 5 files)
    β”‚
    β–Ό
Post-Processing
β”œβ”€β”€ Anti-dupe (prevents "privateprivate var")
β”œβ”€β”€ Bracket balancing
β”œβ”€β”€ Comment boundary detection
└── Smart stop tokens from suffix
    β”‚
    β–Ό
Ghost text rendered β†’ Tab = Accept

FIM (Fill-in-the-Middle) Explained

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  prefix    β”‚ β†’   β”‚  model     β”‚  ←  β”‚  suffix    β”‚
β”‚ (code      β”‚     β”‚ generates  β”‚     β”‚ (code      β”‚
β”‚  before    β”‚     β”‚  the gap)  β”‚     β”‚  after     β”‚
β”‚  cursor)   β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  cursor)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

src/main/kotlin/com/deepseek/plugin/
β”œβ”€β”€ DeepSeekInlineCompletionProvider.kt   ← Plugin entry point
β”œβ”€β”€ DeepSeekFimClient.kt                 ← HTTP client (FIM + Chat APIs)
β”œβ”€β”€ DeepSeekFimModels.kt                 ← API request/response models
β”œβ”€β”€ CompletionContextBuilder.kt          ← PSI-based context builder
β”œβ”€β”€ IntentDetector.kt                    ← Intent detection engine
β”œβ”€β”€ CodeCompletionInsertHandler.kt       ← Tab-accept handler
β”œβ”€β”€ DeepSeekSettingsState.kt             ← Persistent settings
└── DeepSeekSettingsConfigurable.kt      ← Settings panel UI

πŸ”§ Development

# Compile only
./gradlew compileKotlin

# Build plugin zip
./gradlew buildPlugin

# Launch sandbox IDE for testing
./gradlew runIde

Requirements: JDK 21, Gradle 8.13+


πŸ™ Support This Project

If this plugin helps you code faster, please consider:

  • ⭐ Star this repo β€” it helps others discover it!
  • πŸ› Report bugs via Issues
  • πŸ’‘ Suggest features in Discussions
  • πŸ”€ Open a PR β€” contributions are welcome!

πŸ“„ License

MIT Β© 2026 coder-mtj

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages