Skip to content

Commit 285657c

Browse files
authored
Fix test warning; allow indented test comment marker (#198)
This makes it so that we get to format the file and all
1 parent bce87d9 commit 285657c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

analysis/src/Commands.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ let test ~path =
184184
| Some text ->
185185
let lines = text |> String.split_on_char '\n' in
186186
let processLine i line =
187-
if Str.string_match (Str.regexp "^//[ ]*\\^") line 0 then
187+
if Str.string_match (Str.regexp "^ *//[ ]*\\^") line 0 then
188188
let matched = Str.matched_string line in
189189
let len = line |> String.length in
190190
let mlen = String.length matched in

analysis/tests/src/Hover.res

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type t = (int, float)
55
// ^hov
66

77
module Id = {
8-
// ^hov
8+
// ^hov
99
type x = int
1010
}
1111

@@ -25,7 +25,7 @@ let cd = D.customDouble
2525

2626
module HoverInsideModuleWithComponent = {
2727
let x = 2 // check that hover on x works
28-
// ^hov
28+
// ^hov
2929
@react.component
3030
let make = () => React.null
3131
}
@@ -46,12 +46,12 @@ let num = 34
4646
// ^hov
4747

4848
module type Logger = {
49-
// ^hov
49+
// ^hov
5050
let log: string => unit
5151
}
5252

5353
module JsLogger: Logger = {
54-
// ^hov
54+
// ^hov
5555
let log = (msg: string) => Js.log(msg)
5656
let _oneMore = 3
5757
}
@@ -61,10 +61,10 @@ module JJ = JsLogger
6161

6262

6363
module IdDefinedTwice = {
64-
// ^hov
65-
let x = 10
64+
// ^hov
65+
let _x = 10
6666
let y = 20
67-
let x = 10
67+
let _x = 10
6868
}
6969

7070
module A = {let x=13}

analysis/tests/src/expected/Hover.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Definition tests/src/Hover.res 58:14
3838
{"uri": "Hover.res", "range": {"start": {"line": 47, "character": 12}, "end": {"line": 47, "character": 18}}}
3939

4040
Hover tests/src/Hover.res 62:9
41-
{"contents": "```rescript\nmodule IdDefinedTwice = {\n let y: int\n let x: int\n}\n```"}
41+
{"contents": "```rescript\nmodule IdDefinedTwice = {\n let y: int\n let _x: int\n}\n```"}
4242

4343
Hover tests/src/Hover.res 71:7
4444
{"contents": "```rescript\nmodule A = {\n let x: int\n}\n```"}

0 commit comments

Comments
 (0)