-
Notifications
You must be signed in to change notification settings - Fork 285
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
No difference in UI between NotebookCellOutputItem.error vs. NotebookCellOutputItem.text #15855
Comments
Yes. There is no hard and fast rule on how you use the API. As for the coloring of outputs, I'll leave that for @rebornix @amunger |
@DonJayamanne Thanks for explaining this.
I also thought I should follow using vscode.NotebookCellOutputItem.error instead of .text but I after trying out both of the API call, I could not really distinguish if there was any user facing difference in UI/output(assuming we were properly calling exec.end(false) or exec.end(true) depending on the output). Hence why I was confused if I really had to use one(.error) over another(.text) depending on success/failure scenario. I do realize that exec.end(false) or exec.end(true) should be called to show appropriate check mark or red X mark so that was intuitive and visibility. Perhaps we are more recommended to use attach error message via result.error rather than result.output as more of style guideline for better readability and organization? As far as the colorization of the output, would there be way can control from the extension side? |
The colors in the error outputs from IPython kernels are provided by IPython using ascii colors, e.g.
produces As far as the different API options, |
When defining the execution handler to register notebook controller from the extension side (Python extension in this specific case), I've noticed there was no difference between the output in terms of the execution message UI or the executing cell itself, of the API NotebookCellOutputItem.error versus using NotebookCellOutputItem.text.
I thought perhaps maybe there would be even a slight difference when there is some sort of failure (other than the red circle that marks the failure of execution), but do not seem to find any obvious differences in terms of the style of the error(I suspected maybe it would handle the coloring of the error output better so that messages are non-white and of red color) output themselves. Would this be a bug?
Is everything just basically dependent for implementer of the execution handler to correctly call exec.end(true or false);
Was reading the API doc and came across
application/vnd.code.notebook.error
mime type, but wasnt too sure what this .error mime type would be.The text was updated successfully, but these errors were encountered: