Skip to content

Commit d061cb9

Browse files
committed
Improve docs for tracer events
1 parent d1f7457 commit d061cb9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/elixir/lib/code.ex

+9-4
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ defmodule Code do
100100
following events are available to tracers:
101101
102102
* `:start` - (since v1.11.0) invoked whenever the compiler starts to trace
103-
a new lexical context, such as a new file. Keep in mind the compiler runs
104-
in parallel, so multiple files may invoke `:start` and run at the same
105-
time. The value of the `lexical_tracker` of the macro environment, albeit
106-
opaque, can be used to uniquely identify the environment.
103+
a new lexical context. A lexical context is started when compiling a new
104+
file or when defining a module within a function. Note evaluated code
105+
does not start a new lexical context (because they don't track unused
106+
aliases, imports, etc) but defining a module inside evaluated code will.
107+
108+
Note this event may be emitted in parallel, where multiple files/modules
109+
invoke `:start` and run at the same time. The value of the `lexical_tracker`
110+
of the macro environment, albeit opaque, can be used to uniquely identify
111+
the environment.
107112
108113
* `:stop` - (since v1.11.0) invoked whenever the compiler stops tracing a
109114
new lexical context, such as a new file.

0 commit comments

Comments
 (0)