This document explains the structure of the codeContinue plugin for Sublime Text.
codeContinue/
├── codeContinue.py # Main plugin entry point (registers commands/listeners)
├── CodeContinue.sublime-settings # Default settings template (includes dual-engine & streaming options)
├── Context.sublime-menu # Right-click context menu (Chat, Edit & 1-Click Presets)
├── Default.sublime-commands # Command palette entries (Configure, Switch Model, Chat, Edit, Presets)
├── Default.sublime-keymap # Default keybindings template (empty by default)
├── Main.sublime-menu # Preferences > Package Settings menu
├── messages.json # Package Control post-install & upgrade messaging map
├── docs/
│ ├── CONFIGURATION.md # Detailed configuration guide & provider recipes
│ └── TROUBLESHOOTING.md # Common issues, debugging, and manual install fixes
├── messages/
│ ├── install.txt # Installation welcome guide & keybinding setup
│ ├── 2.4.0.txt # v2.4.0 release notes
│ ├── 2.5.0.txt # v2.5.0 release notes
│ ├── 2.5.1.txt # v2.5.1 release notes
│ ├── 2.5.2.txt # v2.5.2 release notes
│ ├── 2.5.3.txt # v2.5.3 release notes
│ └── 2.5.4.txt # v2.5.4 release notes
├── utils/
│ ├── __init__.py # Submodule marker
│ ├── api.py # OpenAI/Anthropic providers, SSE stream parser, model discovery
│ ├── chat.py # Split-pane real-time streaming Markdown chat & quick presets
│ ├── edit.py # In-place code rewrite with interactive diff review & presets
│ ├── log.py # Debug and error logging helpers
│ ├── settings.py # Dual-Engine adapter, status bar widget, model switcher, wizard
│ ├── suggest.py # FIM autocomplete, suffix trimming, status bar hooks, phantoms
│ └── text_utils.py # Diff computation, suffix overlap trimmer, fence cleaner
├── tests/ # Unit test suite (runs in standard python unittest)
│ ├── test_api.py
│ ├── test_settings.py
│ ├── test_suggest.py
│ └── test_text_utils.py
├── tools/ # Standalone dev/experiments installers
│ ├── README.md # Documentation for installers
│ ├── install.py # Interactive CLI installer
│ └── install_gui.py # Cross-platform Tkinter GUI installer
├── README.md # User documentation & configuration guide
└── LICENSE # License file
- Installation: User installs via Package Control (
Package Control: Install Package>>CodeContinue). - First Launch:
plugin_loaded()detects first run if endpoint or model is unconfigured. - Setup Wizard: Prompts for endpoint, auto-detects available models from
/v1/models(or/api/tags), and prompts for optional API key. - Configuration Saved: Settings saved automatically to
Packages/User/CodeContinue.sublime-settings. - Welcome Message: Package Control displays
messages/install.txtexplaining split-view keybinding setup.
- Minimal top-level entry point discovered by Sublime Text on startup.
- Imports commands, listeners, and
plugin_loadedfromutils/into the package namespace.
- Provides
FeatureSettingsadapter supporting Dual-Engine configuration (per-feature model/endpoint overrides). - Incremental first-run setup wizard and
code_continue_configurecommand. - Status bar widget manager (
update_status_bar,_refresh_all_status_bars) showing model and completion activity. - On-the-fly model switcher (
code_continue_switch_model).
- Fill-In-The-Middle (FIM) & suffix-aware inline completions.
- Intelligent suffix overlap deduplication via
trim_suffix_overlap. - Live status bar indicator updates during generation.
- Implements
CodeContinueListener(on_activated,on_modified,on_text_command,on_query_contextforcode_continue_visible). - Implements
code_continue_suggestand line-by-linecode_continue_accept.
- Interactive split-view Markdown chat panel (
code_continue_chat). - Real-time token streaming using Server-Sent Events (SSE).
- Quick Action presets: Explain Selection, Find Bugs & Vulnerabilities, Generate Unit Tests.
- Maintains conversation history, formats selected code, and renders assistant replies.
- In-place natural language code rewrite and refactoring (
code_continue_edit). - Interactive Diff & Review: unified diff preview in a scratch tab before accepting.
- Preset refactoring actions: Add Docstrings & Types, Optimize & Clean Code.
- Selection target retention across tab switches and
code_continue_replace_selection.
- Provider abstractions for OpenAI-compatible endpoints (
/v1/chat/completions) and Anthropic Claude (/v1/messages). - Streaming chunk parser (
parse_stream_chunk). - Endpoint normalization (
normalize_endpoint), model endpoint deduction (get_models_endpoint), dynamic discovery (fetch_models), and connectivity test (test_endpoint_connectivity).
- Pure Python text utilities:
compute_unified_diff,trim_suffix_overlap,clean_markdown_fences,strip_common_indent,describe_code_selection.