Skip to content
Sample code illustrating the VS Code extension API.
Branch: master
Clone or download
Latest commit 7ed787c May 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.base-sample Fixing lint errors for many of the projects May 10, 2019
.github Update all links for microsoft/vscode-docs#2165 Dec 17, 2018
.scripts Adding top level compile and lint scripts May 10, 2019
.vscode Fix code according to microsoft/vscode-docs#2512 Mar 26, 2019
basic-multi-root-sample Fixing lint errors for many of the projects May 10, 2019
comment-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
completions-sample Fixing lint errors for many of the projects May 10, 2019
configuration-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
contentprovider-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
decorator-sample Fixing lint errors for many of the projects May 10, 2019
diagnostic-related-information-sample Fixing lint errors for many of the projects May 10, 2019
document-editing-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
fsprovider-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
helloworld-minimal-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
helloworld-sample Fixing lint errors for many of the projects May 10, 2019
i18n-sample Update package-lock.json May 14, 2019
language-configuration-sample Update all links for microsoft/vscode-docs#2165 Dec 17, 2018
lsp-log-streaming-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
lsp-multi-server-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
lsp-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
nodefs-provider-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
progress-sample Don't dev depend on mocha May 10, 2019
quickinput-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
snippet-sample Update all links for microsoft/vscode-docs#2165 Dec 17, 2018
source-control-sample Use standard tslint rules for source-control example May 10, 2019
statusbar-sample Fixing lint errors for many of the projects May 10, 2019
task-provider-sample Enable strict mode for many samples May 10, 2019
terminal-sample Fixing lint errors for many of the projects May 10, 2019
theme-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
tree-view-sample Fixing lint errors for many of the projects May 10, 2019
vim-sample Fixing lint errors for many of the projects May 10, 2019
virtual-document-sample Fixing lint errors for many of the projects May 10, 2019
webpack-sample Use latest `vscode` or `"@types/vscode"` May 10, 2019
webview-sample Fixing lint errors for many of the projects May 10, 2019
.gitignore start completions sample Dec 30, 2016
.prettierrc.json Enforce tab indentation Mar 26, 2019
LICENSE License Oct 10, 2018
README.md Delete the legacy previewHtml sample May 1, 2019
package.json Adding top level compile and lint scripts May 10, 2019
samples.code-workspace who deleted this file?!? Apr 18, 2019

README.md

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 TSLint

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

Samples

Sample Guide on VS Code Website API & Contribution
Webview Sample /api/extension-guides/webview window.createWebviewPanel
window.registerWebviewPanelSerializer
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
File System Provider Sample N/A workspace.registerFileSystemProvider
Editor Decoractor Sample N/A TextEditor.setDecorations
DecorationOptions
DecorationInstanceRenderOptions
ThemableDecorationInstanceRenderOptions
window.createTextEditorDecorationType
TextEditorDecorationType
contributes.colors
I18n Sample N/A
Terminal Sample N/A window.createTerminal
window.onDidChangeActiveTerminal
window.onDidCloseTerminal
window.onDidOpenTerminal
window.Terminal
window.terminals
Vim Sample N/A commands
StatusBarItem
window.createStatusBarItem
TextEditorCursorStyle
window.activeTextEditor
Position
Range
Selection
TextEditor
TextEditorRevealType
TextDocument
Source Control Sample /api/extension-guides/scm-provider scm.createSourceControl
SourceControl
SourceControlResourceGroup
workspace.workspaceFolders
TextDocumentContentProvider

Language Protocol Server Samples

Sample Guide on VS Code Website API & Contribution
Snippet Sample /api/language-extensions/snippet-guide contributes.snippets
Language Configuration Sample /api/language-extensions/language-configuration-guide contributes.languages
LSP Sample /api/language-extensions/language-server-extension-guide
LSP Log Streaming Sample N/A
LSP Multi Root Server Sample https://github.com/Microsoft/vscode/wiki/Adopting-Multi-Root-Workspace-APIs#language-client--language-server

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

You can’t perform that action at this time.