File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -735,9 +735,15 @@ defmodule IEx.Introspection do
735
735
## Helpers
736
736
737
737
defp format_typespec ( definition , kind , nesting ) do
738
- "@#{ kind } #{ Macro . to_string ( definition ) } "
739
- |> Code . format_string! ( line_length: IEx . width ( ) - 2 * nesting )
740
- |> IO . iodata_to_binary ( )
738
+ string = "@#{ kind } #{ Macro . to_string ( definition ) } "
739
+
740
+ try do
741
+ string
742
+ |> Code . format_string! ( line_length: IEx . width ( ) - 2 * nesting )
743
+ |> IO . iodata_to_binary ( )
744
+ rescue
745
+ _ -> string
746
+ end
741
747
|> color_prefix_with_line ( )
742
748
|> indent ( nesting )
743
749
end
Original file line number Diff line number Diff line change @@ -853,6 +853,7 @@ defmodule IEx.HelpersTest do
853
853
defmodule TypeSample do
854
854
@typedoc "An ID with description."
855
855
@type id_with_desc :: {number, String.t}
856
+ @type unquote(:"?")() :: :question_mark
856
857
end
857
858
"""
858
859
@@ -872,6 +873,11 @@ defmodule IEx.HelpersTest do
872
873
873
874
An ID with description.
874
875
"""
876
+
877
+ assert capture_io ( fn -> t ( TypeSample . "?" ( ) ) end ) == """
878
+ @type ?() :: :question_mark
879
+
880
+ """
875
881
end )
876
882
after
877
883
cleanup_modules ( [ TypeSample ] )
You can’t perform that action at this time.
0 commit comments