2020-08-24 17:39:48 -07:00
|
|
|
# Calico Colors — Webview View API Sample
|
|
|
|
|
|
2023-01-23 09:28:38 -05:00
|
|
|
Demonstrates VS Code's [webview view API](https://github.com/microsoft/vscode/issues/46585). This includes:
|
2020-08-24 17:39:48 -07:00
|
|
|
|
|
|
|
|
- Contributing a webview based view to the explorer.
|
|
|
|
|
- Posting messages from an extension to a webview view
|
|
|
|
|
- Posting message from a webview to an extension
|
|
|
|
|
- Persisting state in the view.
|
2020-08-25 14:46:34 -07:00
|
|
|
- Contributing commands to the view title.
|
2020-08-24 17:39:48 -07:00
|
|
|
|
|
|
|
|
## VS Code API
|
|
|
|
|
|
|
|
|
|
### `vscode` module
|
|
|
|
|
|
2020-08-25 14:30:47 -07:00
|
|
|
- [`window.registerWebviewViewProvider`](https://code.visualstudio.com/api/references/vscode-api#window.registerWebviewViewProvider)
|
2020-08-24 17:39:48 -07:00
|
|
|
|
|
|
|
|
## Running the example
|
|
|
|
|
|
|
|
|
|
- Open this example in VS Code 1.49+
|
|
|
|
|
- `npm install`
|
|
|
|
|
- `npm run watch` or `npm run compile`
|
|
|
|
|
- `F5` to start debugging
|
|
|
|
|
|
|
|
|
|
In the explorer, expand the `Calico Colors` view.
|