OpenNextEdit
Bring AI-assisted editing to the models and infrastructure you choose.
OpenNextEdit adds two complementary workflows to VS Code: fast inline
completions that keep you typing and next-edit suggestions that anticipate the
change you are likely to make next.
Point it at a local or self-hosted OpenAI-compatible endpoint, choose prompt
formats matched to your models, and tune completions and next edits
independently. You get a native editor experience without giving up control of
the model, its context, or where your code is sent.
Requirements
- VS Code 1.92 or newer.
- An OpenAI-compatible server with a
/completions endpoint.
- A model compatible with one of OpenNextEdit's prompt formats.
Install
Install OpenNextEdit from your editor's extension marketplace or from a .vsix
file. To build a .vsix locally:
npm install
npm run package
code --install-extension open-next-edit-*.vsix
Run this command from the command palette:
OpenNextEdit: Open Config File
OpenNextEdit creates a starter TOML file if one does not exist. Update the model
and URL for each feature you want to use:
active_profile = "local"
log_level = "info"
[profiles.local.inline_completion]
enabled = true
url = "http://localhost:1234/v1"
model = "Qwen/Qwen2.5-Coder-3B"
edit_format = "qwen"
[profiles.local.next_edit]
enabled = true
url = "http://localhost:1234/v1"
model = "sweepai/sweep-next-edit-v2-7B"
edit_format = "sweep"
Use api_key = "..." in either feature table if your endpoint requires
authentication. Changes to the TOML file are reloaded automatically.
The default config path is:
Linux/macOS: ~/.config/opennextedit/config.toml
Windows: %APPDATA%\OpenNextEdit\config.toml
Set opennextedit.configPath in VS Code settings to use another file.
| Feature |
Supported edit_format values |
| Inline completion |
qwen, starcoder, gemma |
| Next edit |
sweep |
Choose the format that matches how your model was trained.
Common settings
Each feature has independent model, generation, timeout, and context settings.
The generated starter config contains every available option.
| Setting |
Purpose |
enabled |
Enables or disables the feature. |
url |
OpenAI-compatible API base URL, usually ending in /v1. |
model |
Model identifier sent to the endpoint. |
max_tokens |
Maximum generated tokens. |
max_context_tokens |
Context budget; currently enforced for inline completion. |
request_timeout_ms |
Maximum request duration. |
debounce_ms |
Time typing must settle before an inline request. |
edit_grouping_time_ms |
Time editing must settle before a next-edit request. |
context.lines_before_cursor |
Current-file lines collected before the cursor. |
context.lines_after_cursor |
Current-file lines collected after the cursor. |
context.max_files |
Maximum number of additional editor files included. |
context.clipboard_max_age_ms |
Maximum age for clipboard context; 0 disables it. |
Inline completions
Type in an editor and pause briefly. OpenNextEdit requests a completion and VS
Code displays it as ghost text.
- Press
Tab to accept the suggestion.
- Press
Escape to dismiss it.
- Use VS Code's
Accept Next Word Of Inline Suggestion or
Accept Next Line Of Inline Suggestion commands for partial acceptance.
Next-edit suggestions
After the active document changes, OpenNextEdit waits for editing to settle and
requests the most likely next change. Run OpenNextEdit: Request Next Edit to
request one immediately.
The editor marks only the changed tokens and shows the replacement beside them.
Hover over a change to see the complete replacement.
- Press
Tab once to jump to the edit.
- Press
Tab again to apply it.
- Press
Escape to dismiss it.
If an inline completion is already visible, the next edit waits in the
background. Pressing Escape rejects the inline completion and shows the
pending next edit if the document and cursor have not changed. Accepting the
inline completion invalidates the pending edit and requests a fresh one.
Commands
OpenNextEdit: Open Config File
OpenNextEdit: Show Status
OpenNextEdit: Request Next Edit
OpenNextEdit: Jump to Next Edit
OpenNextEdit: Accept Next Edit
OpenNextEdit: Dismiss Next Edit
OpenNextEdit: Show Status opens the output channel. The inline-completion and
next-edit status bars show whether each feature is idle, waiting, requesting, or
has a suggestion. They can be hidden with
opennextedit.showInlineCompletionStatusBar and
opennextedit.showNextEditStatusBar in VS Code settings.
Context and privacy
Prediction requests can include source from the current, visible, and recently
visited files, recent edits and cursor actions, diagnostics, language-server
results, and recent clipboard text. Use an endpoint you trust, and set
clipboard_max_age_ms = 0 under a feature's context table to exclude the
clipboard.
At debug log level, the output channel includes assembled context, prompts, and
model responses. These logs can contain source code and clipboard contents.
Troubleshooting
If suggestions do not appear:
- Run
OpenNextEdit: Show Status and check for a configuration or request
error.
- Confirm that
active_profile names an existing profile.
- Confirm that the relevant feature has
enabled = true.
- Confirm that the active file belongs to an open workspace folder.
- Confirm that the configured server accepts requests at
/v1/completions.
- Confirm that
edit_format matches the selected model.