···3232 let next =
3333 match mode with
3434 | `Sequential ->
3535- let last_sequential = List.fold_left (fun acc_i i -> if i > acc_i then i else acc_i ) 0 keys in
3535+ let last_sequential = List.fold_left (fun acc_i i -> if i > acc_i then i else acc_i) 0 keys in
3636 last_sequential + 1
3737 | `Random -> random_not_in keys
3838 in
···3535 match String.rindex_opt name '-' with
3636 | Some i ->
3737 let prefix = String.sub name 0 i
3838- and suffix = String.sub name (i + 1) (String.length name - i - 1) in
3838+ and suffix = String.sub name (i + 1) (String.length name - i - 1)
3939+ in
3940 let@ key = Option.map @~ BaseN.Base36.int_of_string suffix in
4041 Some prefix, key
4142 | _ ->
+15-15
lib/language_server/Code_action.ml
···4141 match forest.config.trees with
4242 | [] -> []
4343 | dir :: _ ->
4444- let sequential =
4545- L.CodeAction.create
4646- ~title: (Format.asprintf "create new tree (sequential address)")
4747- ~kind: (L.CodeActionKind.Other "new tree")
4848- ~edit: (create_tree_edit ~range ~uri next_sequential dir)
4949- ()
5050- in
5151- let random =
5252- L.CodeAction.create
5353- ~title: (Format.asprintf "create new tree (random address)")
5454- ~kind: (L.CodeActionKind.Other "new tree")
5555- ~edit: (create_tree_edit ~range ~uri next_random dir)
5656- ()
5757- in
5858- [`CodeAction sequential; `CodeAction random]
4444+ let sequential =
4545+ L.CodeAction.create
4646+ ~title: (Format.asprintf "create new tree (sequential address)")
4747+ ~kind: (L.CodeActionKind.Other "new tree")
4848+ ~edit: (create_tree_edit ~range ~uri next_sequential dir)
4949+ ()
5050+ in
5151+ let random =
5252+ L.CodeAction.create
5353+ ~title: (Format.asprintf "create new tree (random address)")
5454+ ~kind: (L.CodeActionKind.Other "new tree")
5555+ ~edit: (create_tree_edit ~range ~uri next_random dir)
5656+ ()
5757+ in
5858+ [`CodeAction sequential; `CodeAction random]
5959 in
6060 Some actions