Explorar el Código

make sure we optimize for completion when we are in the good file (closed #2017)

Nicolas Cannasse hace 12 años
padre
commit
aedbe90ae8
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      typeload.ml

+ 2 - 2
typeload.ml

@@ -318,7 +318,7 @@ let check_param_constraints ctx types t pl c p =
 					f (List.map (fun t -> apply_params types pl t) tl)
 					f (List.map (fun t -> apply_params types pl t) tl)
 				| _ -> ti
 				| _ -> ti
 			) in
 			) in
-			try 
+			try
 				unify_raise ctx t ti p
 				unify_raise ctx t ti p
 			with Error(Unify l,p) ->
 			with Error(Unify l,p) ->
 				if not ctx.untyped then display_error ctx (error_msg (Unify (Constraint_failure (s_type_path c.cl_path) :: l))) p;
 				if not ctx.untyped then display_error ctx (error_msg (Unify (Constraint_failure (s_type_path c.cl_path) :: l))) p;
@@ -1738,7 +1738,7 @@ let init_class ctx c p context_init herits fields =
 						| _ ->
 						| _ ->
 							if constr then FunConstructor else if stat then FunStatic else FunMember
 							if constr then FunConstructor else if stat then FunStatic else FunMember
 					) in
 					) in
-					let display_field = f.cff_pos.pmin <= cp.pmin && f.cff_pos.pmax >= cp.pmax in
+					let display_field = display_file && (f.cff_pos.pmin <= cp.pmin && f.cff_pos.pmax >= cp.pmax) in
 					let e , fargs = type_function ctx args ret fmode fd display_field p in
 					let e , fargs = type_function ctx args ret fmode fd display_field p in
 					let f = {
 					let f = {
 						tf_args = fargs;
 						tf_args = fargs;