-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Run All Cells makes markdown show up first #3250
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found a bug in line 151 (https://github.com/Microsoft/vscode-python/blob/9525fd74490841f7f105e198c2e789eac9681cea/src/client/datascience/jupyterServer.ts#L151)
public execute(code : string, file: string, line: number) : Promise<ICell[]> {
// Create a deferred that we'll fire when we're done
const deferred = createDeferred<ICell[]>();
// Attempt to evaluate this cell in the jupyter notebook
const observable = this.executeObservable(code, file, line);
let output: ICell[];
observable.subscribe(
(cells: ICell[]) => {
output = cells;
},
(error) => {
deferred.resolve(output);
},
() => {
deferred.resolve(output);
});
// Wait for the execution to finish
return deferred.promise;
}
Shouldn't it be deferred.reject(error);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to change the following code:
// Replace windows line endings with unix line endings.
const copy = code.replace(/\r\n/g, '\n');
// Determine if we have a markdown cell/ markdown and code cell combined/ or just a code cell
const split = copy.split('\n');
to just (making it unnecessary to replace CRLF):
const split = copy.splitlines();
The copy.splitlines doesn't buy me anything because I still need the copy by itself. #Resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create a GitHub issue to create functional tests to ensure we cover this scenario.
@rchiodo Please do remember to create functional tests to cover this scenario (to ensure this doesn't come up again). |
Yep just did: #3257 |
My next task is to add a bunch of functional tests for the history window. I should be able to test this scenario there. |
For #3249 - Run all cells with markdown makes markdown come out first