MCPcopy Create free account
hub / github.com/Marus/cortex-debug / refresh

Method refresh

src/frontend/views/live-watch.ts:444–473  ·  view source on GitHub ↗
(session: vscode.DebugSession, restarTimer = false)

Source from the content-addressed store, hash-verified

442 }
443
444 public refresh(session: vscode.DebugSession, restarTimer = false): void {
445 if (session && this.isSameSession(session)) {
446 const restart = (elapsed: number) => {
447 if (!this.isStopped && restarTimer && LiveWatchTreeProvider.session) {
448 this.startTimer(((elapsed < 0) || (elapsed > this.timeoutMs)) ? 0 : elapsed);
449 }
450 };
451 if (this.variables.getChildren().length === 0) {
452 restart(0);
453 } else {
454 const start = Date.now();
455 // The following will update all the variables in the backend cache in bulk
456 session.customRequest('liveCacheRefresh', {
457 deleteAll: false // Delete gdb-vars?
458 }).then(() => {
459 this.variables.refresh(session).finally(() => {
460 const elapsed = Date.now() - start;
461 // console.log(`Refreshed in ${elapsed} ms`);
462 this.fire();
463 if (elapsed > this.timeoutMs) {
464 console.error('??????? over flow ????');
465 }
466 restart(elapsed);
467 });
468 });
469 }
470 } else {
471 this.fire();
472 }
473 }
474
475 public getTreeItem(element: LiveVariableNode): TreeItem | Promise<TreeItem> {
476 return element?.getTreeItem();

Callers 4

startTimerMethod · 0.95
debugStoppedMethod · 0.95
addWatchExprMethod · 0.95
editNodeMethod · 0.95

Calls 5

isSameSessionMethod · 0.95
fireMethod · 0.95
customRequestMethod · 0.65
getChildrenMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected