Browse Source

don't list the main type itself in field completion (see #3288)

Dan Korostelev 11 years ago
parent
commit
0245989517

+ 0 - 1
tests/misc/projects/Issue3288/with-empty-type.hxml.stderr

@@ -1,6 +1,5 @@
 <list>
 <i n="AnotherOne"><t>AnotherOne</t><d></d></i>
 <i n="OtherType"><t>OtherType</t><d></d></i>
-<i n="WithEmptyType"><t>WithEmptyType</t><d></d></i>
 </list>
 

+ 0 - 1
tests/misc/projects/Issue3288/with-type.hxml.stderr

@@ -1,7 +1,6 @@
 <list>
 <i n="AnotherOne"><t>AnotherOne</t><d></d></i>
 <i n="OtherType"><t>OtherType</t><d></d></i>
-<i n="WithType"><t>WithType</t><d></d></i>
 <i n="f1"><t>Int</t><d></d></i>
 <i n="f2"><t>Void -&gt; Void</t><d></d></i>
 </list>

+ 1 - 1
typer.ml

@@ -3438,7 +3438,7 @@ and handle_display ctx e_ast iscall p =
 	ctx.in_display <- true;
 	let get_submodule_fields path =
 		let m = Hashtbl.find ctx.g.modules path in
-		let tl = List.filter (fun t -> not (t_infos t).mt_private) m.m_types in
+		let tl = List.filter (fun t -> path <> (t_infos t).mt_path && not (t_infos t).mt_private) m.m_types in
 		let tl = List.map (fun mt ->
 			let infos = t_infos mt in
 			(snd infos.mt_path),type_of_module_type mt,infos.mt_doc