に参加して、VS Code の AI 支援開発について学びましょう。

拡張機能ガイド

Hello World サンプルで Visual Studio Code 拡張機能 API の基本を学んだら、次は実際の拡張機能を作成する時です。拡張機能の機能セクションでは、拡張機能が**できること**の概要が提供されていますが、このセクションには、特定の VS Code API を**使用する方法**を説明する詳細なコードガイドとサンプルのリストが含まれています。

各ガイドまたはサンプルでは、次の内容が期待できます。

  • 十分にコメントされたソースコード。
  • サンプル拡張機能の使用法を示す GIF または画像。
  • サンプル拡張機能の実行手順。
  • 使用されている VS Code API のリスト。
  • 使用されている Contribtion Points のリスト。
  • サンプルに類似した実際の拡張機能。
  • API の概念の説明。

ガイドとサンプル

以下に、VS Code APIContribution Points の使用法を含む VS Code ウェブサイトのガイドを示します。拡張機能を作成するためのユーザーインターフェイスのベストプラクティスを学ぶには、UX ガイドラインを参照することを忘れないでください。

VS Code ウェブサイトのガイド API とコントリビューション
コマンド コマンド
contributes.commands
カラーテーマ contributes.themes
ファイルアイコンテーマ contributes.iconThemes
製品アイコンテーマ contributes.productIconThemes
ツリービュー window.createTreeView
window.registerTreeDataProvider
TreeView
TreeDataProvider
contributes.views
contributes.viewsContainers
Webview window.createWebviewPanel
window.registerWebviewPanelSerializer
カスタムエディター window.registerCustomEditorProvider
CustomTextEditorProvider
contributes.customEditors
仮想ドキュメント workspace.registerTextDocumentContentProvider
commands.registerCommand
window.showInputBox
仮想ワークスペース workspace.fs
capabilities.virtualWorkspaces
ワークスペースの信頼 workspace.isTrusted
workspace.onDidGrantWorkspaceTrust
capabilities.untrustedWorkspaces
タスクプロバイダー tasks.registerTaskProvider
Task
ShellExecution
contributes.taskDefinitions
ソース管理 workspace.workspaceFolders
SourceControl
SourceControlResourceGroup
scm.createSourceControl
TextDocumentContentProvider
contributes.menus
デバッガー拡張機能 contributes.breakpoints
contributes.debuggers
debug
Markdown拡張機能 markdown.previewStyles
markdown.markdownItPlugins
markdown.previewScripts
テスト拡張機能 TestController
TestItem
カスタムデータ拡張機能 contributes.html.customData
contributes.css.customData

以下は、VS Code 拡張機能サンプルリポジトリからの追加サンプルのリストです。

GitHub リポジトリのサンプル API とコントリビューション
Webview サンプル window.createWebviewPanel
window.registerWebviewPanelSerializer
ステータスバーのサンプル window.createStatusBarItem
StatusBarItem
ツリービューのサンプル window.createTreeView
window.registerTreeDataProvider
TreeView
TreeDataProvider
contributes.views
contributes.viewsContainers
タスクプロバイダーのサンプル tasks.registerTaskProvider
Task
ShellExecution
contributes.taskDefinitions
マルチルートのサンプル workspace.getWorkspaceFolder
workspace.onDidChangeWorkspaceFolders
補完プロバイダーのサンプル languages.registerCompletionItemProvider
CompletionItem
SnippetString
ファイルシステムプロバイダーのサンプル workspace.registerFileSystemProvider
エディターデコレーターのサンプル TextEditor.setDecorations
DecorationOptions
DecorationInstanceRenderOptions
ThemableDecorationInstanceRenderOptions
window.createTextEditorDecorationType
TextEditorDecorationType
contributes.colors
L10N サンプル
ターミナルのサンプル window.createTerminal
window.onDidChangeActiveTerminal
window.onDidCloseTerminal
window.onDidOpenTerminal
window.Terminal
window.terminals
Vim サンプル コマンド
StatusBarItem
window.createStatusBarItem
TextEditorCursorStyle
window.activeTextEditor
Position
Range
Selection
TextEditor
TextEditorRevealType
TextDocument
ソースコントロールのサンプル workspace.workspaceFolders
SourceControl
SourceControlResourceGroup
scm.createSourceControl
TextDocumentContentProvider
contributes.menus
コメント API のサンプル
ドキュメント編集のサンプル コマンド
contributes.commands
入門サンプル contributes.walkthroughs
テスト拡張機能 TestController
TestItem

言語拡張機能のサンプル

これらのサンプルは言語拡張機能のサンプルです

サンプル VS Code ウェブサイトのガイド
スニペットのサンプル /api/language-extensions/snippet-guide
言語設定のサンプル /api/language-extensions/language-configuration-guide
LSP のサンプル /api/language-extensions/language-server-extension-guide
LSP ログストリーミングのサンプル N/A
LSP マルチルートサーバーのサンプル https://github.com/microsoft/vscode/wiki/Adopting-Multi-Root-Workspace-APIs#language-client--language-server (GitHub リポジトリ Wiki)
LSP Web 拡張機能のサンプル /api/language-extensions/language-server-extension-guide
© . This site is unofficial and not affiliated with Microsoft.