mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Fixes #180 Changes from using `vscode` to `@types/vscode` for the majority of extension samples. The `@types/vscode` package is much smaller and does not pull in any dependencies. Other changes: - Remove so empty test files - Bump engine versions to match @types/vscode versions - Use `npm run compile` for most `vscode:prepublish` scripts
Cat Coding — A Webview API Sample
Demonstrates VS Code's webview API. This includes:
- Creating and showing a basic webview.
- Dynamically updating a webview's content.
- Loading local content in a webview.
- Running scripts in a webview.
- Sending message from an extension to a webview.
- Sending messages from a webview to an extension.
- Using a basic content security policy.
- Webview lifecycle and handling dispose.
- Saving and restoring state when the panel goes into the background.
- Serialization and persistence across VS Code reboots.
Demo
VS Code API
vscode module
Running the example
- Open this example in VS Code 1.25+
npm installnpm run watchornpm run compileF5to start debugging
Run the Cat Coding: Start cat coding session to create the webview.
