MCPcopy Create free account
hub / github.com/coderoad/coderoad-vscode / createWebViewPanel

Function createWebViewPanel

src/services/webview/create.ts:27–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 const disposables: vscode.Disposable[] = []
26
27 function createWebViewPanel(): vscode.WebviewPanel {
28 const viewType = 'CodeRoad'
29 const title = 'CodeRoad'
30 const config = {
31 // Enable javascript in the webview
32 enableScripts: true,
33 // And restrict the webview to only loading content from our extension's `media` directory.
34 localResourceRoots: [vscode.Uri.file(path.join(extensionPath, 'build'))],
35 // prevents destroying the window when it is in the background
36 retainContextWhenHidden: true,
37 // allows scripts to load external resources (eg. markdown images, fonts)
38 enableCommandUris: true,
39 }
40 state.loaded = true
41 return vscode.window.createWebviewPanel(viewType, title, vscode.ViewColumn.Two, config)
42 }
43
44 let panel: vscode.WebviewPanel = createWebViewPanel()
45

Callers 2

createReactWebViewFunction · 0.85
createOrShowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected