1 Star 0 Fork 0

dluff / vscode-extension-samples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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

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
Code Actions Sample N/A languages.registerCodeActionsProvider
CodeActionProvider
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
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 N/A
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

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/Extension-Authoring:-Adopting-Multi-Root-Workspace-APIs#language-client--language-server

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Sample code illustrating the VS Code extension API. 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/dluff/vscode-extension-samples.git
git@gitee.com:dluff/vscode-extension-samples.git
dluff
vscode-extension-samples
vscode-extension-samples
alexr00/TestFireVoid

搜索帮助