TLX.Extractor.GenServer (TLX v0.5.2)

Copy Markdown

Extracts GenServer structure from Elixir source code.

Parses source with Code.string_to_quoted/1 and walks the AST to extract fields (from init/1), calls, casts, and info handlers. Detects field changes from %{state | field: value} map update patterns in return tuples.

Usage

{:ok, result} = TLX.Extractor.GenServer.extract_from_file("lib/my_server.ex")

result.fields  #=> [status: :idle, deps_met: true]
result.calls   #=> [%{name: :check, next: [status: :in_sync], ...}]

The result can feed into TLX.Patterns.OTP.GenServer or TLX.Importer.Codegen.from_gen_server/3.

Summary

Functions

Extract GenServer structure from a source file.

Extract GenServer structure from an Elixir source string.

Functions

extract_from_file(path)

Extract GenServer structure from a source file.

extract_from_source(source)

Extract GenServer structure from an Elixir source string.