Add Tracer @type (#1916)

This commit is contained in:
ByeongUk Choi 2023-05-23 00:39:04 +09:00 committed by GitHub
parent d92e7f98df
commit 3ada5c9146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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