|
@@ -472,7 +472,7 @@ let rec load_instance ?(allow_display=false) ctx (t,p) allow_no_params =
|
|
end
|
|
end
|
|
in
|
|
in
|
|
if allow_display && ctx.com.display <> DMNone && Display.is_display_position p then
|
|
if allow_display && ctx.com.display <> DMNone && Display.is_display_position p then
|
|
- Display.display_type ctx.com.display t;
|
|
|
|
|
|
+ Display.display_type ctx.com.display t p;
|
|
t
|
|
t
|
|
|
|
|
|
(*
|
|
(*
|
|
@@ -1507,7 +1507,7 @@ let rec type_type_param ?(enum_constructor=false) ctx path get_params p tp =
|
|
c.cl_meta <- tp.Ast.tp_meta;
|
|
c.cl_meta <- tp.Ast.tp_meta;
|
|
if enum_constructor then c.cl_meta <- (Meta.EnumConstructorParam,[],c.cl_pos) :: c.cl_meta;
|
|
if enum_constructor then c.cl_meta <- (Meta.EnumConstructorParam,[],c.cl_pos) :: c.cl_meta;
|
|
let t = TInst (c,List.map snd c.cl_params) in
|
|
let t = TInst (c,List.map snd c.cl_params) in
|
|
- if Display.is_display_position (pos tp.tp_name) then Display.display_type ctx.com.display t;
|
|
|
|
|
|
+ if Display.is_display_position (pos tp.tp_name) then Display.display_type ctx.com.display t (pos tp.tp_name);
|
|
match tp.tp_constraints with
|
|
match tp.tp_constraints with
|
|
| [] ->
|
|
| [] ->
|
|
n, t
|
|
n, t
|
|
@@ -1553,7 +1553,7 @@ let type_function ctx args ret fmode f do_display p =
|
|
let v,c = add_local ctx n t pn, c in
|
|
let v,c = add_local ctx n t pn, c in
|
|
v.v_meta <- m;
|
|
v.v_meta <- m;
|
|
if do_display && Display.encloses_position !Parser.resume_display pn then
|
|
if do_display && Display.encloses_position !Parser.resume_display pn then
|
|
- Display.display_variable ctx.com.display v;
|
|
|
|
|
|
+ Display.display_variable ctx.com.display v pn;
|
|
if n = "this" then v.v_meta <- (Meta.This,[],p) :: v.v_meta;
|
|
if n = "this" then v.v_meta <- (Meta.This,[],p) :: v.v_meta;
|
|
v,c
|
|
v,c
|
|
) args f.f_args in
|
|
) args f.f_args in
|
|
@@ -1578,7 +1578,7 @@ let type_function ctx args ret fmode f do_display p =
|
|
with
|
|
with
|
|
| Parser.TypePath (_,None,_) | Exit ->
|
|
| Parser.TypePath (_,None,_) | Exit ->
|
|
type_expr ctx e NoValue
|
|
type_expr ctx e NoValue
|
|
- | Display.DisplayTypes [t] when (match follow t with TMono _ -> true | _ -> false) ->
|
|
|
|
|
|
+ | Display.DisplayType (t,_) | Display.DisplaySignatures [t] when (match follow t with TMono _ -> true | _ -> false) ->
|
|
type_expr ctx (if ctx.com.display = DMToplevel then Display.find_enclosing ctx.com e else e) NoValue
|
|
type_expr ctx (if ctx.com.display = DMToplevel then Display.find_enclosing ctx.com e else e) NoValue
|
|
end in
|
|
end in
|
|
let e = match e.eexpr with
|
|
let e = match e.eexpr with
|
|
@@ -2225,7 +2225,7 @@ module ClassInitializer = struct
|
|
|
|
|
|
let check_field_display com p cf =
|
|
let check_field_display com p cf =
|
|
if Display.encloses_position !Parser.resume_display p then
|
|
if Display.encloses_position !Parser.resume_display p then
|
|
- Display.display_field com.display cf
|
|
|
|
|
|
+ Display.display_field com.display cf p
|
|
|
|
|
|
let create_variable (ctx,cctx,fctx) c f t eo p =
|
|
let create_variable (ctx,cctx,fctx) c f t eo p =
|
|
if not fctx.is_static && cctx.abstract <> None then error (fst f.cff_name ^ ": Cannot declare member variable in abstract") p;
|
|
if not fctx.is_static && cctx.abstract <> None then error (fst f.cff_name ^ ": Cannot declare member variable in abstract") p;
|
|
@@ -2989,7 +2989,7 @@ let init_module_type ctx context_init do_init (decl,p) =
|
|
context_init := (fun() -> ctx.m.module_using <- filter_classes types @ ctx.m.module_using) :: !context_init
|
|
context_init := (fun() -> ctx.m.module_using <- filter_classes types @ ctx.m.module_using) :: !context_init
|
|
| EClass d ->
|
|
| EClass d ->
|
|
let c = (match get_type (fst d.d_name) with TClassDecl c -> c | _ -> assert false) in
|
|
let c = (match get_type (fst d.d_name) with TClassDecl c -> c | _ -> assert false) in
|
|
- if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TClassDecl c);
|
|
|
|
|
|
+ if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TClassDecl c) (pos d.d_name);
|
|
check_global_metadata ctx (fun m -> c.cl_meta <- m :: c.cl_meta) c.cl_module.m_path c.cl_path None;
|
|
check_global_metadata ctx (fun m -> c.cl_meta <- m :: c.cl_meta) c.cl_module.m_path c.cl_path None;
|
|
let herits = d.d_flags in
|
|
let herits = d.d_flags in
|
|
if Meta.has Meta.Generic c.cl_meta && c.cl_params <> [] then c.cl_kind <- KGeneric;
|
|
if Meta.has Meta.Generic c.cl_meta && c.cl_params <> [] then c.cl_kind <- KGeneric;
|
|
@@ -3049,7 +3049,7 @@ let init_module_type ctx context_init do_init (decl,p) =
|
|
);
|
|
);
|
|
| EEnum d ->
|
|
| EEnum d ->
|
|
let e = (match get_type (fst d.d_name) with TEnumDecl e -> e | _ -> assert false) in
|
|
let e = (match get_type (fst d.d_name) with TEnumDecl e -> e | _ -> assert false) in
|
|
- if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TEnumDecl e);
|
|
|
|
|
|
+ if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TEnumDecl e) (pos d.d_name);
|
|
let ctx = { ctx with type_params = e.e_params } in
|
|
let ctx = { ctx with type_params = e.e_params } in
|
|
let h = (try Some (Hashtbl.find ctx.g.type_patches e.e_path) with Not_found -> None) in
|
|
let h = (try Some (Hashtbl.find ctx.g.type_patches e.e_path) with Not_found -> None) in
|
|
check_global_metadata ctx (fun m -> e.e_meta <- m :: e.e_meta) e.e_module.m_path e.e_path None;
|
|
check_global_metadata ctx (fun m -> e.e_meta <- m :: e.e_meta) e.e_module.m_path e.e_path None;
|
|
@@ -3161,7 +3161,7 @@ let init_module_type ctx context_init do_init (decl,p) =
|
|
if is_display_file && Display.encloses_position !Parser.resume_display p then begin match ctx.com.display with
|
|
if is_display_file && Display.encloses_position !Parser.resume_display p then begin match ctx.com.display with
|
|
| DMPosition -> raise (Display.DisplayPosition [p]);
|
|
| DMPosition -> raise (Display.DisplayPosition [p]);
|
|
| DMUsage -> f.ef_meta <- (Meta.Usage,[],p) :: f.ef_meta;
|
|
| DMUsage -> f.ef_meta <- (Meta.Usage,[],p) :: f.ef_meta;
|
|
- | DMType -> raise (Display.DisplayTypes [f.ef_type])
|
|
|
|
|
|
+ | DMType -> raise (Display.DisplayType (f.ef_type,p))
|
|
| _ -> ()
|
|
| _ -> ()
|
|
end;
|
|
end;
|
|
e.e_constrs <- PMap.add f.ef_name f e.e_constrs;
|
|
e.e_constrs <- PMap.add f.ef_name f e.e_constrs;
|
|
@@ -3189,7 +3189,7 @@ let init_module_type ctx context_init do_init (decl,p) =
|
|
);
|
|
);
|
|
| ETypedef d ->
|
|
| ETypedef d ->
|
|
let t = (match get_type (fst d.d_name) with TTypeDecl t -> t | _ -> assert false) in
|
|
let t = (match get_type (fst d.d_name) with TTypeDecl t -> t | _ -> assert false) in
|
|
- if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TTypeDecl t);
|
|
|
|
|
|
+ if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TTypeDecl t) (pos d.d_name);
|
|
check_global_metadata ctx (fun m -> t.t_meta <- m :: t.t_meta) t.t_module.m_path t.t_path None;
|
|
check_global_metadata ctx (fun m -> t.t_meta <- m :: t.t_meta) t.t_module.m_path t.t_path None;
|
|
let ctx = { ctx with type_params = t.t_params } in
|
|
let ctx = { ctx with type_params = t.t_params } in
|
|
let tt = load_complex_type ctx true d.d_data in
|
|
let tt = load_complex_type ctx true d.d_data in
|
|
@@ -3219,7 +3219,7 @@ let init_module_type ctx context_init do_init (decl,p) =
|
|
);
|
|
);
|
|
| EAbstract d ->
|
|
| EAbstract d ->
|
|
let a = (match get_type (fst d.d_name) with TAbstractDecl a -> a | _ -> assert false) in
|
|
let a = (match get_type (fst d.d_name) with TAbstractDecl a -> a | _ -> assert false) in
|
|
- if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TAbstractDecl a);
|
|
|
|
|
|
+ if Display.is_display_position (pos d.d_name) then Display.display_module_type ctx.com.display (TAbstractDecl a) (pos d.d_name);
|
|
check_global_metadata ctx (fun m -> a.a_meta <- m :: a.a_meta) a.a_module.m_path a.a_path None;
|
|
check_global_metadata ctx (fun m -> a.a_meta <- m :: a.a_meta) a.a_module.m_path a.a_path None;
|
|
let ctx = { ctx with type_params = a.a_params } in
|
|
let ctx = { ctx with type_params = a.a_params } in
|
|
let is_type = ref false in
|
|
let is_type = ref false in
|