vscode-extension-samples README

The project's README from github.com/microsoft/vscode-extension-samples. As one markdown file: 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:

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

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 /api/extension-guides/custom-data-extension
CodeLens Provider Sample N/A languages.registerCodeLensProvider
CodeLensProvider
CodeLens
Call Hierarchy Sample N/A languages.registerCallHierarchyProvider
CallHierarchyProvider
CallHierarchyItem
CallHierarchyOutgoingCall
CallHierarchyIncomingCall
Custom Editors Sample /api/extension-guides/custom-editors window.registerCustomEditorProvider
CustomTextEditorProvider
contributes.customEditors
Semantic tokens /api/language-extensions/semantic-highlight-guide languages.registerDocumentSemanticTokensProvider
vscode.DocumentSemanticTokensProvider
Test Provider Sample N/A
Getting Started Sample N/A
notebook-renderer-sample /api/extension-guides/notebook#notebook-renderer contributes.notebookRenderer
notebook-extend-markdown-renderer-sample /api/extension-guides/notebook#notebook-renderer contributes.notebookRenderer
jupyter-server-provider-sample N/A
Chat Sample N/A
Chat Tutorial N/A
Notifications Sample N/A

Language Server Protocol 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/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 Sample N/A
LSP Embedded Language Service N/A
LSP Embedded Request Forwarding N/A
Wasm language server N/A

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

vscode-extension-samples (microsoft/vscode-extension-samples)

Searching Database…

Что это такое?Коллекция примеров расширений VS Code от Microsoft. Каждое из них самостоятельно и показывает одну тему API расширений VS Code или конкретную точку вклада (Contribution Point).
Это одно расширение или набор из многих?Это набор из многих отдельных примеров расширений (webview, tree view, status bar, task provider, source control, language server и др.). Каждый пример лежит в своей папке и имеет свой README.
Как запустить один из этих примеров?Клонируйте репозиторий, откройте папку примера в VS Code (code .), выполните npm install в терминале и нажмите F5, чтобы запустить расширение в новом окне Extension Development Host. У некоторых примеров есть дополнительные шаги настройки, описанные в их собственном README.
Что нужно установить заранее?Нужны Node.js и npm. Рекомендуется использовать ту же версию Node, что указана в документации по разработке ядра VS Code.
С чего начать, если я новичок в разработке расширений?Начните с Hello World Sample (или с его минимальной версии на JavaScript), чтобы разобраться в устройстве расширения. Затем при необходимости переходите к примерам по конкретным темам, например Webview, Tree View или Task Provider.
Есть ли здесь и расширения на Language Server Protocol?Да, есть отдельный набор примеров LSP: сниппеты, языковая конфигурация, полноценный LSP-сервер, варианты расширений для веба и даже языковой сервер на базе Wasm.
Можно ли создавать расширения, которые работают в браузере (VS Code Web)?Да, есть Hello World Web Sample и LSP Web Extension Sample. Они показывают, как создавать расширения, совместимые с VS Code for the Web.
Есть ли пример создания участника чата или функции на основе ИИ?Да, есть примеры Chat Sample и Chat Tutorial, которые демонстрируют API расширений для чата.
Как обеспечивается единый стиль кода во всех примерах?Все примеры следуют одному стилю кода, который проверяется с помощью ESLint.
Creator
microsoft
Size
105.1 MB
Stars
10.2K
Updated
CommitSep 05
Age
10y
Commits · 90 Days