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

Function updateGuestPlot

src/liveShare/shareSession.ts:179–211  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

177// to the guest, and read that into an html page
178let panel: vscode.WebviewPanel | undefined = undefined;
179export 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

Callers 1

shareCommands.tsFile · 0.90

Calls 5

readContentFunction · 0.90
asViewColumnFunction · 0.90
configFunction · 0.90
getGuestImageHtmlFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected