Visual Studio Code extensions are plug-ins that enhance the editor's functionality through a rich JavaScript/TypeScript API. Extensions can add commands, UI components, language features, debugging support, AI-powered chat participants, and custom editors β essentially anything that customizes or extends the editing experience. The extension API is comprehensive and well-structured, allowing developers to build everything from simple commands to complex language servers and MCP-integrated AI tools, with contributions declared in package.json and runtime behavior implemented through activation events and the vscode namespace. Understanding the lifecycle (activation, execution, deactivation) and contribution model is key to building efficient, well-integrated extensions.
What This Cheat Sheet Covers
This topic spans 29 focused tables and 221 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Extension Manifest Configuration
| Field | Example | Description |
|---|---|---|
"name": "my-extension" | β’ Unique identifier for the extension β’ must be lowercase alphanumeric with hyphens β’ used in extension ID as publisher.name. | |
"displayName": "My Extension" | β’ Human-readable name shown in marketplace and Extensions view β’ can contain spaces and capitals. | |
"publisher": "mycompany" | β’ Publisher identifier β’ must match your VS Code Marketplace publisher account β’ forms the full extension ID. | |
"version": "1.0.0" | β’ Semantic version in major.minor.patch formatβ’ required for publishing and updates. | |
"engines": { "vscode": "^1.85.0" } | β’ Minimum VS Code version required β’ uses semantic versioning range syntax β’ determines API availability. | |
"main": "./out/extension.js" | β’ Entry point file path for extension activation β’ exports activate() and deactivate() functions. | |
"activationEvents": ["onCommand:ext.hello"] | β’ Array of events triggering extension loading β’ use specific events instead of * for better performance. |