Skip to content

Commit

Permalink
Upgrade to ocamlformat 0.27.0
Browse files Browse the repository at this point in the history
Co-authored-by: Jules Aguillon <[email protected]>
  • Loading branch information
voodoos and Julow committed Dec 13, 2024
1 parent e9f74bd commit b950681
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.26.2
version=0.27.0
disable=false

break-cases=fit-or-vertical
Expand All @@ -8,4 +8,4 @@ dock-collection-brackets=false
# Preserve begin/end
exp-grouping=preserve
module-item-spacing=preserve
parse-docstrings=false
parse-docstrings=false
5 changes: 4 additions & 1 deletion src/analysis/completion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,10 @@ let complete_methods ~env ~prefix obj =
in
let methods = List.filter ~f:has_prefix (methods_of_type env t) in
List.map methods ~f:(fun (name, ty) ->
let info = `None (* TODO: get documentation. *) in
let info =
`None
(* TODO: get documentation. *)
in
{ name;
kind = `MethodCall;
desc = `Type_scheme ty;
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/destruct.ml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ let rec needs_parentheses = function
binding. *)
| Texp_function (_, Tfunction_body _)
(* The assumption here is that we're not in a [function ... | ...]
situation but either in [fun param] or [let name param]. *) ->
needs_parentheses ts
situation but either in [fun param] or [let name param]. *)
-> needs_parentheses ts
| _ -> true
end
| _ -> needs_parentheses ts)
Expand Down
3 changes: 2 additions & 1 deletion src/analysis/locate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ let doc_from_uid ~config ~loc uid =
when Env.get_current_unit_name () <> comp_unit ->
log ~title:"get_doc"
"the doc (%a) you're looking for is in another\n\
\ compilation unit (%s)" Logger.fmt
\ compilation unit (%s)"
Logger.fmt
(fun fmt -> Shape.Uid.print fmt uid)
comp_unit;
log ~title:"doc_from_uid" "Loading the cmt for unit %S" comp_unit;
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/syntax_doc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let get_syntax_doc cursor_loc node : syntax_info =
:: ( _,
Module_type_constraint
(Tmodtype_explicit
{ mty_desc = Tmty_with (_, [ (_, _, Twith_modtype _) ]); _ }) )
{ mty_desc = Tmty_with (_, [ (_, _, Twith_modtype _) ]); _ }) )
:: _ ->
Some
{ name = "Module substitution";
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/ocamlmerlin/old/old_protocol.ml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ type _ sync_command =
| Checkout : Context.document -> unit sync_command
| Idle_job : bool sync_command
| Flags_get : string list sync_command
| Project_get
: (string list * [ `Ok | `Failures of string list ]) sync_command
| Project_get :
(string list * [ `Ok | `Failures of string list ]) sync_command

type 'a command = Query of 'a Query_protocol.t | Sync of 'a sync_command

Expand Down
6 changes: 4 additions & 2 deletions src/kernel/mconfig.ml
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,15 @@ let ocaml_flags =
\ <num> a single warning number\n\
\ <num1>..<num2> a range of consecutive warning numbers\n\
\ <letter> a predefined set\n\
\ default setting is %S" Warnings.defaults_w );
\ default setting is %S"
Warnings.defaults_w );
( "-warn-error",
ocaml_warnings_spec ~error:true,
Printf.sprintf
"<list> Enable or disable error status for warnings according\n\
\ to <list>. See option -w for the syntax of <list>.\n\
\ Default setting is %S" Warnings.defaults_warn_error );
\ Default setting is %S"
Warnings.defaults_warn_error );
( "-alert",
ocaml_alert_spec,
Printf.sprintf
Expand Down
5 changes: 4 additions & 1 deletion src/kernel/mreader.ml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ let parse ?for_completion config = function
with
| Some (`No_labels no_labels_for_completion, parsetree) ->
let lexer_errors, parser_errors, comments = ([], [], []) in
let lexer_keywords = [] (* TODO? *) in
let lexer_keywords =
[]
(* TODO? *)
in
{ lexer_keywords;
lexer_errors;
parser_errors;
Expand Down

0 comments on commit b950681

Please sign in to comment.