Lesson 39 of 40
Extension Dev
Expert
Writing Your First VS Code Extension
VS Code is built on extensions — and you can write one too. This lesson scaffolds a new extension, explores the Extension API, and publishes to the marketplace.
1Scaffolding an Extension
Terminal
npm install -g @vscode/generator-code yo yo code # Choose: New Extension (TypeScript) # Fill in: name, description, publisher
This creates a ready-to-run extension with a Hello World command. Press F5 to launch an Extension Development Host — a second VS Code window with your extension loaded.
2The Extension API
The vscode npm module exposes the full VS Code API. Key namespaces:
vscode.commands— register and execute commandsvscode.window— show messages, input boxes, webviewsvscode.workspace— access files, settings, workspace statevscode.languages— register providers for completions, hover, diagnosticsvscode.debug— interact with the debugger
3Registering a Command
extension.ts
export function activate(ctx: vscode.ExtensionContext) { const cmd = vscode.commands.registerCommand( 'myext.helloWorld', () => vscode.window.showInformationMessage('Hello!') ); ctx.subscriptions.push(cmd); }
4Publishing to the Marketplace
Terminal
npm install -g @vscode/vsce vsce package # creates a .vsix file vsce publish # publish to marketplace (requires PAT)
5Testing Extensions
Use @vscode/test-electron to write integration tests that run inside the Extension Development Host. Each test opens a real VS Code window and exercises your extension's commands and APIs programmatically.
All 40 Lessons
Pick any lesson to jump straight to it.
L01
Getting Started with VS Code
L02
The VS Code Interface & Layout
L03
Installing & Managing Extensions
L04
Keyboard Shortcuts & Command Palette
L05
Settings, Themes & Customization
L06
IntelliSense & Code Completion
L07
Integrated Terminal Mastery
L08
Search, Find & Replace Across Files
L09
Git & Source Control with VS Code
L10
Snippets & Emmet Abbreviations
L11
GitHub Copilot — Getting Started
L12
Copilot Chat & Inline Ask
L13
JavaScript & TypeScript Development
L14
Python Development in VS Code
L15
Debugging Like a Pro
L16
Linting, Formatting & ESLint
L17
Multi-Cursor Editing & Refactoring
L18
Workspaces & Multi-Root Projects
L19
Tasks, Build Systems & npm Scripts
L20
Testing with Jest, Vitest & Pytest
L21
React Development Workflow
L22
Node.js & Express in VS Code
L23
Docker & Dev Containers
L24
Live Share — Real-Time Collaboration
L25
Jupyter Notebooks in VS Code
L26
REST Client & API Testing
L27
SSH Remote Development
L28
WSL 2 Integration on Windows
L29
Advanced Debugging: Breakpoints & Watch
L30
Copilot Agent Mode — Agentic Workflows
L31
Profile & Performance Optimisation
L32
GitHub Actions & CI/CD Integration
L33
Custom Keybindings & Key Maps
L34
Settings Sync & Dotfiles Management
L35
Language Server Protocol (LSP) Explained
L36
Rust Development in VS Code
L37
Go Development in VS Code
L38
GitHub Codespaces & vscode.dev
L39
Writing Your First VS Code Extension
L40
Pro VS Code Workflow & Mastery