Inline Code Completion & Chat Assistant for VS Code with a modular production-oriented architecture.
Capability | Status |
---|---|
Inline code completions | ✅ Implemented |
Chat assistant (multi‑message, actions) | ✅ Implemented |
Inline edit / smart insertion | ✅ Implemented (initial) |
Settings (provider configs, persistence) | ✅ Implemented (local & postMessage) |
Multi provider (OpenAI / Azure) | ✅ Pluggable configs |
Structured logging & status bar notifications | ✅ Core modules present |
DI / modular core skeleton | 🔄 Partial (extensible scaffolding) |
Tests (unit/integration) | ⏳ Planned |
Bundle optimization (code splitting, lazy markdown libs) | ⏳ Planned |
Telemetry + anonymized metrics | ⏳ Planned |
Secret handling hardening (secure storage abstraction) | ⏳ Planned |
- Features
- Architecture Overview
- Directory Structure
- Settings & Configuration
- Development Workflow
- Build & Packaging
- Code Quality & Conventions
- Roadmap / Next Steps
- Support
- Real‑time suggestions (context aware)
- Supports multiple languages (delegates to extension host context)
- Future: provider strategy + ranking pipeline
- Smart insertion lenses & selection overlay
- Planned: diff preview & accept/reject granularity
- Provider registry (OpenAI, Azure) with unified state reducer
- Local persistence (localStorage) +
postMessage
sync to extension - Dirty / saving state, extendable provider configs
High‑level layers:
core/
– cross‑cutting concerns (auth, logging, config, events, socket, notifications, workspace utilities)features/
– vertical feature modules (chat, code-completion, inline-edit, settings)shared/
– reusable types, utils, constantswebview-chat/
– isolated React + Vite app (UI layer) communicating viapostMessage
Design principles:
- Isolation: Webview UI has no direct dependency on VS Code API; uses context bridge.
- Testability: Reducers + pure helpers separated (tests to be added under
__tests__
). - Explicit state flows: Chat + Settings rely on context providers; actions kept minimal and serializable.
- Progressive optimization: Vendor chunk split in build; further code splitting planned.
src/
extension.ts # Activation entry
core/ # Cross-cutting modules
features/
chat/ # Chat feature (panel, state, actions)
code-completion/ # Completion provider wiring
inline-edit/ # Inline edit lenses & insertion flows
settings/ # Settings (React context + provider forms)
shared/
types/ utils/ constants/ # Reusable definitions
webview-chat/
src/
features/chat/ # Chat UI components & hooks
features/settings/ # Settings UI (provider forms, state)
shared/ # UI shared modules
features/settings/
components/ApiConfiguration.tsx
components/providers/{OpenAi,AzureFoundry}Configuration.tsx
state/
SettingsContext.tsx # Context + provider wrapper
useSettingsLogic.ts # Reducer + persistence + actions
settingsTypes.ts # Strongly typed provider configs
usePersistedSettings.ts # Bridge localStorage + postMessage
Currently stored locally (webview localStorage
) then mirrored to the extension via { command: 'settings:update', payload }
.
Planned enhancements:
- Secure secret storage abstraction (mask at rest)
- Migration layer for schema evolution
- Provider capability metadata (validation rules, required fields)
Install dependencies (root + webview if separate):
npm install
Build extension + webview bundle:
npm run build
Launch in VS Code debug (F5) – the build script runs prior if not present.
During UI development (faster iteration), optionally run Vite dev inside webview-chat/
(NOTE: ensure messaging mocks if used):
cd webview-chat
npm install
npm run dev
- Vite build (manual vendor chunk split, ES2020 target)
- Single JS asset currently ~1.36 MB (gzip ~452 KB) – acceptable for early stage; roadmap includes dynamic imports for markdown & syntax highlight libraries.
- Source maps disabled in production mode (config ready for conditional enabling).
- TypeScript
strict
mode enabled - Path aliases defined in
webview-chat/tsconfig.json
- React contexts kept thin; heavy logic moved to dedicated hooks (e.g.,
useSettingsLogic
) - Lint rule exception minimized (only documented where necessary)
- Pending: add Vitest + React Testing Library + snapshot tests for message rendering & reducer behavior
settingsReducer
– update and save transitions- Chat message parsing / action detection
- Code insertion logic (idempotency & placement)
Area | Planned Work |
---|---|
Performance | Lazy-load markdown + prism, split vendor chunk further |
Security | Secret masking & secure storage provider |
Telemetry | Anonymous usage metrics (opt-in) |
Settings UX | Validation, inline error states, environment presets |
Chat | Streaming tokens, tool execution, multi-tab sessions |
Inline Edit | Diff preview & partial accept UI |
AI Providers | Additional (Gemini, Anthropic) plug-in adapters |
Testing | Unit + integration harness, CI workflow |
- Website: https://www.neocopilot.io
- Email: support@neocopilot.io
- Issues / feedback: Open a GitHub Issue (public tracker coming soon)
Happy coding with NeoCopilot – contributions & suggestions welcome!