Docs › Using the editor › Tab completion
Tab completion
Suggestions at the cursor as you type: how to accept them, where they appear, and every setting that controls them.
On this page
- Accepting a suggestion
- Where suggestions appear, and where they do not
- Settings
- Ignored Files
- What is sent
- Seeing how well it works for you
- If something goes wrong
As you type, AstraCode suggests what comes next as grey ghost text at the cursor. Press Tab to take it, or keep typing to ignore it. It is on as soon as you are signed in, in every file type it can help with.
Accepting a suggestion
| Key | What it does |
|---|---|
| Tab | Accepts the whole suggestion. |
| Cmd+Right (Ctrl+Right on Windows and Linux) | Accepts the next word only, and leaves the rest as ghost text. Press again for the next word. |
| Escape, or keep typing | Dismisses it. |
Word-by-word accepting is Partial Accepts (astracode.tab.partialAccepts, on by default). Turn it off and Cmd+Right goes back to moving to the end of the line (Ctrl+Right to the next word on Windows and Linux) while a suggestion is showing. Tab still accepts the whole suggestion either way.
After you accept a suggestion in TypeScript or JavaScript, AstraCode adds any import it needs, using the language server's own fix. The suggestion is written from a small window around the cursor and cannot see the imports at the top of a long file, so this saves you adding them by hand.
Where suggestions appear, and where they do not
To keep suggestions useful and quick, AstraCode does not ask for one when it would not help:
- In files that match Ignored Files (
astracode.tab.ignoredFiles). - In plain text, logs, search results, the commit message box, Markdown and JSON files.
- In a file over 400,000 characters.
- With the cursor in the middle of a word.
- After a line that is already closed with
),]or}. - On an empty line in a nearly empty file, where there is nothing to go on yet.
- In a
//or#comment, if Suggestions While Commenting is off. - Suggestions that would only add blank lines and indentation, unless Whitespace-Only Suggestions is on.
It also waits until you pause for a moment, reuses a suggestion it has just made for the same spot, and cancels a request when you carry on typing.
Settings
All of these are on the Tab page of AstraCode Settings (run AstraCode: Open Settings), or in your settings.json.
| On the Tab page | Setting | Default | What it does |
|---|---|---|---|
| Tab Completions | astracode.completions.enabled | On | Turns suggestions on or off. |
| Partial Accepts | astracode.tab.partialAccepts | On | Cmd+Right (Ctrl+Right) accepts the next word. |
| Suggestions While Commenting | astracode.tab.suggestionsWhileCommenting | On | Suggest inside // and # comments. |
| Whitespace-Only Suggestions | astracode.tab.whitespaceSuggestions | Off | Show suggestions that only add new lines and indentation. |
| Imports | astracode.tab.autoImport | On | Add the imports an accepted suggestion needs, in TypeScript and JavaScript. |
| Auto Import for Python (beta) | astracode.tab.autoImportPython | Off | The same for Python. Only fixes that purely add lines are applied. |
| Ignored Files | astracode.tab.ignoredFiles | Empty | Comma-separated patterns where Tab never suggests. |
| None | astracode.completions.reportQuality | On | Sends counts of how suggestions perform. See below. |
Ignored Files
List patterns separated by commas. A pattern with no slash matches the file name anywhere, as in .gitignore; a pattern with a slash matches the path from the workspace root. *, **, ? and {a,b} work.
settings.json
"astracode.tab.ignoredFiles": "*.md, **/generated/**, **/*.snap, .env*"
There is no built-in exclusion for files holding secrets. If you keep keys in files you edit, add them to Ignored Files, so their contents are never sent for a suggestion.
What is sent
For each suggestion, the editor sends the AstraCode gateway the 2,000 characters before the cursor and the 600 after it, the file's path and language, and the signatures of what the file imports. Nothing is sent for a file that matches Ignored Files, or in any of the cases listed above.
With astracode.completions.reportQuality on, the editor also sends counts every 30 minutes while you are signed in: how many suggestions were shown and accepted, how many were handled without a request, and how long requests took. No code and no file names. They are sent with your account, so they are not anonymous. See What AstraCode sends and keeps.
Seeing how well it works for you
Run AstraCode: Show Completion Stats, or choose Acceptance Rate, Show on the Tab page. It shows how many suggestions you have seen since the window opened, what share you accepted, how quickly they arrived, and how many failed. The same line goes to the agent log (AstraCode: Show Agent Log).
If something goes wrong
- Inline completions stopped: your AstraCode session has expired. Choose Sign In. See Signing in.
- No suggestions in one file. Check the list above: the file type, its size, and your Ignored Files patterns. AstraCode: Show Completion Stats shows whether any are being asked for.
More in Usage, billing and network errors.
← Updates Edit and ask about a selection →
All documentation
Get started
Using the editor
- Tab completion
- Edit and ask about a selection
- Reviewing the agent's changes
- Git: commit messages, branch review and conflicts
- Dictation
- Layout, themes and the settings page
Agent
- Agent overview
- Agent, Plan, Ask and Debug
- Approvals and permissions
- Plan mode
- Debug mode
- Tools
- Browser tools
- How the agent checks its work
- Checkpoints and undo
- Running several agents at once
- Subagents and background tasks
- Remote agents in GitHub Actions
- Infrastructure as code
Context
Workspaces
Connectors
- Connectors (MCP servers)
- Connector configuration reference
- Use AstraCode from Claude, ChatGPT and other apps
Extending AstraCode
CLI
Account and usage
- Usage and limits
- Bring your own key
- What AstraCode sends and keeps
- Reporting a problem and getting help
Troubleshooting
- Troubleshooting
- Sign-in problems
- Install and update problems
- Chat panel problems
- Agent run problems
- Connector problems
- Dictation problems
- Usage, billing and network errors
- CLI problems