VS Code Custom Editor
CustomReadonlyEditorProvider<T extends CustomDocument = CustomDocument>
Readonly な Custom Editor
openCustomDocument(uri: Uri, openContext: CustomDocumentOpenContext, token: CancellationToken): Thenable<T> | T
Uri を受け取ってドキュメントを作って返す
resolveCustomEditor(document: T, webviewPanel: WebviewPanel, token: CancellationToken): Thenable<void> | void
ドキュメントと WebviewPanel を受け取って、ドキュメントを表現する UI を webview の中に作成する
CustomEditorProvider<T extends CustomDocument = CustomDocument> extends CustomReadonlyEditorProvider<T>
onDidChangeCustomDocument vscode 側からここにドキュメント変更時の callback を登録してくるので、ドキュメントに変更があった時に、それらの callback をトリガーする
saveCustomDocument Save (上書き) のハンドラ
saveCustomDocumentAs Save As のハンドラ
revertCustomDocument 変更の破棄のハンドラ
backupCustomDocument バックアップのハンドラ
vscode.commands.registerCommand(name, handler)
コマンドパレットから実行できるコマンドを登録
package.json の contributes.commands にも指定する必要あり。
その他
CustomEditor renders inside the iframe. It has the custom domain in the custom url scheme (vscode-webview://)https://gyazo.com/a377d6acf75a5202daac65c57d8fdbd7