mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 17:15:09 +08:00
Add Tracer @type (#1916)
This commit is contained in:
parent
d92e7f98df
commit
3ada5c9146
2 changed files with 13 additions and 1 deletions
|
@ -58,7 +58,7 @@ defmodule Livebook.Runtime.Evaluator.IOProxy do
|
|||
@doc """
|
||||
Flushes any buffered output and returns gathered metadata.
|
||||
"""
|
||||
@spec after_evaluation(pid()) :: %{tracer_info: %Evaluator.Tracer{}}
|
||||
@spec after_evaluation(pid()) :: %{tracer_info: Evaluator.Tracer.t()}
|
||||
def after_evaluation(pid) do
|
||||
GenServer.call(pid, :after_evaluation)
|
||||
end
|
||||
|
|
|
@ -19,6 +19,18 @@ defmodule Livebook.Runtime.Evaluator.Tracer do
|
|||
imports_defined?: false,
|
||||
undefined_vars: MapSet.new()
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
modules_used: MapSet.t(),
|
||||
modules_defined: map(),
|
||||
aliases_used: MapSet.t(),
|
||||
aliases_defined: map(),
|
||||
requires_used: MapSet.t(),
|
||||
requires_defined: MapSet.t(),
|
||||
imports_used?: boolean(),
|
||||
imports_defined?: boolean(),
|
||||
undefined_vars: MapSet.t()
|
||||
}
|
||||
|
||||
@doc false
|
||||
def trace(event, env) do
|
||||
case event_to_updates(event, env) do
|
||||
|
|
Loading…
Reference in a new issue