TL;DR for VS Code
Too Long; Didn't Read - View code structure at a glance.
Shows function signatures, class definitions, and type annotations without implementation details. Like Python's .pyi stub files, but for any language.
Features
- Code Overview: Open any supported file with "Open With... > TL;DR" to see its structure
- Structure Diff: Compare structural changes between working copy and Git HEAD
- Syntax Highlighting: Full syntax highlighting powered by Shiki
Supported Languages
- Python (
.py)
- TypeScript/JavaScript (
.ts, .tsx, .js, .jsx, .mjs, .mts, .cjs, .cts)
- Rust (
.rs)
Usage
View Code Structure
- Right-click on a supported file
- Select "Open With..."
- Choose "TL;DR"
View Structure Diff
- Open the Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
- Run "TL;DR: Show Structure Diff"
Or click the diff button in the editor title bar when viewing a file in a Git repository.
Set as Default Editor
To always open certain file types with TL;DR:
Option 1: Via UI
- Open a file with "Open With..." > "TL;DR"
- Click the dropdown arrow next to "TL;DR" in the editor tab
- Select "Configure default editor for '*.xx'..."
- Choose "TL;DR"
Option 2: Via settings.json
{
"workbench.editorAssociations": {
"*.rs": "tldr.preview.rust",
"*.ts": "tldr.preview.typescript",
"*.py": "tldr.preview.python"
}
}
Example
Original TypeScript file:
export class UserService {
private db: Database;
constructor(db: Database) {
this.db = db;
}
async getUser(id: string): Promise<User | null> {
const result = await this.db.query('SELECT * FROM users WHERE id = ?', [id]);
if (result.rows.length === 0) {
return null;
}
return this.mapRowToUser(result.rows[0]);
}
private mapRowToUser(row: any): User {
return {
id: row.id,
name: row.name,
email: row.email
};
}
}
TL;DR view:
export class UserService {
private db: Database;
constructor(db: Database) { ... }
async getUser(id: string): Promise<User | null> { ... }
private mapRowToUser(row: any): User { ... }
}
License
MIT