MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / showWebView

Function showWebView

src/session.ts:313–335  ·  view source on GitHub ↗
(file: string, title: string, viewer: string | boolean)

Source from the content-addressed store, hash-verified

311}
312
313export async function showWebView(file: string, title: string, viewer: string | boolean): Promise<void> {
314 console.info(`[showWebView] file: ${file}, viewer: ${viewer.toString()}`);
315 if (viewer === false) {
316 void env.openExternal(Uri.file(file));
317 } else {
318 const dir = path.dirname(file);
319 const webviewDir = extensionContext.asAbsolutePath('html/session/webview/');
320 const panel = window.createWebviewPanel('webview', title,
321 {
322 preserveFocus: true,
323 viewColumn: ViewColumn[String(viewer) as keyof typeof ViewColumn],
324 },
325 {
326 enableScripts: true,
327 enableFindWidget: true,
328 retainContextWhenHidden: true,
329 localResourceRoots: [Uri.file(dir), Uri.file(webviewDir)],
330 });
331 panel.iconPath = new UriIcon('globe');
332 panel.webview.html = await getWebviewHtml(panel.webview, file, title, dir, webviewDir);
333 }
334 console.info('[showWebView] Done');
335}
336
337export async function showDataView(source: string, type: string, title: string, file: string, viewer: string): Promise<void> {
338 console.info(`[showDataView] source: ${source}, type: ${type}, title: ${title}, file: ${file}, viewer: ${viewer}`);

Callers 2

updateGuestRequestFunction · 0.90
updateRequestFunction · 0.85

Calls 2

getWebviewHtmlFunction · 0.85
openExternalMethod · 0.80

Tested by

no test coverage detected