Queue cells on ctrl+shift+enter even when a cells is evaluating (#1334)

This commit is contained in:
Jonatan Kłosko 2022-08-05 22:19:50 +02:00 committed by GitHub
parent 7f4e9273de
commit d24cb8a838
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -1893,6 +1893,8 @@ defmodule Livebook.Session.Data do
evaluable_cell_ids =
for {cell, _} <- evaluable_cells_with_section,
cell_outdated?(data, cell) or cell.id in forced_cell_ids,
info = data.cell_infos[cell.id],
info.eval.status == :ready,
uniq: true,
do: cell.id

View file

@ -3562,6 +3562,20 @@ defmodule Livebook.Session.DataTest do
assert Data.cell_ids_for_full_evaluation(data, ["c2"]) |> Enum.sort() == ["c2", "c3"]
end
test "excludes evaluating and queued cells" do
data =
data_after_operations!([
{:insert_section, @cid, 0, "s1"},
{:insert_cell, @cid, "s1", 0, :code, "c1", %{}},
{:insert_cell, @cid, "s1", 1, :code, "c2", %{}},
{:insert_cell, @cid, "s1", 2, :code, "c3", %{}},
{:set_runtime, @cid, connected_noop_runtime()},
{:queue_cells_evaluation, @cid, ["c1", "c2"]}
])
assert Data.cell_ids_for_full_evaluation(data, []) |> Enum.sort() == ["c3"]
end
end
describe "cell_ids_for_reevaluation/2" do