File tree 1 file changed +11
-2
lines changed
compiler/src/language_server
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ let build_hint =
38
38
{label: ": " ++ message, position};
39
39
};
40
40
41
+ let rec string_of_typ = (typ: Types . type_expr ) => {
42
+ switch (typ. desc) {
43
+ | TTyArrow (_ , _ , _ ) => "Function"
44
+ | TTyLink (type_expr )
45
+ | TTySubst (type_expr ) => string_of_typ(type_expr)
46
+ | _ => Printtyp . string_of_type_scheme(typ)
47
+ };
48
+ };
49
+
41
50
let find_hints = program => {
42
51
let hints = ref ([] );
43
52
open Typedtree ;
@@ -72,8 +81,8 @@ let find_hints = program => {
72
81
line: bind_end. pos_lnum - 1 ,
73
82
character: bind_end. pos_cnum - bind_end. pos_bol,
74
83
};
75
- let typeSignature =
76
- Printtyp . string_of_type_scheme(vb_pat . pat_type );
84
+ let typ = vb_pat . pat_type ;
85
+ let typeSignature = string_of_typ(typ );
77
86
hints := [ build_hint(p, typeSignature), ... hints^ ] ;
78
87
| _ => ()
79
88
}
You can’t perform that action at this time.
0 commit comments