Merge pull request #111 from Microsoft/ext-docs-webview

Update webview sample for Sample Guideline for #110
This commit is contained in:
Pine
2018-10-17 13:20:06 -07:00
committed by GitHub
9 changed files with 66 additions and 37 deletions

View File

@ -0,0 +1,5 @@
{
"useTabs": true,
"printWidth": 120,
"singleQuote": true
}

View File

@ -0,0 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"eg2.tslint",
"esbenp.prettier-vscode"
]
}

View File

@ -1,19 +1,18 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/src",
"preLaunchTask": "npm: watch"
}
]
}
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
}

View File

@ -1,3 +1,3 @@
{
"typescript.tsc.autoDetect": "off"
"editor.insertSpaces": false
}

View File

@ -1,20 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@ -13,6 +13,17 @@ Demonstrates VS Code's [webview API](https://code.visualstudio.com/docs/extensio
- Saving and restoring state when the panel goes into the background.
- Serialization and persistence across VS Code reboots.
## Demo
![demo](demo.gif)
## VS Code API
### `vscode` module
- [`window.createWebviewPanel`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#window.createWebviewPanel)
- [`window.registerWebviewPanelSerializer`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#window.registerWebviewPanelSerializer)
## Running the example
- Open this example in VS Code 1.25+

BIN
webview-sample/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

View File

@ -5,8 +5,7 @@
"outDir": "out",
"lib": ["es6"],
"sourceMap": true,
"rootDir": ".",
"strict": true
"rootDir": "src"
},
"exclude": ["node_modules", ".vscode-test"]
}

View File

@ -0,0 +1,7 @@
{
"rules": {
"indent": [true, "tabs"],
"quotemark": [true, "single"],
"semicolon": [true, "always"]
}
}