Home

Awesome

<h1 align="center"> VS Code Extension Samples </h1>

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:

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

Getting Started

Samples

<!-- SAMPLES_BEGIN -->
SampleGuide on VS Code WebsiteAPI & Contribution
Webview Sample/api/extension-guides/webviewwindow.createWebviewPanel<br>window.registerWebviewPanelSerializer
Webview View SampleN/Awindow.registerWebviewViewProvider
Webview Codicons SampleN/A
Status Bar SampleN/Awindow.createStatusBarItem<br>StatusBarItem
Tree View Sample/api/extension-guides/tree-viewwindow.createTreeView<br>window.registerTreeDataProvider<br>TreeView<br>TreeDataProvider<br>contributes.views<br>contributes.viewsContainers
Task Provider Sample/api/extension-guides/task-providertasks.registerTaskProvider<br>Task<br>ShellExecution<br>contributes.taskDefinitions
Multi Root SampleN/Aworkspace.getWorkspaceFolder<br>workspace.onDidChangeWorkspaceFolders
Completion Provider SampleN/Alanguages.registerCompletionItemProvider<br>CompletionItem<br>SnippetString
Code Actions SampleN/Alanguages.registerCodeActionsProvider<br>CodeActionProvider
File System Provider SampleN/Aworkspace.registerFileSystemProvider
Editor Decorator SampleN/ATextEditor.setDecorations<br>DecorationOptions<br>DecorationInstanceRenderOptions<br>ThemableDecorationInstanceRenderOptions<br>window.createTextEditorDecorationType<br>TextEditorDecorationType<br>contributes.colors
L10n SampleN/A
Terminal SampleN/Awindow.createTerminal<br>window.onDidChangeActiveTerminal<br>window.onDidCloseTerminal<br>window.onDidOpenTerminal<br>window.Terminal<br>window.terminals
Extension Terminal SampleN/Awindow.createTerminal<br>window.Pseudoterminal<br>window.ExtensionTerminalOptions
Color Theme Sample/api/extension-guides/color-themecontributes.themes
Product Icon Theme Sample/api/extension-guides/product-icon-themecontributes.productIconThemes
Vim SampleN/Acommands<br>StatusBarItem<br>window.createStatusBarItem<br>TextEditorCursorStyle<br>window.activeTextEditor<br>Position<br>Range<br>Selection<br>TextEditor<br>TextEditorRevealType<br>TextDocument
webpack-sample/api/working-with-extensions/bundling-extension
esbuild-sample/api/working-with-extensions/bundling-extension
Source Control Sample/api/extension-guides/scm-providerworkspace.workspaceFolders<br>SourceControl<br>SourceControlResourceGroup<br>scm.createSourceControl<br>TextDocumentContentProvider<br>contributes.menus
Commenting API SampleN/A
Document Editing SampleN/Acommands
Custom Data Sample/api/extension-guides/custom-data-extension
CodeLens Provider SampleN/Alanguages.registerCodeLensProvider<br>CodeLensProvider<br>CodeLens
Call Hierarchy SampleN/Alanguages.registerCallHierarchyProvider<br>CallHierarchyProvider<br>CallHierarchyItem<br>CallHierarchyOutgoingCall<br>CallHierarchyIncomingCall
Custom Editors Sample/api/extension-guides/custom-editorswindow.registerCustomEditorProvider<br>CustomTextEditorProvider<br>contributes.customEditors
Semantic tokens/api/language-extensions/semantic-highlight-guidelanguages.registerDocumentSemanticTokensProvider<br>vscode.DocumentSemanticTokensProvider
Test Provider SampleN/A
Getting Started SampleN/A
notebook-renderer-sample/api/extension-guides/notebook#notebook-renderercontributes.notebookRenderer
notebook-extend-markdown-renderer-sample/api/extension-guides/notebook#notebook-renderercontributes.notebookRenderer
jupyter-server-provider-sampleN/A
Chat SampleN/A
Chat TutorialN/A
Notifications SampleN/A
<!-- SAMPLES_END -->

Language Server Protocol Samples

<!-- LSP_SAMPLES_BEGIN -->
SampleGuide on VS Code WebsiteAPI & Contribution
Snippet Sample/api/language-extensions/snippet-guidecontributes.snippets
Language Configuration Sample/api/language-extensions/language-configuration-guidecontributes.languages
LSP Sample/api/language-extensions/language-server-extension-guide
LSP Log Streaming SampleN/A
LSP Multi Root Server Samplehttps://github.com/Microsoft/vscode/wiki/Extension-Authoring:-Adopting-Multi-Root-Workspace-APIs#language-client--language-server
LSP Web Extension Sample/api/language-extensions/language-server-extension-guide
LSP User Input SampleN/A
LSP Embedded Language ServiceN/A
LSP Embedded Request ForwardingN/A
Wasm language serverN/A
<!-- LSP_SAMPLES_END -->

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.