Skip to content

Commit 3d95407

Browse files
voodoosTim-ats-d
authored andcommitted
Upgrade to ocamlformat 0.28.1 (#1569)
* Upgrade to ocamlformat 0.28.1 * Promote harmless test changes * Promote expected test change
1 parent da64744 commit 3d95407

File tree

8 files changed

+31
-46
lines changed

8 files changed

+31
-46
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=0.27.0
1+
version=0.28.1
22
profile=janestreet
33
ocaml-version=4.14.0

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ possible and does not make any assumptions about IO.
6464
astring
6565
camlp-streams
6666
(ppx_expect (and (>= v0.17.0) :with-test))
67-
(ocamlformat (and :with-test (= 0.27.0)))
67+
(ocamlformat (and :with-test (= 0.28.1)))
6868
(ocamlc-loc (>= 3.7.0))
6969
(pp (>= 1.1.2))
7070
(csexp (>= 1.5))

ocaml-lsp-server.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ depends: [
3939
"astring"
4040
"camlp-streams"
4141
"ppx_expect" {>= "v0.17.0" & with-test}
42-
"ocamlformat" {with-test & = "0.27.0"}
42+
"ocamlformat" {with-test & = "0.28.1"}
4343
"ocamlc-loc" {>= "3.7.0"}
4444
"pp" {>= "1.1.2"}
4545
"csexp" {>= "1.5"}

ocaml-lsp-server/src/code_actions/action_inline.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ let beta_reduce (paths : Paths.t) (app : Parsetree.expression) =
217217
if is_pure arg then body else with_let ()
218218
| Ppat_var param | Ppat_constraint ({ ppat_desc = Ppat_var param; _ }, _) ->
219219
if is_pure arg then with_subst param else with_let ()
220-
| Ppat_tuple ( pats, _) ->
220+
| Ppat_tuple (pats, _) ->
221221
let pats = List.map ~f:snd pats in
222222
(match arg.pexp_desc with
223223
| Pexp_tuple args ->
224-
let args = List.map ~f:snd args in
225-
List.fold_left2 ~f:beta_reduce_arg ~init:body pats args
224+
let args = List.map ~f:snd args in
225+
List.fold_left2 ~f:beta_reduce_arg ~init:body pats args
226226
| _ -> with_let ())
227227
| _ -> with_let ()
228228
in

ocaml-lsp-server/test/e2e-new/diagnostics_filter.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ let%expect_test "shorten diagnostics - true" =
5858
unit
5959
((1, 18), (2, 0))
6060
, Warning 8: this pattern-matching is not exhaustive.
61-
Here is an example of a case that is not matched:
62-
true
61+
Here is an example of a case that is not matched: true
6362
((8, 12), (9, 0))
6463
|}]
6564
;;
@@ -94,8 +93,7 @@ let%expect_test "shorten diagnostics - false" =
9493
unit
9594
((1, 18), (6, 5))
9695
, Warning 8: this pattern-matching is not exhaustive.
97-
Here is an example of a case that is not matched:
98-
true
96+
Here is an example of a case that is not matched: true
9997
((8, 12), (10, 16))
10098
|}]
10199
;;

ocaml-lsp-server/test/e2e-new/merlin_call_compatible.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ let%expect_test "errors: warning is shown" =
8989
{|
9090
{
9191
"resultAsSexp": false,
92-
"result": "{\"class\":\"return\",\"value\":[{\"start\":{\"line\":1,\"col\":9},\"end\":{\"line\":1,\"col\":39},\"type\":\"warning\",\"sub\":[],\"valid\":true,\"message\":\"Warning 8: this pattern-matching is not exhaustive.\\nHere is an example of a case that is not matched:\\nSome _\"}]}"
93-
} |}]
92+
"result": "{\"class\":\"return\",\"value\":[{\"start\":{\"line\":1,\"col\":9},\"end\":{\"line\":1,\"col\":39},\"type\":\"warning\",\"sub\":[],\"valid\":true,\"message\":\"Warning 8: this pattern-matching is not exhaustive.\\n Here is an example of a case that is not matched: Some _\"}]}"
93+
}
94+
|}]
9495
;;
9596

9697
let%expect_test "errors: warning is disabled" =

ocaml-lsp-server/test/e2e-new/type_search.ml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ let%expect_test
5858
"name": "string_of_int",
5959
"typ": "int -> string",
6060
"loc": {
61-
"end": { "character": 33, "line": 740 },
62-
"start": { "character": 0, "line": 740 }
61+
"end": { "character": 33, "line": 709 },
62+
"start": { "character": 0, "line": 709 }
6363
},
6464
"doc": {
6565
"kind": "markdown",
@@ -72,8 +72,8 @@ let%expect_test
7272
"name": "string_of_int",
7373
"typ": "int -> string",
7474
"loc": {
75-
"end": { "character": 33, "line": 740 },
76-
"start": { "character": 0, "line": 740 }
75+
"end": { "character": 33, "line": 709 },
76+
"start": { "character": 0, "line": 709 }
7777
},
7878
"doc": {
7979
"kind": "markdown",
@@ -112,8 +112,8 @@ let%expect_test
112112
"name": "string_of_int",
113113
"typ": "int -> string",
114114
"loc": {
115-
"end": { "character": 33, "line": 740 },
116-
"start": { "character": 0, "line": 740 }
115+
"end": { "character": 33, "line": 709 },
116+
"start": { "character": 0, "line": 709 }
117117
},
118118
"doc": null,
119119
"cost": 4,
@@ -123,14 +123,15 @@ let%expect_test
123123
"name": "string_of_int",
124124
"typ": "int -> string",
125125
"loc": {
126-
"end": { "character": 33, "line": 740 },
127-
"start": { "character": 0, "line": 740 }
126+
"end": { "character": 33, "line": 709 },
127+
"start": { "character": 0, "line": 709 }
128128
},
129129
"doc": null,
130130
"cost": 4,
131131
"constructible": "string_of_int _"
132132
}
133-
] |}]
133+
]
134+
|}]
134135
;;
135136

136137
let%expect_test
@@ -159,8 +160,8 @@ let%expect_test
159160
"name": "string_of_int",
160161
"typ": "int -> string",
161162
"loc": {
162-
"end": { "character": 33, "line": 740 },
163-
"start": { "character": 0, "line": 740 }
163+
"end": { "character": 33, "line": 709 },
164+
"start": { "character": 0, "line": 709 }
164165
},
165166
"doc": null,
166167
"cost": 0,
@@ -170,14 +171,15 @@ let%expect_test
170171
"name": "string_of_int",
171172
"typ": "int -> string",
172173
"loc": {
173-
"end": { "character": 33, "line": 740 },
174-
"start": { "character": 0, "line": 740 }
174+
"end": { "character": 33, "line": 709 },
175+
"start": { "character": 0, "line": 709 }
175176
},
176177
"doc": null,
177178
"cost": 0,
178179
"constructible": "string_of_int _"
179180
}
180-
] |}]
181+
]
182+
|}]
181183
;;
182184

183185
let%expect_test
@@ -209,8 +211,8 @@ let%expect_test
209211
"name": "string_of_int",
210212
"typ": "int -> string",
211213
"loc": {
212-
"end": { "character": 33, "line": 740 },
213-
"start": { "character": 0, "line": 740 }
214+
"end": { "character": 33, "line": 709 },
215+
"start": { "character": 0, "line": 709 }
214216
},
215217
"doc": {
216218
"kind": "plaintext",
@@ -223,8 +225,8 @@ let%expect_test
223225
"name": "string_of_int",
224226
"typ": "int -> string",
225227
"loc": {
226-
"end": { "character": 33, "line": 740 },
227-
"start": { "character": 0, "line": 740 }
228+
"end": { "character": 33, "line": 709 },
229+
"start": { "character": 0, "line": 709 }
228230
},
229231
"doc": {
230232
"kind": "plaintext",

ocaml-lsp-server/test/e2e/__tests__/textDocument-codeLens.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,6 @@ describe("textDocument/references", () => {
5353

5454
expect(result).toMatchInlineSnapshot(`
5555
[
56-
{
57-
"command": {
58-
"command": "",
59-
"title": "int -> int -> int",
60-
},
61-
"range": {
62-
"end": {
63-
"character": 19,
64-
"line": 4,
65-
},
66-
"start": {
67-
"character": 2,
68-
"line": 4,
69-
},
70-
},
71-
},
7256
{
7357
"command": {
7458
"command": "",

0 commit comments

Comments
 (0)