
VS Code Extension Samples
Sample code showing how to build extensions for the VS Code editor API.
- Stars
- 10.2k
- Forks
- 3.9k
- Licence
- MIT
- Language
- TypeScript
- Last update
- 17 days ago
- Type
- Learning resource
What it is
This repository is a collection of small, self-contained VS Code extensions, each demonstrating one topic from the VS Code extension API or its contribution points. Each sample is meant to be read, run, or copied as a starting point for your own extension. The README lists samples such as a webview, status bar item, tree view, task provider, and terminal examples.
- Run the Hello World sample with npm install and F5 to see a basic extension start up
- Study the Tree View sample to learn how to add a custom view to the sidebar
- Adapt the Task Provider sample as a base for your own build-task integration
- Use the Webview sample as a reference for embedding a custom web page in VS Code
Great for
- Developers who want to build a VS Code extension and need working examples
- Learners who want to see one VS Code API feature at a time
- Developers looking for a starting template for a specific feature like tree views or completion providers
- Developers who want code that follows an ESLint-enforced style
Not ideal for
- People who just want to use VS Code without writing code, since this is developer material
- Anyone needing a finished end-user extension, because these are teaching samples rather than polished products
How to get it
- 1
Clone and build from source
You'll need: Node.js · npm
Clone the repository
git clone https://github.com/Microsoft/vscode-extension-samplesInstall dependencies in a sample folder
npm install - 2
Run it
- Clone the repository with git.
- Open a sample folder in VS Code using code <any-sample-folder>.
- Run npm install in the terminal.
- Press F5 to launch the sample in a new VS Code window.
- 3
Get the most out of it
- Start with the Hello World Sample, which links to the Extension Anatomy documentation
- Use the Hello World Test Sample to learn how to write extension integration tests
- Read each sample's own README for setup details, as the main README suggests
- Check the API & Contribution column to find the exact VS Code API calls each sample uses
Downloads
Strengths
- Each sample focuses on one API topic, which makes them easy to follow
- Samples link to VS Code website guides and list the API calls they use
- Code is kept in a consistent style, enforced with ESLint, according to the README
Trade-offs
- Samples are independent projects, so each one must be installed and run separately
- The README is truncated here, so details for individual samples are not fully verified
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.