🚀 AI-Powered Inline Code Completion for IntelliJ IDEA
Type code, get suggestions. Ask questions in comments, get answers.
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.
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.
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();
}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.
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.
- 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
- Download the latest
.zipfrom Releases - Open IntelliJ IDEA → Settings → Plugins → ⚙️ → Install Plugin from Disk
- Select the zip file and restart your IDE
git clone https://github.com/coder-mtj/popoCompletionAI.git
cd popoCompletionAI
./gradlew buildPlugin
# Artifact: build/distributions/DeepSeekInLineCompletion-*.zippopoCompletionAI 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/completionsfor Q&A. Most OpenAI-compatible servers support at least chat completions. For pure code completion without Q&A, FIM support is all you need.
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_KEYinstead of entering it in settings.
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
┌────────────┐ ┌────────────┐ ┌────────────┐
│ prefix │ → │ model │ ← │ suffix │
│ (code │ │ generates │ │ (code │
│ before │ │ the gap) │ │ after │
│ cursor) │ └────────────┘ │ cursor) │
└────────────┘ └────────────┘
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
# Compile only
./gradlew compileKotlin
# Build plugin zip
./gradlew buildPlugin
# Launch sandbox IDE for testing
./gradlew runIdeRequirements: JDK 21, Gradle 8.13+
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!
MIT © 2026 coder-mtj