Skip to content

Commit

Permalink
Upgrade vendored typer
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Dec 5, 2024
1 parent 41a8a4e commit 7267b1c
Show file tree
Hide file tree
Showing 20 changed files with 543 additions and 359 deletions.
3 changes: 2 additions & 1 deletion src/analysis/context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ let cursor_on_longident_end ~cursor:cursor_pos
(* FIXME: this is britle, but lids don't have precise enough location
information to handle these cases correctly. *)
let name_lenght = String.length name in
if Pprintast.needs_parens name then name_lenght + 2 else name_lenght
if Pprintast.needs_parens ~kind:Other name then name_lenght + 2
else name_lenght
in
let constr_pos =
{ loc.loc_end with pos_cnum = end_offset - cstr_name_size }
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/occurrences.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let last_loc (loc : Location.t) lid =
| Longident.Lident _ -> loc
| _ ->
let last_segment = Longident.last lid in
let needs_parens = Pprintast.needs_parens last_segment in
let needs_parens = Pprintast.needs_parens ~kind:Other last_segment in
if not needs_parens then
let last_size = last_segment |> String.length in
{ loc with
Expand Down
3 changes: 2 additions & 1 deletion src/analysis/type_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ module Printtyp = struct
let expand_sig env mty = Env.with_cmis @@ fun () -> Env.scrape_alias env mty

let verbose_type_scheme env ppf t =
Printtyp.type_scheme ppf (expand_type env t)
let t = expand_type env t in
Printtyp.type_scheme ppf t

let verbose_type_declaration env id ppf t =
Printtyp.type_declaration id ppf (expand_type_decl env t)
Expand Down
Loading

0 comments on commit 7267b1c

Please sign in to comment.