(file: string)
| 177 | // to the guest, and read that into an html page |
| 178 | let panel: vscode.WebviewPanel | undefined = undefined; |
| 179 | export async function updateGuestPlot(file: string): Promise<void> { |
| 180 | const plotContent = await readContent(file, 'base64'); |
| 181 | // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment |
| 182 | |
| 183 | const guestPlotView: vscode.ViewColumn = asViewColumn(config().get<string>('session.viewers.viewColumn.plot'), vscode.ViewColumn.Two); |
| 184 | if (plotContent) { |
| 185 | if (panel) { |
| 186 | panel.webview.html = getGuestImageHtml(plotContent); |
| 187 | panel.reveal(guestPlotView, true); |
| 188 | } else { |
| 189 | panel = vscode.window.createWebviewPanel('dataview', 'R Guest Plot', |
| 190 | { |
| 191 | preserveFocus: true, |
| 192 | viewColumn: guestPlotView, |
| 193 | }, |
| 194 | { |
| 195 | enableScripts: true, |
| 196 | enableFindWidget: true, |
| 197 | retainContextWhenHidden: true, |
| 198 | localResourceRoots: [vscode.Uri.file(guestResDir)], |
| 199 | }); |
| 200 | const content = getGuestImageHtml(plotContent); |
| 201 | panel.webview.html = content; |
| 202 | panel.onDidDispose( |
| 203 | () => { |
| 204 | panel = undefined; |
| 205 | }, |
| 206 | undefined, |
| 207 | extensionContext.subscriptions |
| 208 | ); |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | |
| 214 | // Purely used in order to decode a base64 string into |
no test coverage detected