Commit 843d595
committed
Always run the worksheet after all changes have been applied
In 23785e6, we moved worksheet.run()
from didSave to willSave since didSave is not called when the document
is not dirty, unfortunately this gives the wrong behavior when the
document _is_ dirty: it means we're going to send a run worksheet
request to the server before the server has seen all the changes to the
document, in particular with multi-line output this means that the
server will see the output with the added empty lines, which means the
line numbers in worksheet/publishOutput will be wrong. To avoid this
issue we now run the worksheet either on willSave or didSave depending
on whether the document is dirty or not.
To reproduce the issue, you can create a worksheet with:
```
val x = """
"""
"hi"
```
in it, then save the document multiple times.1 parent 3f28c07 commit 843d595
1 file changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
338 | 345 | | |
339 | 346 | | |
340 | 347 | | |
341 | | - | |
342 | | - | |
| 348 | + | |
| 349 | + | |
343 | 350 | | |
344 | 351 | | |
345 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
346 | 367 | | |
347 | 368 | | |
348 | 369 | | |
| |||
0 commit comments