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

Function updatePlot

src/session.ts:182–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180}
181
182async function updatePlot() {
183 console.info(`[updatePlot] ${plotFile}`);
184 const lockContent = await fs.readFile(plotLockFile, 'utf8');
185 const newTimeStamp = Number.parseFloat(lockContent);
186 if (newTimeStamp !== plotTimeStamp) {
187 plotTimeStamp = newTimeStamp;
188 if (fs.existsSync(plotFile) && fs.statSync(plotFile).size > 0) {
189 void commands.executeCommand('vscode.open', Uri.file(plotFile), {
190 preserveFocus: true,
191 preview: true,
192 viewColumn: ViewColumn[(config().get<string>('session.viewers.viewColumn.plot') || 'Two') as keyof typeof ViewColumn],
193 });
194 console.info('[updatePlot] Done');
195 if (isLiveShare()) {
196 void rHostService?.notifyPlot(plotFile);
197 }
198 } else {
199 console.info('[updatePlot] File not found');
200 }
201 }
202}
203
204async function updateWorkspace() {
205 console.info(`[updateWorkspace] ${workspaceFile}`);

Callers 1

updateSessionWatcherFunction · 0.70

Calls 4

configFunction · 0.90
isLiveShareFunction · 0.90
notifyPlotMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected