Skip to content

Commit

Permalink
Don't refresh variables on every console execution (#5871) (#5900)
Browse files Browse the repository at this point in the history
Backport of fix for #5813 to the 2025.01 branch.
  • Loading branch information
jmcphers authored Jan 7, 2025
1 parent 2bc1b74 commit b630063
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,20 @@ export class PositronVariablesService extends Disposable implements IPositronVar

const { sessionId } = session;

// No-op if this is already the active instance. Setting the active
// instance below triggers a refresh, so avoid it if if the instance is
// already active.
if (this._activePositronVariablesInstance?.session.sessionId === sessionId) {
return;
}

const positronVariablesInstance = this._positronVariablesInstancesBySessionId.get(
sessionId
);

if (positronVariablesInstance) {
this._setActivePositronVariablesInstance(positronVariablesInstance);
return
return;
}

this._logService.error(`Cannot show Variables: ${formatLanguageRuntimeSession(session)} became active, but a Variables instance for it is not running.`);
Expand Down

0 comments on commit b630063

Please sign in to comment.