diff --git a/README.md b/README.md
index 5b3a20e31..cc7ca5a05 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
Livebook is a web application for writing interactive and collaborative code notebooks for Elixir, built with [Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view). It features:
- * Code notebooks with Markdown support and Elixir cells where code is evaluated on demand.
+ * Code notebooks with Markdown support and Code cells where Elixir code is evaluated on demand.
* Shareable: notebooks are stored in the `.livemd` format, which is a subset of Markdown with support for diagrams via [Mermaid](https://mermaid-js.github.io/mermaid) and for mathematical formulas via [KaTex](https://katex.org/). `.livemd` files can be easily shared and play well with version control.
diff --git a/assets/js/cell/index.js b/assets/js/cell/index.js
index e9738908a..50d8678b1 100644
--- a/assets/js/cell/index.js
+++ b/assets/js/cell/index.js
@@ -24,14 +24,14 @@ const Cell = {
this.state = {
isFocused: false,
insertMode: false,
- // For text cells (markdown or elixir)
+ // For text cells (markdown or code)
liveEditor: null,
markdown: null,
evaluationDigest: null,
};
// Setup action handlers
- if (this.props.type === "elixir") {
+ if (this.props.type === "code") {
const amplifyButton = this.el.querySelector(
`[data-element="amplify-outputs-button"]`
);
@@ -74,7 +74,7 @@ const Cell = {
// Setup the editor instance.
const language = {
markdown: "markdown",
- elixir: "elixir",
+ code: "elixir",
smart: "elixir",
}[this.props.type];
const readOnly = this.props.type === "smart";
diff --git a/assets/js/lib/notebook.js b/assets/js/lib/notebook.js
index a15c2ca8a..72ab085f1 100644
--- a/assets/js/lib/notebook.js
+++ b/assets/js/lib/notebook.js
@@ -2,12 +2,12 @@
* Checks if the given cell type is eligible for evaluation.
*/
export function isEvaluable(cellType) {
- return ["elixir", "smart"].includes(cellType);
+ return ["code", "smart"].includes(cellType);
}
/**
* Checks if the given cell type has editable editor.
*/
export function isDirectlyEditable(cellType) {
- return ["markdown", "elixir"].includes(cellType);
+ return ["markdown", "code"].includes(cellType);
}
diff --git a/assets/js/session/index.js b/assets/js/session/index.js
index 5cd776760..844bf7ae5 100644
--- a/assets/js/session/index.js
+++ b/assets/js/session/index.js
@@ -396,9 +396,9 @@ function handleDocumentKeyDown(hook, event) {
} else if (keyBuffer.tryMatch(["K"])) {
moveFocusedCell(hook, -1);
} else if (keyBuffer.tryMatch(["n"])) {
- insertCellBelowFocused(hook, "elixir");
+ insertCellBelowFocused(hook, "code");
} else if (keyBuffer.tryMatch(["N"])) {
- insertCellAboveFocused(hook, "elixir");
+ insertCellAboveFocused(hook, "code");
} else if (keyBuffer.tryMatch(["m"])) {
insertCellBelowFocused(hook, "markdown");
} else if (keyBuffer.tryMatch(["M"])) {
diff --git a/lib/livebook/live_markdown.ex b/lib/livebook/live_markdown.ex
index 7a0231bbb..1fa80f471 100644
--- a/lib/livebook/live_markdown.ex
+++ b/lib/livebook/live_markdown.ex
@@ -16,7 +16,7 @@ defmodule Livebook.LiveMarkdown do
#
# 2. Every *Heading 2* starts a new section
#
- # 3. Every Elixir code block maps to an Elixir cell
+ # 3. Every Elixir code block maps to a Code cell
#
# 4. Adjacent regular Markdown text maps to a Markdown cell
#
@@ -31,7 +31,7 @@ defmodule Livebook.LiveMarkdown do
#
# - `{"force_markdown":true}` - an annotation forcing the next Markdown
# block to be treated as part of Markdown cell (relevant for Elixir code
- # blocks, which otherwise are interpreted as Elixir cells)
+ # blocks, which otherwise are interpreted as Code cells)
#
# - `{"break_markdown":true}` - an annotation splitting the markdown content
# into separate Markdown cells
@@ -73,7 +73,7 @@ defmodule Livebook.LiveMarkdown do
# ```
#
# This file defines a notebook named *My Notebook* with two sections.
- # The first section includes 3 cells and the second section includes 1 Elixir cell.
+ # The first section includes 3 cells and the second section includes 1 Code cell.
@doc """
The file extension used by Live Markdown files.
diff --git a/lib/livebook/live_markdown/export.ex b/lib/livebook/live_markdown/export.ex
index 32b9ea9b8..437ab9fbd 100644
--- a/lib/livebook/live_markdown/export.ex
+++ b/lib/livebook/live_markdown/export.ex
@@ -111,9 +111,9 @@ defmodule Livebook.LiveMarkdown.Export do
|> prepend_metadata(metadata)
end
- defp render_cell(%Cell.Elixir{} = cell, ctx) do
+ defp render_cell(%Cell.Code{} = cell, ctx) do
delimiter = MarkdownHelpers.code_block_delimiter(cell.source)
- code = get_elixir_cell_code(cell)
+ code = get_code_cell_code(cell)
outputs = if ctx.include_outputs?, do: render_outputs(cell, ctx), else: []
metadata = cell_metadata(cell)
@@ -130,7 +130,7 @@ defmodule Livebook.LiveMarkdown.Export do
end
defp render_cell(%Cell.Smart{} = cell, ctx) do
- %{Cell.Elixir.new() | source: cell.source, outputs: cell.outputs}
+ %{Cell.Code.new() | source: cell.source, outputs: cell.outputs}
|> render_cell(ctx)
|> prepend_metadata(%{
"livebook_object" => "smart_cell",
@@ -139,11 +139,11 @@ defmodule Livebook.LiveMarkdown.Export do
})
end
- defp cell_metadata(%Cell.Elixir{} = cell) do
+ defp cell_metadata(%Cell.Code{} = cell) do
put_unless_default(
%{},
Map.take(cell, [:disable_formatting, :reevaluate_automatically]),
- Map.take(Cell.Elixir.new(), [:disable_formatting, :reevaluate_automatically])
+ Map.take(Cell.Code.new(), [:disable_formatting, :reevaluate_automatically])
)
end
@@ -199,10 +199,10 @@ defmodule Livebook.LiveMarkdown.Export do
defp encode_js_data(data) when is_binary(data), do: {:ok, data}
defp encode_js_data(data), do: Jason.encode(data)
- defp get_elixir_cell_code(%{source: source, disable_formatting: true}),
+ defp get_code_cell_code(%{source: source, disable_formatting: true}),
do: source
- defp get_elixir_cell_code(%{source: source}), do: format_code(source)
+ defp get_code_cell_code(%{source: source}), do: format_code(source)
defp render_metadata(metadata) do
metadata_json = Jason.encode!(metadata)
diff --git a/lib/livebook/live_markdown/import.ex b/lib/livebook/live_markdown/import.ex
index 13bb1d167..f9986b0c8 100644
--- a/lib/livebook/live_markdown/import.ex
+++ b/lib/livebook/live_markdown/import.ex
@@ -150,7 +150,7 @@ defmodule Livebook.LiveMarkdown.Import do
elems
) do
{outputs, ast} = take_outputs(ast, [])
- group_elements(ast, [{:cell, :elixir, source, outputs} | elems])
+ group_elements(ast, [{:cell, :code, source, outputs} | elems])
end
defp group_elements([ast_node | ast], [{:cell, :markdown, md_ast} | rest]) do
@@ -218,7 +218,7 @@ defmodule Livebook.LiveMarkdown.Import do
end
defp build_notebook(
- [{:cell, :elixir, source, outputs}, {:cell, :smart, data} | elems],
+ [{:cell, :code, source, outputs}, {:cell, :smart, data} | elems],
cells,
sections,
messages,
@@ -239,16 +239,16 @@ defmodule Livebook.LiveMarkdown.Import do
end
defp build_notebook(
- [{:cell, :elixir, source, outputs} | elems],
+ [{:cell, :code, source, outputs} | elems],
cells,
sections,
messages,
output_counter
) do
{metadata, elems} = grab_metadata(elems)
- attrs = cell_metadata_to_attrs(:elixir, metadata)
+ attrs = cell_metadata_to_attrs(:code, metadata)
{outputs, output_counter} = Notebook.index_outputs(outputs, output_counter)
- cell = %{Notebook.Cell.new(:elixir) | source: source, outputs: outputs} |> Map.merge(attrs)
+ cell = %{Notebook.Cell.new(:code) | source: source, outputs: outputs} |> Map.merge(attrs)
build_notebook(elems, [cell | cells], sections, messages, output_counter)
end
@@ -392,7 +392,7 @@ defmodule Livebook.LiveMarkdown.Import do
end)
end
- defp cell_metadata_to_attrs(:elixir, metadata) do
+ defp cell_metadata_to_attrs(:code, metadata) do
Enum.reduce(metadata, %{}, fn
{"disable_formatting", disable_formatting}, attrs ->
Map.put(attrs, :disable_formatting, disable_formatting)
diff --git a/lib/livebook/notebook/cell.ex b/lib/livebook/notebook/cell.ex
index 576bf4b01..621623297 100644
--- a/lib/livebook/notebook/cell.ex
+++ b/lib/livebook/notebook/cell.ex
@@ -12,9 +12,9 @@ defmodule Livebook.Notebook.Cell do
@type id :: Utils.id()
- @type t :: Cell.Markdown.t() | Cell.Elixir.t() | Cell.Smart.t()
+ @type t :: Cell.Markdown.t() | Cell.Code.t() | Cell.Smart.t()
- @type type :: :markdown | :elixir | :smart
+ @type type :: :markdown | :code | :smart
@type indexed_output :: {non_neg_integer(), Livebook.Runtime.output()}
@@ -25,7 +25,7 @@ defmodule Livebook.Notebook.Cell do
def new(type)
def new(:markdown), do: Cell.Markdown.new()
- def new(:elixir), do: Cell.Elixir.new()
+ def new(:code), do: Cell.Code.new()
def new(:smart), do: Cell.Smart.new()
@doc """
@@ -34,7 +34,7 @@ defmodule Livebook.Notebook.Cell do
@spec type(t()) :: type()
def type(cell)
- def type(%Cell.Elixir{}), do: :elixir
+ def type(%Cell.Code{}), do: :code
def type(%Cell.Markdown{}), do: :markdown
def type(%Cell.Smart{}), do: :smart
@@ -44,7 +44,7 @@ defmodule Livebook.Notebook.Cell do
@spec evaluable?(t()) :: boolean()
def evaluable?(cell)
- def evaluable?(%Cell.Elixir{}), do: true
+ def evaluable?(%Cell.Code{}), do: true
def evaluable?(%Cell.Smart{}), do: true
def evaluable?(_cell), do: false
diff --git a/lib/livebook/notebook/cell/elixir.ex b/lib/livebook/notebook/cell/code.ex
similarity index 94%
rename from lib/livebook/notebook/cell/elixir.ex
rename to lib/livebook/notebook/cell/code.ex
index eb903530e..2efbd352b 100644
--- a/lib/livebook/notebook/cell/elixir.ex
+++ b/lib/livebook/notebook/cell/code.ex
@@ -1,4 +1,4 @@
-defmodule Livebook.Notebook.Cell.Elixir do
+defmodule Livebook.Notebook.Cell.Code do
@moduledoc false
# A cell with Elixir code.
diff --git a/lib/livebook/notebook/explore/elixir_and_livebook.livemd b/lib/livebook/notebook/explore/elixir_and_livebook.livemd
index f4b6f2f6f..6b228772c 100644
--- a/lib/livebook/notebook/explore/elixir_and_livebook.livemd
+++ b/lib/livebook/notebook/explore/elixir_and_livebook.livemd
@@ -146,7 +146,7 @@ Process.exit(self(), :kill)
## Evaluation vs compilation
-Livebook automatically shows the execution time of each Elixir
+Livebook automatically shows the execution time of each Code
cell on the bottom-right of the cell. After evaluation, the total
time can be seen by hovering the green dot.
diff --git a/lib/livebook/notebook/explore/intro_to_livebook.livemd b/lib/livebook/notebook/explore/intro_to_livebook.livemd
index 3bff2f34c..fb3b6034b 100644
--- a/lib/livebook/notebook/explore/intro_to_livebook.livemd
+++ b/lib/livebook/notebook/explore/intro_to_livebook.livemd
@@ -18,12 +18,12 @@ and run them locally.
Each notebook consists of a number of cells, which serve as primary building blocks.
There are **Markdown** cells (such as this one) that allow you to describe your work
-and **Elixir** cells to run your code!
+and **Code** cells to run your Elixir code!
To insert a new cell move your cursor between cells and click one of the revealed buttons. 👇
```elixir
-# This is an Elixir cell - as the name suggests that's where the code goes.
+# This is a Code cell - as the name suggests that's where the code goes.
# To evaluate this cell, you can either press the "Evaluate" button above
# or use `Ctrl + Enter` (or Cmd + Enter on a Mac)!
@@ -83,7 +83,7 @@ suited for running long computations "in background".
Process.sleep(300_000)
```
-Having this cell running, feel free to insert another Elixir cell
+Having this cell running, feel free to insert another Code cell
in the section below and see it evaluates immediately.
## Saving notebooks
diff --git a/lib/livebook/notebook/explore/intro_to_nx.livemd b/lib/livebook/notebook/explore/intro_to_nx.livemd
index 0bcb1c9c7..e6f10b746 100644
--- a/lib/livebook/notebook/explore/intro_to_nx.livemd
+++ b/lib/livebook/notebook/explore/intro_to_nx.livemd
@@ -205,7 +205,7 @@ shape of a tensor using the tensor's API instead of the struct).
Primarily, a tensor is a struct, and the
functions to access it go through a specific backend. We'll get to
the backend details in a moment. For now, use the IEx `h` helper
-to get more documentation about tensors. We could also open an Elixir
+to get more documentation about tensors. We could also open a Code
cell, type Nx.tensor, and hover the cursor over the word `tensor`
to see the help about that function.
@@ -520,8 +520,8 @@ our code within a `defn` block.
To use Nx in a Mix project or a notebook, we need to include
the `:nx` dependency and import the `Nx.Defn` module. The
-dependency is already included, so import it in an Elixir
-cell, like this:
+dependency is already included, so import it in a Code cell,
+like this:
```elixir
import Nx.Defn
@@ -572,7 +572,7 @@ Now, it's your turn. Add a `defn` to `TensorMath`
that accepts two tensors representing the lengths of sides of a
right triangle and uses the pythagorean theorem to return the
[length of the hypotenuse](https://www.mathsisfun.com/pythagoras.html).
-Add your function directly to the previous Elixir cell.
+Add your function directly to the previous Code cell.
The last major feature we'll cover is called auto-differentiation, or autograd.
diff --git a/lib/livebook/notebook/explore/kino/chat_app.livemd b/lib/livebook/notebook/explore/kino/chat_app.livemd
index 5aded66a4..fb6cad7fd 100644
--- a/lib/livebook/notebook/explore/kino/chat_app.livemd
+++ b/lib/livebook/notebook/explore/kino/chat_app.livemd
@@ -106,7 +106,7 @@ this particular section as a branched section, which means
the main execution flow will not be interrupted. But it
is something you should keep in mind in the future. You
can also stop it by pressing the "Stop" button above the
-Elixir cell.
+Code cell.
diff --git a/lib/livebook/notebook/explore/kino/intro_to_kino.livemd b/lib/livebook/notebook/explore/kino/intro_to_kino.livemd
index e46687da7..f4ecd35b6 100644
--- a/lib/livebook/notebook/explore/kino/intro_to_kino.livemd
+++ b/lib/livebook/notebook/explore/kino/intro_to_kino.livemd
@@ -42,7 +42,7 @@ color dialogs, selects, and more. Feel free to explore them.
Given our notebooks already know how to render Markdown,
you won't be surprised to find we can also render Markdown
-directly from our Elixir cells. This is done by wrapping
+directly from our Code cells. This is done by wrapping
the Markdown contents in [`Kino.Markdown.new/1`](https://hexdocs.pm/kino/Kino.Markdown.html):
````elixir
diff --git a/lib/livebook/notebook/export/elixir.ex b/lib/livebook/notebook/export/elixir.ex
index 8e7df8aea..11a0516b3 100644
--- a/lib/livebook/notebook/export/elixir.ex
+++ b/lib/livebook/notebook/export/elixir.ex
@@ -47,8 +47,8 @@ defmodule Livebook.Notebook.Export.Elixir do
|> Enum.map_intersperse("\n", &comment_out/1)
end
- defp render_cell(%Cell.Elixir{} = cell, section) do
- code = get_elixir_cell_code(cell)
+ defp render_cell(%Cell.Code{} = cell, section) do
+ code = get_code_cell_code(cell)
if section.parent_id do
code
@@ -61,7 +61,7 @@ defmodule Livebook.Notebook.Export.Elixir do
end
defp render_cell(%Cell.Smart{} = cell, ctx) do
- render_cell(%{Cell.Elixir.new() | source: cell.source}, ctx)
+ render_cell(%{Cell.Code.new() | source: cell.source}, ctx)
end
defp render_cell(_cell, _section), do: []
@@ -69,10 +69,10 @@ defmodule Livebook.Notebook.Export.Elixir do
defp comment_out(""), do: ""
defp comment_out(line), do: ["# ", line]
- defp get_elixir_cell_code(%{source: source, disable_formatting: true}),
+ defp get_code_cell_code(%{source: source, disable_formatting: true}),
do: source
- defp get_elixir_cell_code(%{source: source}), do: format_code(source)
+ defp get_code_cell_code(%{source: source}), do: format_code(source)
defp format_code(code) do
try do
diff --git a/lib/livebook/session.ex b/lib/livebook/session.ex
index 0ae5e0cae..544d76593 100644
--- a/lib/livebook/session.ex
+++ b/lib/livebook/session.ex
@@ -550,7 +550,7 @@ defmodule Livebook.Session do
end
defp default_notebook() do
- %{Notebook.new() | sections: [%{Section.new() | cells: [Cell.new(:elixir)]}]}
+ %{Notebook.new() | sections: [%{Section.new() | cells: [Cell.new(:code)]}]}
end
defp schedule_autosave(state) do
@@ -707,7 +707,7 @@ defmodule Livebook.Session do
state
|> handle_operation({:delete_cell, client_pid, cell.id})
|> handle_operation(
- {:insert_cell, client_pid, section.id, index, :elixir, Utils.random_id(), attrs}
+ {:insert_cell, client_pid, section.id, index, :code, Utils.random_id(), attrs}
)
else
_ -> state
diff --git a/lib/livebook/session/data.ex b/lib/livebook/session/data.ex
index b57e8ec3c..0bbc8ff16 100644
--- a/lib/livebook/session/data.ex
+++ b/lib/livebook/session/data.ex
@@ -58,13 +58,13 @@ defmodule Livebook.Session.Data do
evaluation_queue: list(Cell.id())
}
- @type cell_info :: markdown_cell_info() | elixir_cell_info() | smart_cell_info()
+ @type cell_info :: markdown_cell_info() | code_cell_info() | smart_cell_info()
@type markdown_cell_info :: %{
source: cell_source_info()
}
- @type elixir_cell_info :: %{
+ @type code_cell_info :: %{
source: cell_source_info(),
eval: cell_eval_info()
}
@@ -159,7 +159,7 @@ defmodule Livebook.Session.Data do
| {:evaluation_started, pid(), Cell.id(), binary()}
| {:add_cell_evaluation_output, pid(), Cell.id(), term()}
| {:add_cell_evaluation_response, pid(), Cell.id(), term(), metadata :: map()}
- | {:bind_input, pid(), elixir_cell_id :: Cell.id(), input_id()}
+ | {:bind_input, pid(), code_cell_id :: Cell.id(), input_id()}
| {:reflect_main_evaluation_failure, pid()}
| {:reflect_evaluation_failure, pid(), Section.id()}
| {:cancel_cell_evaluation, pid(), Cell.id()}
@@ -1466,7 +1466,7 @@ defmodule Livebook.Session.Data do
}
end
- defp new_cell_info(%Cell.Elixir{}, clients_map) do
+ defp new_cell_info(%Cell.Code{}, clients_map) do
%{
source: new_source_info(clients_map),
eval: new_eval_info()
diff --git a/lib/livebook_web/live/session_live.ex b/lib/livebook_web/live/session_live.ex
index c3f99f77b..1bb1e86e8 100644
--- a/lib/livebook_web/live/session_live.ex
+++ b/lib/livebook_web/live/session_live.ex
@@ -527,8 +527,8 @@ defmodule LivebookWeb.SessionLive do
"""
end
- defp settings_component_for(%Cell.Elixir{}),
- do: LivebookWeb.SessionLive.ElixirCellSettingsComponent
+ defp settings_component_for(%Cell.Code{}),
+ do: LivebookWeb.SessionLive.CodeCellSettingsComponent
defp branching_tooltip_attrs(name, parent_name) do
direction = if String.length(name) >= 16, do: "left", else: "right"
@@ -1258,7 +1258,7 @@ defmodule LivebookWeb.SessionLive do
end
defp cell_type_and_attrs_from_params(%{"type" => "markdown"}), do: {:markdown, %{}}
- defp cell_type_and_attrs_from_params(%{"type" => "elixir"}), do: {:elixir, %{}}
+ defp cell_type_and_attrs_from_params(%{"type" => "code"}), do: {:code, %{}}
defp cell_type_and_attrs_from_params(%{"type" => "smart", "kind" => kind}) do
{:smart, %{kind: kind}}
@@ -1420,12 +1420,12 @@ defmodule LivebookWeb.SessionLive do
}
end
- defp cell_to_view(%Cell.Elixir{} = cell, data) do
+ defp cell_to_view(%Cell.Code{} = cell, data) do
info = data.cell_infos[cell.id]
%{
id: cell.id,
- type: :elixir,
+ type: :code,
source_view: cell_source_view(cell, info),
eval: eval_info_to_view(cell, info.eval, data),
reevaluate_automatically: cell.reevaluate_automatically
diff --git a/lib/livebook_web/live/session_live/bin_component.ex b/lib/livebook_web/live/session_live/bin_component.ex
index 747d4adf6..7aed959a3 100644
--- a/lib/livebook_web/live/session_live/bin_component.ex
+++ b/lib/livebook_web/live/session_live/bin_component.ex
@@ -123,7 +123,7 @@ defmodule LivebookWeb.SessionLive.BinComponent do
"""
end
- defp cell_icon(%{cell_type: :elixir} = assigns) do
+ defp cell_icon(%{cell_type: :code} = assigns) do
~H"""
@@ -159,7 +159,7 @@ defmodule LivebookWeb.SessionLive.BinComponent do
end
defp cell_language(%Cell.Markdown{}), do: "markdown"
- defp cell_language(%Cell.Elixir{}), do: "elixir"
+ defp cell_language(%Cell.Code{}), do: "elixir"
defp cell_language(%Cell.Smart{}), do: "elixir"
defp format_date_relatively(date) do
diff --git a/lib/livebook_web/live/session_live/cell_component.ex b/lib/livebook_web/live/session_live/cell_component.ex
index 071b424eb..d0d17b854 100644
--- a/lib/livebook_web/live/session_live/cell_component.ex
+++ b/lib/livebook_web/live/session_live/cell_component.ex
@@ -66,7 +66,7 @@ defmodule LivebookWeb.SessionLive.CellComponent do
"""
end
- defp render_cell(%{cell_view: %{type: :elixir}} = assigns) do
+ defp render_cell(%{cell_view: %{type: :code}} = assigns) do
~H"""
<.cell_actions>
<:primary>
@@ -268,7 +268,7 @@ defmodule LivebookWeb.SessionLive.CellComponent do
defp convert_smart_cell_button(assigns) do
~H"""
-
+
+ Markdown
+ Elixir
+ >+ Code
_}
@@ -415,7 +415,7 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 0, "s1"}
])
- operation = {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ operation = {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
assert {:ok,
%{
@@ -480,7 +480,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:delete_section, self(), "s1", false}
@@ -491,9 +491,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}}
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}}
])
operation = {:delete_section, self(), "s2", false}
@@ -511,9 +511,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta},
@@ -545,9 +545,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
# Evaluate both cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
@@ -567,11 +567,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:set_section_parent, self(), "s2", "s1"},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -597,11 +597,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:set_section_parent, self(), "s2", "s1"},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -647,8 +647,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -666,7 +666,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:delete_cell, self(), "c1"}
@@ -694,8 +694,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -712,8 +712,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
# Evaluate both cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
@@ -733,8 +733,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_cell_attributes, self(), "c2", %{reevaluate_automatically: true}},
# Evaluate both cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -756,8 +756,8 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:insert_section, self(), 0, "s1"},
{:insert_cell, self(), "s1", 0, :markdown, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- # Evaluate the elixir cell
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ # Evaluate the Code cell
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c2"]},
{:add_cell_evaluation_response, self(), "c2", @eval_resp, @eval_meta}
@@ -775,7 +775,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -809,7 +809,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:restore_cell, self(), "c1"}
@@ -820,7 +820,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:delete_section, self(), "s1", true}
])
@@ -832,9 +832,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:delete_cell, self(), "c2"}
])
@@ -854,9 +854,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:delete_section, self(), "s1", true}
])
@@ -900,7 +900,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:move_cell, self(), "c1", 0}
@@ -912,10 +912,10 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:insert_section, self(), 0, "s1"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
- {:insert_cell, self(), "s1", 3, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
+ {:insert_cell, self(), "s1", 3, :code, "c4", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
@@ -950,10 +950,10 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:insert_section, self(), 0, "s1"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
- {:insert_cell, self(), "s1", 3, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
+ {:insert_cell, self(), "s1", 3, :code, "c4", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
@@ -989,10 +989,10 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 0, "s1"},
{:insert_section, self(), 1, "s2"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c4", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c4", %{}}
])
operation = {:move_cell, self(), "c2", 1}
@@ -1012,10 +1012,10 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
@@ -1037,9 +1037,9 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:insert_section, self(), 0, "s1"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_cell, self(), "s1", 1, :markdown, "c2", %{}},
- # Evaluate the Elixir cell
+ # Evaluate the Code cell
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -1060,9 +1060,9 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:insert_section, self(), 0, "s1"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- # Evaluate the Elixir cell
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ # Evaluate the Code cell
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -1077,14 +1077,14 @@ defmodule Livebook.Session.DataTest do
}, []} = Data.apply_operation(data, operation)
end
- test "does not invalidate the moved cell if the order of Elixir cells stays the same" do
+ test "does not invalidate the moved cell if the order of Code cells stays the same" do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_cell, self(), "s1", 1, :markdown, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c3"]},
@@ -1107,12 +1107,12 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c3", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c4", %{}},
{:set_section_parent, self(), "s2", "s1"},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -1140,14 +1140,14 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c3", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c4", %{}},
{:insert_section, self(), 3, "s4"},
- {:insert_cell, self(), "s4", 0, :elixir, "c5", %{}},
+ {:insert_cell, self(), "s4", 0, :code, "c5", %{}},
{:set_section_parent, self(), "s3", "s2"},
{:set_section_parent, self(), "s4", "s1"},
# Evaluate cells
@@ -1181,9 +1181,9 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:insert_section, self(), 0, "s1"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
@@ -1223,10 +1223,10 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 0, "s1"},
{:insert_section, self(), 1, "s2"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c4", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
@@ -1265,10 +1265,10 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 0, "s1"},
{:insert_section, self(), 1, "s2"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c4", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
@@ -1308,9 +1308,9 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 1, "s2"},
{:insert_section, self(), 2, "s3"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
@@ -1333,9 +1333,9 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 0, "s1"},
{:insert_section, self(), 1, "s2"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_cell, self(), "s2", 0, :markdown, "c2", %{}},
- # Evaluate the Elixir cell
+ # Evaluate the Code cell
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -1357,9 +1357,9 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 0, "s1"},
{:insert_section, self(), 1, "s2"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- # Evaluate the Elixir cell
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ # Evaluate the Code cell
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -1374,7 +1374,7 @@ defmodule Livebook.Session.DataTest do
}, []} = Data.apply_operation(data, operation)
end
- test "does not invalidate cells in moved section if the order of Elixir cells stays the same" do
+ test "does not invalidate cells in moved section if the order of Code cells stays the same" do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
@@ -1382,9 +1382,9 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 2, "s3"},
{:insert_section, self(), 3, "s4"},
# Add cells
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_cell, self(), "s2", 0, :markdown, "c2", %{}},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:insert_cell, self(), "s4", 0, :markdown, "c4", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -1408,13 +1408,13 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:insert_section, self(), 3, "s4"},
- {:insert_cell, self(), "s4", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s4", 0, :code, "c4", %{}},
{:set_section_parent, self(), "s2", "s1"},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -1482,7 +1482,7 @@ defmodule Livebook.Session.DataTest do
assert :error = Data.apply_operation(data, operation)
end
- test "returns an error given non-elixir cell" do
+ test "returns an error given non-Code cell" do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
@@ -1497,7 +1497,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1510,7 +1510,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:queue_cells_evaluation, self(), ["c1"]}
@@ -1526,8 +1526,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1549,7 +1549,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()}
])
@@ -1566,7 +1566,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()}
])
@@ -1580,8 +1580,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1599,9 +1599,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1622,11 +1622,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c4", %{}},
# Evaluate first 2 cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
@@ -1669,11 +1669,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:set_section_parent, self(), "s3", "s1"},
{:set_runtime, self(), NoopRuntime.new()}
])
@@ -1701,11 +1701,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c3"]},
@@ -1731,9 +1731,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
@@ -1755,12 +1755,12 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c3", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c4", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c4"]},
@@ -1787,11 +1787,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
@@ -1813,7 +1813,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1836,7 +1836,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
@@ -1860,7 +1860,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -1884,7 +1884,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:set_notebook_attributes, self(), %{persist_outputs: true}},
@@ -1902,7 +1902,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1926,7 +1926,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -1944,8 +1944,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
# Evaluate the first cell
{:queue_cells_evaluation, self(), ["c1"]},
@@ -1968,8 +1968,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -1989,9 +1989,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -2014,10 +2014,10 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
# Evaluate all cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
@@ -2043,13 +2043,13 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c3", %{}},
{:insert_section, self(), 3, "s4"},
- {:insert_cell, self(), "s4", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s4", 0, :code, "c4", %{}},
{:set_section_parent, self(), "s3", "s2"},
{:set_section_parent, self(), "s4", "s1"},
# Evaluate cells
@@ -2082,9 +2082,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:set_cell_attributes, self(), "c3", %{reevaluate_automatically: true}},
# Evaluate all cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -2111,8 +2111,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_cell_attributes, self(), "c2", %{reevaluate_automatically: true}},
# Evaluate all cells
{:set_runtime, self(), NoopRuntime.new()},
@@ -2136,13 +2136,13 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
{:add_cell_evaluation_response, self(), "c2", @eval_resp, @eval_meta},
- # Make the Elixir cell evaluating
+ # Make the Code cell evaluating
{:queue_cells_evaluation, self(), ["c2"]},
# Bind the input (effectively read the current value)
{:bind_input, self(), "c2", "i1"},
@@ -2164,7 +2164,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -2186,7 +2186,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:set_notebook_attributes, self(), %{persist_outputs: true}},
@@ -2205,7 +2205,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -2221,7 +2221,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -2241,7 +2241,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -2263,8 +2263,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -2289,8 +2289,8 @@ defmodule Livebook.Session.DataTest do
{:insert_section, self(), 2, "s3"},
{:set_section_parent, self(), "s2", "s1"},
{:set_section_parent, self(), "s3", "s1"},
- {:insert_cell, self(), "s2", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s3", 0, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -2311,7 +2311,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:bind_input, self(), "c1", "nonexistent"}
@@ -2322,22 +2322,22 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}}
])
operation = {:bind_input, self(), "c2", "c1"}
assert :error = Data.apply_operation(data, operation)
end
- test "updates elixir cell info with binding to the input cell" do
+ test "updates Code cell info with binding to the input cell" do
input = %{id: "i1", type: :text, label: "Text", default: "hey"}
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -2362,9 +2362,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -2389,10 +2389,10 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c3", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
@@ -2422,12 +2422,12 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c3", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c4", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
@@ -2465,7 +2465,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -2479,10 +2479,10 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta}
@@ -2508,8 +2508,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -2524,12 +2524,12 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c2", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c2", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c3", %{}},
{:insert_section, self(), 2, "s3"},
- {:insert_cell, self(), "s3", 0, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s3", 0, :code, "c4", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
@@ -2558,8 +2558,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]}
])
@@ -2579,9 +2579,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]}
])
@@ -2685,10 +2685,10 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
{:set_section_parent, self(), "s2", "s1"},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
@@ -2711,13 +2711,13 @@ defmodule Livebook.Session.DataTest do
}, _actions} = Data.apply_operation(data, operation)
end
- test "removes elixir cell outputs" do
+ test "removes Code cell outputs" do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:insert_cell, self(), "s1", 1, :markdown, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c3"]},
{:add_cell_evaluation_response, self(), "c1", @eval_resp, @eval_meta},
@@ -2808,7 +2808,7 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:client_join, client1_pid, user},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:apply_cell_delta, client1_pid, "c1", delta1, 1}
])
@@ -2881,7 +2881,7 @@ defmodule Livebook.Session.DataTest do
{:client_join, client1_pid, User.new()},
{:client_join, client2_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:apply_cell_delta, client1_pid, "c1", delta1, 1}
])
@@ -2937,7 +2937,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
delta = Delta.new() |> Delta.insert("cats")
@@ -2950,7 +2950,7 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:client_join, self(), User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
delta = Delta.new() |> Delta.insert("cats")
@@ -2964,7 +2964,7 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:client_join, self(), User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
delta = Delta.new() |> Delta.insert("cats")
@@ -2992,7 +2992,7 @@ defmodule Livebook.Session.DataTest do
{:client_join, client1_pid, User.new()},
{:client_join, client2_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:apply_cell_delta, client1_pid, "c1", delta1, 1}
])
@@ -3021,7 +3021,7 @@ defmodule Livebook.Session.DataTest do
{:client_join, client1_pid, User.new()},
{:client_join, client2_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:apply_cell_delta, client1_pid, "c1", delta1, 1}
])
@@ -3041,7 +3041,7 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:client_join, client_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
delta = Delta.new() |> Delta.insert("cats")
@@ -3062,7 +3062,7 @@ defmodule Livebook.Session.DataTest do
{:client_join, client1_pid, User.new()},
{:client_join, client2_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
delta = Delta.new() |> Delta.insert("cats")
@@ -3094,7 +3094,7 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:client_join, client1_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:apply_cell_delta, client1_pid, "c1", Delta.new(insert: "cats"), 1}
])
@@ -3107,7 +3107,7 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
{:client_join, self(), User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
operation = {:report_cell_revision, self(), "c1", 1}
@@ -3125,7 +3125,7 @@ defmodule Livebook.Session.DataTest do
{:client_join, client1_pid, User.new()},
{:client_join, client2_pid, User.new()},
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:apply_cell_delta, client1_pid, "c1", delta1, 1}
])
@@ -3157,7 +3157,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
attrs = %{unknown: :value}
@@ -3170,7 +3170,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}}
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}}
])
attrs = %{disable_formatting: true, reevaluate_automatically: true}
@@ -3190,8 +3190,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
# Evaluate cells
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
@@ -3228,7 +3228,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta}
@@ -3245,11 +3245,11 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
# Insert three evaluated cells and bind the second one to the input
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
- {:insert_cell, self(), "s1", 3, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
+ {:insert_cell, self(), "s1", 3, :code, "c4", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3", "c4"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -3287,14 +3287,14 @@ defmodule Livebook.Session.DataTest do
data_after_operations!([
# First section with evaluating and queued cells
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
# Second section with evaluating and queued cells
{:insert_section, self(), 1, "s2"},
- {:insert_cell, self(), "s2", 0, :elixir, "c3", %{}},
- {:insert_cell, self(), "s2", 1, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s2", 0, :code, "c3", %{}},
+ {:insert_cell, self(), "s2", 1, :code, "c4", %{}},
{:queue_cells_evaluation, self(), ["c3", "c4"]}
])
@@ -3320,7 +3320,7 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
{:queue_cells_evaluation, self(), ["c1"]}
])
@@ -3399,16 +3399,16 @@ defmodule Livebook.Session.DataTest do
assert [] = Data.bound_cells_with_section(data, "nonexistent")
end
- test "returns elixir cells bound to the given input" do
+ test "returns Code cells bound to the given input" do
input = %{id: "i1", type: :text, label: "Text", default: "hey"}
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
- {:insert_cell, self(), "s1", 4, :elixir, "c4", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
+ {:insert_cell, self(), "s1", 4, :code, "c4", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1"]},
{:add_cell_evaluation_response, self(), "c1", {:input, input}, @eval_meta},
@@ -3427,9 +3427,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
{:evaluation_started, self(), "c1", @empty_digest},
@@ -3450,8 +3450,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c3"]},
{:evaluation_started, self(), "c1", @empty_digest},
@@ -3459,7 +3459,7 @@ defmodule Livebook.Session.DataTest do
{:evaluation_started, self(), "c3", @empty_digest},
{:add_cell_evaluation_response, self(), "c3", @eval_resp, @eval_meta},
# Insert a fresh cell between cell 1 and cell 3
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}}
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}}
])
assert Data.cell_ids_for_full_evaluation(data, []) |> Enum.sort() == ["c2", "c3"]
@@ -3469,8 +3469,8 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2"]},
{:evaluation_started, self(), "c1", @empty_digest},
@@ -3490,9 +3490,9 @@ defmodule Livebook.Session.DataTest do
data =
data_after_operations!([
{:insert_section, self(), 0, "s1"},
- {:insert_cell, self(), "s1", 0, :elixir, "c1", %{}},
- {:insert_cell, self(), "s1", 1, :elixir, "c2", %{}},
- {:insert_cell, self(), "s1", 2, :elixir, "c3", %{}},
+ {:insert_cell, self(), "s1", 0, :code, "c1", %{}},
+ {:insert_cell, self(), "s1", 1, :code, "c2", %{}},
+ {:insert_cell, self(), "s1", 2, :code, "c3", %{}},
{:set_runtime, self(), NoopRuntime.new()},
{:queue_cells_evaluation, self(), ["c1", "c2", "c3"]},
{:evaluation_started, self(), "c1", @empty_digest},
diff --git a/test/livebook/session_test.exs b/test/livebook/session_test.exs
index 991be614c..2a0c8475d 100644
--- a/test/livebook/session_test.exs
+++ b/test/livebook/session_test.exs
@@ -57,8 +57,8 @@ defmodule Livebook.SessionTest do
Session.insert_section(session.pid, 0)
assert_receive {:operation, {:insert_section, ^pid, 0, section_id}}
- Session.insert_cell(session.pid, section_id, 0, :elixir)
- assert_receive {:operation, {:insert_cell, ^pid, ^section_id, 0, :elixir, _id, _attrs}}
+ Session.insert_cell(session.pid, section_id, 0, :code)
+ assert_receive {:operation, {:insert_cell, ^pid, ^section_id, 0, :code, _id, _attrs}}
end
end
@@ -118,7 +118,7 @@ defmodule Livebook.SessionTest do
assert_receive {:operation, {:delete_cell, ^pid, ^cell_id}}
assert_receive {:operation,
- {:insert_cell, ^pid, ^section_id, 0, :elixir, _id,
+ {:insert_cell, ^pid, ^section_id, 0, :code, _id,
%{source: "content", outputs: []}}}
end
end
@@ -505,20 +505,20 @@ defmodule Livebook.SessionTest do
describe "user input" do
test "replies to runtime input request" do
- input_elixir_cell = %{Notebook.Cell.new(:elixir) | source: @livebook_put_input_code}
+ input_code_cell = %{Notebook.Cell.new(:code) | source: @livebook_put_input_code}
- elixir_cell = %{Notebook.Cell.new(:elixir) | source: @livebook_get_input_value_code}
+ code_cell = %{Notebook.Cell.new(:code) | source: @livebook_get_input_value_code}
notebook = %{
Notebook.new()
| sections: [
- %{Notebook.Section.new() | cells: [input_elixir_cell, elixir_cell]}
+ %{Notebook.Section.new() | cells: [input_code_cell, code_cell]}
]
}
session = start_session(notebook: notebook)
- cell_id = elixir_cell.id
+ cell_id = code_cell.id
Phoenix.PubSub.subscribe(Livebook.PubSub, "sessions:#{session.id}")
Session.queue_cell_evaluation(session.pid, cell_id)
@@ -531,18 +531,18 @@ defmodule Livebook.SessionTest do
end
test "replies with error when no matching input is found" do
- elixir_cell = %{Notebook.Cell.new(:elixir) | source: @livebook_get_input_value_code}
+ code_cell = %{Notebook.Cell.new(:code) | source: @livebook_get_input_value_code}
notebook = %{
Notebook.new()
| sections: [
- %{Notebook.Section.new() | cells: [elixir_cell]}
+ %{Notebook.Section.new() | cells: [code_cell]}
]
}
session = start_session(notebook: notebook)
- cell_id = elixir_cell.id
+ cell_id = code_cell.id
Phoenix.PubSub.subscribe(Livebook.PubSub, "sessions:#{session.id}")
Session.queue_cell_evaluation(session.pid, cell_id)
@@ -588,12 +588,12 @@ defmodule Livebook.SessionTest do
end
describe "find_prev_locator/3" do
- test "given cell in main flow returns previous Elixir cell" do
- cell1 = %{Cell.new(:elixir) | id: "c1"}
+ test "given cell in main flow returns previous Code cell" do
+ cell1 = %{Cell.new(:code) | id: "c1"}
cell2 = %{Cell.new(:markdown) | id: "c2"}
section1 = %{Section.new() | id: "s1", cells: [cell1, cell2]}
- cell3 = %{Cell.new(:elixir) | id: "c3"}
+ cell3 = %{Cell.new(:code) | id: "c3"}
section2 = %{Section.new() | id: "s2", cells: [cell3]}
notebook = %{Notebook.new() | sections: [section1, section2]}
@@ -601,12 +601,12 @@ defmodule Livebook.SessionTest do
assert {:main_flow, "c1"} = Session.find_prev_locator(notebook, cell3, section2)
end
- test "given cell in branching section returns previous Elixir cell in that section" do
+ test "given cell in branching section returns previous Code cell in that section" do
section1 = %{Section.new() | id: "s1"}
- cell1 = %{Cell.new(:elixir) | id: "c1"}
+ cell1 = %{Cell.new(:code) | id: "c1"}
cell2 = %{Cell.new(:markdown) | id: "c2"}
- cell3 = %{Cell.new(:elixir) | id: "c3"}
+ cell3 = %{Cell.new(:code) | id: "c3"}
section2 = %{
Section.new()
@@ -624,7 +624,7 @@ defmodule Livebook.SessionTest do
cell1 = %{Cell.new(:markdown) | id: "c1"}
section1 = %{Section.new() | id: "s1", cells: [cell1]}
- cell2 = %{Cell.new(:elixir) | id: "c2"}
+ cell2 = %{Cell.new(:code) | id: "c2"}
section2 = %{Section.new() | id: "s2", cells: [cell2]}
notebook = %{Notebook.new() | sections: [section1, section2]}
@@ -636,7 +636,7 @@ defmodule Livebook.SessionTest do
cell1 = %{Cell.new(:markdown) | id: "c1"}
section1 = %{Section.new() | id: "s1", cells: [cell1]}
- cell2 = %{Cell.new(:elixir) | id: "c2"}
+ cell2 = %{Cell.new(:code) | id: "c2"}
section2 = %{
Section.new()
@@ -696,8 +696,8 @@ defmodule Livebook.SessionTest do
defp insert_section_and_cell(session_pid) do
Session.insert_section(session_pid, 0)
assert_receive {:operation, {:insert_section, _, 0, section_id}}
- Session.insert_cell(session_pid, section_id, 0, :elixir)
- assert_receive {:operation, {:insert_cell, _, ^section_id, 0, :elixir, cell_id, _attrs}}
+ Session.insert_cell(session_pid, section_id, 0, :code)
+ assert_receive {:operation, {:insert_cell, _, ^section_id, 0, :code, cell_id, _attrs}}
{section_id, cell_id}
end
diff --git a/test/livebook_web/controllers/session_controller_test.exs b/test/livebook_web/controllers/session_controller_test.exs
index dc8cd018f..626dfaef4 100644
--- a/test/livebook_web/controllers/session_controller_test.exs
+++ b/test/livebook_web/controllers/session_controller_test.exs
@@ -86,7 +86,7 @@ defmodule LivebookWeb.SessionControllerTest do
| name: "Section 1",
cells: [
%{
- Notebook.Cell.new(:elixir)
+ Notebook.Cell.new(:code)
| source: """
IO.puts("hey")\
""",
@@ -213,7 +213,7 @@ defmodule LivebookWeb.SessionControllerTest do
| sections: [
%{
Notebook.Section.new()
- | cells: [%{Notebook.Cell.new(:elixir) | outputs: [{0, output}]}]
+ | cells: [%{Notebook.Cell.new(:code) | outputs: [{0, output}]}]
}
]
}
diff --git a/test/livebook_web/live/session_live_test.exs b/test/livebook_web/live/session_live_test.exs
index 9e6f463a3..54afadcd3 100644
--- a/test/livebook_web/live/session_live_test.exs
+++ b/test/livebook_web/live/session_live_test.exs
@@ -115,7 +115,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "queueing cell evaluation", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir, "Process.sleep(50)")
+ cell_id = insert_text_cell(session.pid, section_id, :code, "Process.sleep(50)")
{:ok, view, _} = live(conn, "/sessions/#{session.id}")
@@ -129,7 +129,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "cancelling cell evaluation", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir, "Process.sleep(2000)")
+ cell_id = insert_text_cell(session.pid, section_id, :code, "Process.sleep(2000)")
{:ok, view, _} = live(conn, "/sessions/#{session.id}")
@@ -147,7 +147,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "inserting a cell below the given cell", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir)
+ cell_id = insert_text_cell(session.pid, section_id, :code)
{:ok, view, _} = live(conn, "/sessions/#{session.id}")
@@ -161,7 +161,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "inserting a cell at section start", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- _cell_id = insert_text_cell(session.pid, section_id, :elixir)
+ _cell_id = insert_text_cell(session.pid, section_id, :code)
{:ok, view, _} = live(conn, "/sessions/#{session.id}")
@@ -175,7 +175,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "deleting the given cell", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir)
+ cell_id = insert_text_cell(session.pid, section_id, :code)
{:ok, view, _} = live(conn, "/sessions/#{session.id}")
@@ -188,7 +188,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "restoring a deleted cell", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir)
+ cell_id = insert_text_cell(session.pid, section_id, :code)
Session.delete_cell(session.pid, cell_id)
@@ -315,7 +315,7 @@ defmodule LivebookWeb.SessionLiveTest do
describe "outputs" do
test "stdout output update", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir)
+ cell_id = insert_text_cell(session.pid, section_id, :code)
Session.queue_cell_evaluation(session.pid, cell_id)
@@ -333,7 +333,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "frame output update", %{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir)
+ cell_id = insert_text_cell(session.pid, section_id, :code)
Session.queue_cell_evaluation(session.pid, cell_id)
@@ -484,7 +484,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "replies with nil completion reference when no runtime is started",
%{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir, "Process.sleep(10)")
+ cell_id = insert_text_cell(session.pid, section_id, :code, "Process.sleep(10)")
{:ok, view, _} = live(conn, "/sessions/#{session.id}")
@@ -503,7 +503,7 @@ defmodule LivebookWeb.SessionLiveTest do
test "replies with completion reference and then sends asynchronous response",
%{conn: conn, session: session} do
section_id = insert_section(session.pid)
- cell_id = insert_text_cell(session.pid, section_id, :elixir, "Process.sleep(10)")
+ cell_id = insert_text_cell(session.pid, section_id, :code, "Process.sleep(10)")
{:ok, runtime} = Livebook.Runtime.Embedded.init()
Session.connect_runtime(session.pid, runtime)
@@ -907,7 +907,7 @@ defmodule LivebookWeb.SessionLiveTest do
end
|> Macro.to_string()
- cell_id = insert_text_cell(session_pid, section_id, :elixir, code)
+ cell_id = insert_text_cell(session_pid, section_id, :code, code)
Session.queue_cell_evaluation(session_pid, cell_id)
assert_receive {:operation, {:add_cell_evaluation_response, _, ^cell_id, _, _}}
cell_id
diff --git a/test/support/notebooks/basic.livemd b/test/support/notebooks/basic.livemd
index 29ed76c91..94dd11e4e 100644
--- a/test/support/notebooks/basic.livemd
+++ b/test/support/notebooks/basic.livemd
@@ -2,7 +2,7 @@
## First section
-One Elixir cell below.
+One Code cell below.
```elixir
length([1, 2, 3])