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

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

KeyWhat it does
TabAccepts 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 typingDismisses 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:

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 pageSettingDefaultWhat it does
Tab Completionsastracode.completions.enabledOnTurns suggestions on or off.
Partial Acceptsastracode.tab.partialAcceptsOnCmd+Right (Ctrl+Right) accepts the next word.
Suggestions While Commentingastracode.tab.suggestionsWhileCommentingOnSuggest inside // and # comments.
Whitespace-Only Suggestionsastracode.tab.whitespaceSuggestionsOffShow suggestions that only add new lines and indentation.
Importsastracode.tab.autoImportOnAdd the imports an accepted suggestion needs, in TypeScript and JavaScript.
Auto Import for Python (beta)astracode.tab.autoImportPythonOffThe same for Python. Only fixes that purely add lines are applied.
Ignored Filesastracode.tab.ignoredFilesEmptyComma-separated patterns where Tab never suggests.
Noneastracode.completions.reportQualityOnSends 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

More in Usage, billing and network errors.

← Updates Edit and ask about a selection →

All documentation

Get started

Using the editor

Agent

Context

Workspaces

Connectors

Extending AstraCode

CLI

Account and usage

Troubleshooting

Reference