One of the first things developers notice when switching to Antigravity is that its code completion feels noticeably different from other AI IDEs. But if you're running it with default settings, you might only be getting half of what it's capable of.
The Gemma 4 integration in April 2026 marked a turning point. After updating my own setup the week Gemma 4 became available, completion suggestions shifted from "close enough" to "usable as-is" in most cases. This article walks through exactly what to change and how to build completion into your development workflow.
Why Gemma 4 Changed Code Completion
Gemma 4 brings a fundamental improvement to how Antigravity understands code context.
Earlier models referenced a window of lines around the cursor position. Gemma 4 simultaneously processes file structure, import declarations, type definitions, and recent diff history — a much broader picture. In practice, this means:
- Completion candidates reflect function names and method patterns already used in your project
- TypeScript type information is read accurately, with correct argument order and return types
- Comments and variable names are interpreted as intent signals that shape what gets suggested
TypeScript and Python projects see the most noticeable improvement. The "wrong suggestion" rate drops substantially, especially for methods on custom types and domain-specific function signatures.
Three Settings That Determine Completion Quality
Open Antigravity settings (Cmd+, or Ctrl+,) and check these three areas.
1. Completion Model Selection
// .antigravity/settings.json (project-level config)
{
"completions.model": "gemma-4-pro",
"completions.contextLines": 150,
"completions.multilineEnabled": true
}gemma-4-pro delivers the highest accuracy but is slightly slower. gemma-4-flash is better for speed — useful when writing repetitive boilerplate like UI components or CRUD endpoints. My own approach: stay on gemma-4-pro by default, switch to flash only for sessions where I'm churning through similar patterns.
contextLines: 150 sets how many lines above and below the cursor get sent to the model. The default (50 lines) often cuts off import statements at the top of a file, which breaks completion for anything that depends on imported types or utilities.
2. Workspace Indexing
{
"workspace.indexing": true,
"workspace.indexingDepth": "full",
"workspace.excludePatterns": [
"node_modules/**",
".next/**",
"dist/**"
]
}Enabling workspace.indexing brings your entire project into Antigravity's knowledge base. The difference between having this on versus off is probably the single biggest factor in how well completion adapts to your project's patterns.
The excludePatterns setting matters more than it looks. Without it, node_modules gets indexed, and completion suggestions start including internal library code that you never want to write yourself.
3. Completion Trigger Behavior
{
"completions.triggerDelay": 200,
"completions.triggerOnTyping": true,
"completions.ghostText": true
}triggerDelay: 200 ms is how long Antigravity waits after you stop typing before showing completion. The default (500ms) feels slow once you get used to a responsive completion cycle. 200ms feels close to real-time for most people; fast typists can try 100ms.
Practical Techniques to Boost Completion Accuracy
Use Comments to Express Intent
Gemma 4 treats natural language comments as strong context signals.
// Given a userId, fetch email, display name, and last login date.
// If last login was more than 30 days ago, set isInactive to true.
async function fetchUserProfile(userId: string): Promise<UserProfile> {
// Press Tab here — the completion follows the comment preciselyA one or two-line comment before a function dramatically narrows what the model suggests. Yes, writing comments adds a few seconds — but it doubles as inline documentation, so the time isn't wasted.
Keep Related Files Open
Antigravity uses open editor tabs as additional context for completions.
# With users.py open in a tab alongside orders.py,
# the model learns from your existing error-handling and
# type annotation patterns when you write new handlers.
async def get_order_by_id(order_id: str) -> OrderResponse:
# Completion mirrors the patterns from users.py's get_user_by_idArranging related files side by side is a low-effort habit that measurably improves how well suggestions fit your codebase.
Exclude Noise with .antigravityignore
# .antigravityignore (same syntax as .gitignore)
**/*.test.ts
**/*.spec.ts
**/__mocks__/**
**/fixtures/**
Test files and mock implementations introduce patterns you never want in production code. Excluding them from indexing keeps completion suggestions grounded in real implementation patterns.
Diagnosing Poor Completion Quality
If completions aren't meeting expectations, here's where to look first.
Completions not appearing at all: The workspace index may still be building. Check for "Indexing..." in the status bar and wait for it to finish. Large projects can take a few minutes on first run.
Completions are off-topic: contextLines is likely too small. Try 200–300. Also confirm workspace.indexingDepth is set to "full" rather than "shallow".
Completions are sluggish: Switch from gemma-4-pro to gemma-4-flash, or raise triggerDelay back to 500ms. On slower network connections, the bottleneck is often the model request latency, not the editor itself.
For a broader look at editor configuration, see the Antigravity Editor Advanced Customization Guide.
Building Completion Into Your Workflow
Moving from "nice when it works" to "part of how I write code" takes a shift in approach.
The Comment → Complete → Review Loop
- Write what you want to implement as a comment (plain English is fine)
- Press Tab and receive a completion
- Read the suggestion — check types, logic, error handling, then accept or adjust
Once this loop becomes habitual, the mental model shifts from "writing code" to "reviewing AI proposals." In my experience, that shift is the core productivity gain Antigravity delivers — not any single feature.
Combining tab completion with inline chat (Cmd+I) works well for handling the cases where completion gets you 80% there. Completion for the structure, inline chat for the details. The Antigravity Inline Chat Cmd+I Mastery Guide covers that pairing in depth.
After Changing Settings
Once you've updated your configuration, rebuild the workspace index to apply the new settings immediately.
# Run via Command Palette (Cmd+Shift+P)
> Antigravity: Rebuild Workspace IndexThe fastest way to notice the improvement is to write a function you've written variations of before — a CRUD handler, an API client method, something in your project's established pattern. The difference between pre- and post-configuration is clearest with code that has precedent in your codebase.
All three pieces need to work together: model selection, context size, and indexing scope. Once the baseline is set, the configuration carries over to new projects with minimal adjustment.
If you take one thing from this article: add "completions.model": "gemma-4-pro" and "completions.contextLines": 150 to your .antigravity/settings.json today. That alone moves the needle more than most other tweaks.