Skip to content

Commit 7e4f9c5

Browse files
eksperimentalJosé Valim
authored and
José Valim
committed
IEx h: sort results by arity (#8727)
The results were not sorted, when calling: h Module.function_name Example: ``` iex)> h :erlang.float_to_binary :erlang.float_to_binary/2 @SPEC float_to_binary(float, options) :: binary() when float: float(), options: [option], option: {:decimals, decimals :: 0..253} | {:scientific, decimals :: 0..249} | :compact Module was compiled without docs. Showing only specs. :erlang.float_to_binary/1 @SPEC float_to_binary(float) :: binary() when float: float() Module was compiled without docs. Showing only specs. ``` Now the results are sorted by arity.
1 parent b37ecb0 commit 7e4f9c5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/iex/lib/iex/introspection.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ defmodule IEx.Introspection do
283283
true ->
284284
module.module_info(:exports)
285285
end
286+
|> Enum.sort()
286287

287288
result =
288289
for {^function, arity} <- exports,

lib/iex/test/iex/helpers_test.exs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ defmodule IEx.HelpersTest do
343343
"""
344344

345345
assert capture_io(fn -> h(:timer.send_interval()) end) == """
346+
* :timer.send_interval/2
347+
348+
@spec send_interval(time, message) :: {:ok, tRef} | {:error, reason}
349+
when time: time(), message: term(), tRef: tref(), reason: term()
350+
351+
Module was compiled without docs. Showing only specs.
346352
* :timer.send_interval/3
347353
348354
@spec send_interval(time, pid, message) :: {:ok, tRef} | {:error, reason}
@@ -352,12 +358,6 @@ defmodule IEx.HelpersTest do
352358
tRef: tref(),
353359
reason: term()
354360
355-
Module was compiled without docs. Showing only specs.
356-
* :timer.send_interval/2
357-
358-
@spec send_interval(time, message) :: {:ok, tRef} | {:error, reason}
359-
when time: time(), message: term(), tRef: tref(), reason: term()
360-
361361
Module was compiled without docs. Showing only specs.
362362
"""
363363
end

0 commit comments

Comments
 (0)