Skip to content

Commit

Permalink
chore(Tracer) move tracer to support folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoch-cars committed Aug 20, 2022
1 parent 7c6ca7e commit 7d146a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ Use at your peril, _for now._
- [X] Option to only change the module name throughout the project
- [X] update code to rely on compilation tracers, instead of XREF
- [X] With module-only option, ensure we remove changed aliases
- [] defdelegate
- [X] Add and configure CHANGELOG tracking.
- [X] defdelegate

## Roadmap TODO

- [] find private functions references in refactored fn bodies.
- [] Add and configure CHANGELOG tracking.
- [] Add test for one file containing more than one `defmodule`
- [] Add test for nested defmodules.
- [] update test file refs by CLI option
Expand Down
11 changes: 1 addition & 10 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
defmodule ExFactor.Tracer do
@trace_types ~w(import imported_function alias alias_expansion alias_reference require struct_expansion remote_function local_function)a
def trace({type, meta, module, name, arity}, env) when type in @trace_types do
ExFactor.Server.record(type, env.file, meta[:line], meta[:column], module, name, arity, env.module)
end

def trace(_event, _env) do
:ok
end
end
Code.compile_file("support/tracer.ex")

defmodule ExFactor.MixProject do
use Mix.Project
Expand Down
10 changes: 10 additions & 0 deletions support/tracer.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
defmodule ExFactor.Tracer do
@trace_types ~w(import imported_function alias alias_expansion alias_reference require struct_expansion remote_function local_function)a
def trace({type, meta, module, name, arity}, env) when type in @trace_types do
ExFactor.Server.record(type, env.file, meta[:line], meta[:column], module, name, arity, env.module)
end

def trace(_event, _env) do
:ok
end
end

0 comments on commit 7d146a2

Please sign in to comment.