(context: vscode.ExtensionContext, uriFsPath: string, uriTabName?: string)
| 10 | } |
| 11 | |
| 12 | export function newPanel(context: vscode.ExtensionContext, uriFsPath: string, uriTabName?: string) { |
| 13 | const webViewWithUri: WebViewWithUri = { |
| 14 | panel: vscode.window.createWebviewPanel( |
| 15 | 'sandDance', |
| 16 | `SandDance: ${path.basename(uriTabName || uriFsPath)}`, |
| 17 | vscode.ViewColumn.One, |
| 18 | { |
| 19 | enableScripts: true, |
| 20 | // Only allow the webview to access resources in our extension's media directory |
| 21 | localResourceRoots: [ |
| 22 | vscode.Uri.file(path.join(context.extensionPath, 'resources')), |
| 23 | ], |
| 24 | retainContextWhenHidden: true, |
| 25 | }, |
| 26 | ), |
| 27 | uriFsPath, |
| 28 | }; |
| 29 | const webView = webViewWithUri.panel.webview; |
| 30 | webViewWithUri.panel.webview.html = getWebviewContent(webView, context.extensionPath, uriFsPath); |
| 31 | return webViewWithUri; |
| 32 | } |
no test coverage detected