Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ export class ExtHostLanguageRuntime implements extHostProtocol.ExtHostLanguageRu
buffers: message.buffers?.map(buffer => VSBuffer.wrap(buffer)),
};

// First check if this message relates to an execution with an observer
if (message.parent_id && this._executionObservers.has(message.parent_id)) {
// Allow empty string parent_id as it may be valid in some cases
if (message.parent_id !== null && this._executionObservers.has(message.parent_id)) {
// Get the observer for this execution
const observer = this._executionObservers.get(message.parent_id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,12 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst
*/
private _externalExecutionIds: Set<string> = new Set<string>();

/**
* Set of execution IDs that are silent executions.
* Silent executions should not be displayed in the console UI.
*/
private _silentExecutionIds: Set<string> = new Set<string>();

/**
* Queue of pending code fragments waiting to be executed.
*/
Expand Down Expand Up @@ -2397,6 +2403,8 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst
this.markInputBusyState(languageRuntimeMessageState.parent_id, false);
// This external execution ID has completed, so we can remove it.
this._externalExecutionIds.delete(languageRuntimeMessageState.parent_id);
// This silent execution ID has completed, so we can remove it.
this._silentExecutionIds.delete(languageRuntimeMessageState.parent_id);
break;
}
}
Expand Down Expand Up @@ -2983,6 +2991,14 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst
return;
}

/**
* If the code execution mode is silent, track the execution ID
* so we can filter its output from the console UI.
*/
if (mode === RuntimeCodeExecutionMode.Silent) {
this._silentExecutionIds.add(id);
}

/**
* If the code execution mode is silent, an ActivityItem for the code fragment
* should not be added to avoid UI side effects from the code execution.
Expand Down Expand Up @@ -3060,6 +3076,11 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst
* @param activityItem The activity item.
*/
private addOrUpdateRuntimeItemActivity(parentId: string, activityItem: ActivityItem) {
// Skip adding runtime items for silent executions to prevent console UI display
if (this._silentExecutionIds.has(parentId)) {
return;
}

// Find the activity runtime item. If it was found, add the activity item to it. If not, add
// a new activity runtime item.
const runtimeItemActivity = this._runtimeItemActivities.get(parentId);
Expand Down
Loading