Skip to content

Commit

Permalink
Fix type formatting for integer and range
Browse files Browse the repository at this point in the history
  • Loading branch information
Blatts12 committed Oct 10, 2023
1 parent bbdb725 commit 3ce1e34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/contexted/module_analyzer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,13 @@ defmodule Contexted.ModuleAnalyzer do

defp format_type({:type, 0, nil, []}, _module), do: "[]"

defp format_type({:type, _, :range, [{:integer, _, from}, {:integer, _, to}]}, _module),
do: "#{from}..#{to}"

defp format_type({:type, _, type_name, _}, _module), do: "#{type_name}()"

defp format_type({:integer, _, integer}, _module), do: "#{integer}"

defp format_type({:user_type, _, atom, _}, module) do
"#{Atom.to_string(module)}.#{Atom.to_string(atom)}()"
end
Expand Down

0 comments on commit 3ce1e34

Please sign in to comment.