import * as path from 'path' ; import * as vscode from 'vscode' ; import { getWebviewContent } from './html' ; export interface WebViewWithUri { panel : vscode . WebviewPanel ; uriFsPath : string ; } export function newPanel ( context , uriFsPath , uriTabName ? ) { const webViewWithUri = { panel : vscode . window . createWebviewPanel ( 'sandDance' , `SandDance: ${ path . basename ( uriTabName || uriFsPath ) }` , vscode . ViewColumn . One , { enableScripts : true , localResourceRoots : [ vscode . Uri . file ( path . join ( context . extensionPath , 'resources' ) ) ] , retainContextWhenHidden : true } ) , uriFsPath } ; const webView = webViewWithUri . panel . webview ; webViewWithUri . panel . webview . html = getWebviewContent ( webView , context . extensionPath , uriFsPath ) ; return webViewWithUri ; }