Repository navigation
clear execution count of all cells when user presses 'Clear All Output' - #8318
Conversation
presses 'Clear All Output'
Codecov Report
@@ Coverage Diff @@
## master #8318 +/- ##
==========================================
- Coverage 59.33% 59.33% -0.01%
==========================================
Files 504 505 +1
Lines 23096 23147 +51
Branches 3737 3745 +8
==========================================
+ Hits 13704 13734 +30
- Misses 8500 8520 +20
- Partials 892 893 +1
Continue to review full report at Codecov.
|
| return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []); | ||
| }); | ||
| newList.forEach(cellVM => { | ||
| cellVM.cell.data.execution_count = null; |
There was a problem hiding this comment.
Didn't Don just add this? Also this would need to use the immutable functions.
There was a problem hiding this comment.
Yeah or make a copy of all of the cells. Something like so:
const newList = this.pendingState.cellVMs.map(cellVM => {
return {...celVM, cell: {...cellVM.cell, data: {...cellVM.cell.data, execution_count: null, outputs: []}}};
})
There was a problem hiding this comment.
Meaning you should set the execution count at the same time you clear the outputs
There was a problem hiding this comment.
Here is the review where don already added this:
https://github.com/microsoft/vscode-python/pull/8315/files
There was a problem hiding this comment.
Didn't Don just add this? Also this would need to use the immutable functions.
Yes & no. I started working on this (forgot to assign to myself). When I went to assign it, David Kutugata (@DavidKutu) had it.
Here is the review where don already added this:
https://github.com/microsoft/vscode-python/pull/8315/files
Oops, used the same branch of code.
Didn't mean to work on it.
There was a problem hiding this comment.
There was a problem hiding this comment.
can you review again?
|
oops |
| return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []); | ||
| }); | ||
| newList.forEach(cellVM => { | ||
| cellVM.cell.data.execution_count = null; |
There was a problem hiding this comment.
Didn't Don just add this? Also this would need to use the immutable functions.
Yes & no. I started working on this (forgot to assign to myself). When I went to assign it, David Kutugata (@DavidKutu) had it.
Here is the review where don already added this:
https://github.com/microsoft/vscode-python/pull/8315/files
Oops, used the same branch of code.
Didn't mean to work on it.
| return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []); | ||
| }); | ||
| newList.forEach(cellVM => { | ||
| cellVM.cell.data.execution_count = null; |
There was a problem hiding this comment.
For #7853
package-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed)