Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "view as scrollable element" not working #5680

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
21 changes: 18 additions & 3 deletions extensions/positron-notebook-controllers/src/notebookController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ import { JUPYTER_NOTEBOOK_TYPE } from './constants';
import { log } from './extension';
import { ResourceMap } from './map';

/** The type of a Jupyter notebook cell output. */
/**
* The type of a Jupyter notebook cell output.
*
* Used by the ipynb notebook serializer (extensions/ipynb/src/serializers.ts) to convert from
* VSCode notebook cell outputs to Jupyter notebook cell outputs.
*
* See: https://jupyter-client.readthedocs.io/en/latest/messaging.html
*/
enum NotebookCellOutputType {
/** An error occurred during an execution. */
Error = 'error',

/** Output from one of the standard streams (stdout or stderr). */
Stream = 'stream',

/** One of possibly many outputs related to an execution. */
DisplayData = 'display_data',

Expand Down Expand Up @@ -584,7 +597,9 @@ async function handleRuntimeMessageStream(
if (lastOutputItems && lastOutputItems.every(item => item.mime === cellOutputItem.mime)) {
await execution.appendOutputItems([cellOutputItem], lastOutput);
} else {
const cellOutput = new vscode.NotebookCellOutput([cellOutputItem]);
const cellOutput = new vscode.NotebookCellOutput(
[cellOutputItem], { outputType: NotebookCellOutputType.Stream },
);
await execution.appendOutput(cellOutput);
}
}
Expand All @@ -605,6 +620,6 @@ async function handleRuntimeMessageError(
message: message.message,
stack: message.traceback.join('\n'),
})
]);
], { outputType: NotebookCellOutputType.Error });
await execution.appendOutput(cellOutput);
}
Loading