Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vscode-extension-samples

> 编程语言
Open source

Sample code illustrating the VS Code extension API.

10.1K stars0 likes3 views
WebsiteGitHub

About

Sample code illustrating the VS Code extension API.

VS Code Extension Samples

This repository contains sample code illustrating the VS Code extension API. Each sample is a self-contained extension that explains one topic in VS Code API or VS Code's Contribution Points. You can read, play with or adapt from these samples to create your own extensions.

You can expect from each sample:

  • An explanation of its functionality
  • A gif or screenshot demonstrating its usage
  • Link to a guide on VS Code website, if it has one
  • Listing of used VS Code API and Contribution Points
  • Code of the same style, enforced using ESLint

Prerequisites

You need to have node and npm installed on your system to run the examples. It is recommended to use the node version used for VS Code development itself which is documented here

Usage

  • git clone https://github.com/Microsoft/vscode-extension-samples
  • code <any-sample-folder>
  • npm install in the terminal, then F5 to run the sample
  • Alternatively, follow the instructions in each sample's README for setting up and running the sample

Getting Started

  • Hello World Sample: The Hello World sample for VS Code. See Extension Anatomy documentation.
  • Hello World Minimal Sample: A minimal version of Hello World Sample written in JavaScript.
  • Hello World Test Sample: Hello World sample with extension integration test. See Testing Extensions documentation.
  • Hello World Web Sample: The Hello World sample for VS Code Web. See the Web Extensions guide.

Samples

Sample Guide on VS Code Website API & Contribution
Webview Sample /api/extension-guides/webview window.createWebviewPanel
window.registerWebviewPanelSerializer
Webview View Sample N/A window.registerWebviewViewProvider
Webview Codicons Sample N/A
Status Bar Sample N/A window.createStatusBarItem
StatusBarItem
Tree View Sample /api/extension-guides/tree-view window.createTreeView
window.registerTreeDataProvider
TreeView
TreeDataProvider
contributes.views
contributes.viewsContainers
Task Provider Sample /api/extension-guides/task-provider tasks.registerTaskProvider
Task
ShellExecution
contributes.taskDefinitions
Multi Root Sample N/A workspace.getWorkspaceFolder
workspace.onDidChangeWorkspaceFolders
Completion Provider Sample N/A languages.registerCompletionItemProvider
CompletionItem
SnippetString
Code Actions Sample N/A languages.registerCodeActionsProvider
CodeActionProvider
File System Provider Sample N/A workspace.registerFileSystemProvider
Editor Decorator Sample N/A TextEditor.setDecorations
DecorationOptions
DecorationInstanceRenderOptions
ThemableDecorationInstanceRenderOptions
window.createTextEditorDecorationType
TextEditorDecorationType
contributes.colors
L10n Sample N/A
Terminal Sample N/A window.createTerminal
window.onDidChangeActiveTerminal
window.onDidCloseTerminal
window.onDidOpenTerminal
window.Terminal
window.terminals
Extension Terminal Sample N/A window.createTerminal
window.Pseudoterminal
window.ExtensionTerminalOptions
Color Theme Sample /api/extension-guides/color-theme contributes.themes
Product Icon Theme Sample /api/extension-guides/product-icon-theme contributes.productIconThemes
Vim Sample N/A commands
StatusBarItem
window.createStatusBarItem
TextEditorCursorStyle
window.activeTextEditor
Position
Range
Selection
TextEditor
TextEditorRevealType
TextDocument
webpack-sample /api/working-with-extensions/bundling-extension
esbuild-sample /api/working-with-extensions/bundling-extension
Source Control Sample /api/extension-guides/scm-provider workspace.workspaceFolders
SourceControl
SourceControlResourceGroup
scm.createSourceControl
TextDocumentContentProvider
contributes.menus
Commenting API Sample N/A
Document Editing Sample N/A commands
[Custom Data Sample](https://github.com/Microsoft/vs

Issues· 77 open

View all issuesOpen on GitHub
  • #1299

    Create new issue in microsoft/vscode-extension-samples

    triage-neededUpdated Jul 29, 2026
  • #1254

    VSCode not validating sample

    triage-neededUpdated Jun 1, 2026
  • #1192

    Asked for article description suggestions - didn't give one

    triage-neededUpdated Jun 1, 2026
  • #1120

    command 'vscode-samples.wasm-component-model.run' not found

    bugUpdated May 20, 2026
  • #1282

    chat-sample does not work with Claude model

    triage-neededUpdated May 12, 2026
  • #1159

    Hello world - Compilation didn't run at the launch of the extension (press F5)

    triage-neededUpdated Apr 16, 2026
  • #494

    lsp-embedded-request-forwarding: CSS completion not working - Error: Unable to resolve text model content for resource

    bughelp wantedUpdated Apr 4, 2026
  • #1230

    running wasm-language-server on vscode.dev

    bugUpdated Jan 26, 2026
  • #1261

    Add examples for viewsContainers

    triage-neededUpdated Jan 19, 2026
  • #1183

    Fix lsp-sample guide

    bugUpdated Jan 5, 2026

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言