CodeNotes — Native Code Memory for VS Code
A native, zero-friction note system that lives inside your editor — not on top of it.
Philosophy
| ❌ Old approach |
✅ CodeNotes |
| Webview popup for every action |
Input box / command palette |
| Manual save button |
Auto-sync on every change |
| Separate "app" feel |
Gutter icons, hover tooltips, CodeLens |
| Slow to open |
Notes in < 2 seconds via Ctrl+Alt+N |
Quick Start
1. Install dependencies
npm install
npm run compile
2. Set up Supabase (optional — works offline too)
- Create a project at supabase.com
- Run
supabase-migration.sql in the SQL editor
- Copy your Project URL and Anon key
- In VS Code settings:
codenotes.supabaseUrl → your project URL
codenotes.supabaseAnonKey → your anon key
3. Press F5 to launch Extension Development Host
Usage
Creating a note
Ctrl+Alt+N (Win/Linux) or Cmd+Alt+N (Mac) — instant input box on the current line
- Right-click any line → CodeNotes: Add Note Here
- Command Palette: CodeNotes: Add Note Here
Viewing notes
- Gutter icons — colored dots next to noted lines
- Hover over a noted line to preview the note
- CodeLens — click the inline label above the line
- Sidebar — Explorer panel → CodeNotes section
Searching
Ctrl+Alt+F — fuzzy search across all notes
- Sidebar filter (type in the search box in the toolbar)
- Dashboard → filter by file, color, text
Dashboard
- Command: CodeNotes: Open Dashboard
- Opens to the side (doesn't replace your editor)
- Filter, search, manage workspaces, sign in/out
Architecture
extension.ts ← entry point, wires everything
├── storage/
│ └── NoteStore.ts ← in-memory cache + globalState persistence
├── providers/
│ ├── DecorationProvider.ts ← gutter icons + line highlights
│ ├── NoteHoverProvider.ts ← hover tooltips
│ ├── NoteCodeLensProvider.ts ← inline note count
│ └── NoteTreeProvider.ts ← sidebar tree
├── commands/
│ └── index.ts ← all command handlers
├── sync/
│ └── SyncEngine.ts ← Supabase background sync
└── webview/
└── DashboardPanel.ts ← HTML dashboard (browse/manage only)
Data Model
interface Note {
id: string; // UUID
text: string; // Note content
filePath: string; // Absolute path
fileRelativePath: string; // Relative to workspace
line: number; // 0-indexed
lineText: string; // Snapshot of line at creation
workspaceId: string; // VS Code workspace URI
userId: string | null; // Supabase user ID
createdAt: string; // ISO timestamp
updatedAt: string;
syncedAt: string | null;
isDirty: boolean; // Has unsynced changes
isDeleted: boolean; // Soft delete
tags: string[];
color: 'amber'|'blue'|'green'|'red'|'purple';
}
Sync Strategy
- Write → saved immediately to
globalState (local)
- Debounce → 3 seconds after last change, push to Supabase
- Pull → every 30 seconds, merge remote notes
- Conflict → last-write-wins on
updated_at
- Offline → works fully offline, syncs when reconnected
VS Code APIs Used
| API |
Purpose |
vscode.window.createTextEditorDecorationType |
Gutter icons, line highlights |
vscode.languages.registerHoverProvider |
Hover tooltips |
vscode.languages.registerCodeLensProvider |
Inline note count |
vscode.window.createTreeView |
Sidebar panel |
vscode.window.showInputBox |
Fast note creation |
vscode.window.showQuickPick |
Search UI |
vscode.window.createStatusBarItem |
Sync status |
vscode.window.createWebviewPanel |
Dashboard only |
vscode.ExtensionContext.globalState |
Local persistence |
Configuration
| Setting |
Default |
Description |
codenotes.supabaseUrl |
"" |
Supabase project URL |
codenotes.supabaseAnonKey |
"" |
Supabase anon key |
codenotes.syncEnabled |
true |
Enable cloud sync |
codenotes.gutterIconColor |
#F5A623 |
Default gutter color |
codenotes.showCodeLens |
true |
CodeLens note labels |
codenotes.autoSyncInterval |
30 |
Sync interval (seconds) |
- No lag on file open: notes load from in-memory cache, not disk
- Decorations are incremental: only re-render visible editors
- Sync is debounced: rapid typing doesn't trigger network calls
- Webview is lazy: only created when user opens dashboard
- Tree view uses VS Code's virtual rendering: handles thousands of notes
Built to feel like breakpoints and hover-docs — not a separate app.
"# lync"
| |