Guide for VS Code extension development from scaffolding to Marketplace publication
An English guide for building VS Code extensions, covering the full lifecycle from scaffolding to Marketplace publication. Includes reference material on webview patterns, CSP security, TreeView, testing, packaging and troubleshooting. Updated for VS Code 1.74+ APIs.
Adapted from aktsmm/agent-skills (CC BY-NC-SA 4.0), translated to English with corrections for current VS Code APIs.
npm install -g yo generator-code
yo code
my-extension/
├── package.json # Extension manifest
├── src/extension.ts # Entry point
├── out/ # Compiled JS
├── images/icon.png # 128x128 PNG for Marketplace
└── .vscodeignore # Exclude files from VSIX
npm run compile # Build once
npm run watch # Watch mode (F5 to launch debug)
npx @vscode/vsce package # Creates .vsix
The full skill includes detailed reference documents on:
For the complete guide with all reference documents:
npx skills add lewiswigmore/agent-skills --skill vscode-extension-guide-en
.vscodeignoreactivationEvents are auto-detected for contributed commands and viewsProblem: Extension not loading
Solution: Check activationEvents. Since VS Code 1.74, these are auto-detected for contributed commands/views.
Problem: Command not found Solution: Match the command ID exactly between package.json and your code.
Problem: Webview content not displaying
Solution: Check your Content Security Policy. Use the webview's cspSource property.
@test-driven-development - Write tests before implementing extension features@debugging-strategies - Systematic troubleshooting for extension issues