@@ -37,8 +37,10 @@ type t =
3737 path (cf. #486, #794). *)
3838 | Unknown_constructor
3939 | Expr
40- | Label of Types .label_description (* Similar to constructors. *)
41- | Unknown_label
40+ | Label :
41+ 'rep Types .gen_label_description * 'rep Types .record_form
42+ -> t (* Similar to constructors. *)
43+ | Unknown_label : 'rep Types .record_form -> t
4244 | Module_path
4345 | Module_type
4446 | Patt
@@ -50,8 +52,11 @@ let to_string = function
5052 | Constructor (cd , _ ) -> Printf. sprintf " constructor %s" cd.cstr_name
5153 | Unknown_constructor -> Printf. sprintf " unknown constructor"
5254 | Expr -> " expression"
53- | Label lbl -> Printf. sprintf " record field %s" lbl.lbl_name
54- | Unknown_label -> Printf. sprintf " record field"
55+ | Label (lbl , Legacy) -> Printf. sprintf " record field %s" lbl.lbl_name
56+ | Unknown_label Legacy -> Printf. sprintf " record field"
57+ | Label (lbl , Unboxed_product) ->
58+ Printf. sprintf " unboxed record field %s" lbl.lbl_name
59+ | Unknown_label Unboxed_product -> Printf. sprintf " unboxed record field"
5560 | Module_path -> " module path"
5661 | Module_type -> " module type"
5762 | Patt -> " pattern"
@@ -67,7 +72,8 @@ let of_locate_context : Query_protocol.Locate_context.t -> t = function
6772 | Type -> Type
6873 | Constant -> Constant
6974 | Constructor -> Unknown_constructor
70- | Label -> Unknown_label
75+ | Label -> Unknown_label Legacy
76+ | Unboxed_label -> Unknown_label Unboxed_product
7177 | Unknown -> Unknown
7278
7379(* Distinguish between "Mo[d]ule.something" and "Module.some[t]hing" *)
@@ -158,9 +164,10 @@ let inspect_browse_tree ?let_pun_behavior ~cursor lid browse : t option =
158164 | Module_type _ -> Some Module_type
159165 | Core_type { ctyp_desc = Ttyp_package _ ; _ } -> Some Module_type
160166 | Core_type _ -> Some Type
161- | Record_field (_ , lbl , _ ) when Longident. last lid = lbl.lbl_name ->
167+ | Record_field (_, lbl, record_form, _)
168+ when Longident. last lid = lbl.lbl_name ->
162169 (* if we stopped here, then we're on the label itself, and whether or
163170 not punning is happening is not important *)
164- Some (Label lbl)
171+ Some (Label ( lbl, record_form) )
165172 | Expression e -> Some (inspect_expression ~cursor ~lid e)
166173 | _ -> Some Unknown )
0 commit comments