Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview ocamlformat 0.27.0 preview1 #1861

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# git config blame.ignoreRevsFile .git-blame-ignore-revs
40e0cdb95ff31b81212109fada6e0ff93b6eefee
# Upgrade to OCamlformat 0.27.0-preview1
3d0d0baa926e9a61ba52f4ebf04886317c61b93b
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.26.2
version=0.27.0-preview1
disable=false

break-cases=fit-or-vertical
Expand Down
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_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 @@ -39,7 +39,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
Loading