From cf41a2a85c6bcd611ef32da4f81cc570d5cc660e Mon Sep 17 00:00:00 2001 From: Cheng Lou Date: Thu, 29 Apr 2021 06:23:33 -0700 Subject: [PATCH] Fix test warning; allow indented test comment marker This makes it so that we get to format the file and all --- analysis/src/Commands.ml | 2 +- analysis/tests/src/Hover.res | 14 +++++++------- analysis/tests/src/expected/Hover.res.txt | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/analysis/src/Commands.ml b/analysis/src/Commands.ml index ed6a60d71..2e477b4c9 100644 --- a/analysis/src/Commands.ml +++ b/analysis/src/Commands.ml @@ -184,7 +184,7 @@ let test ~path = | Some text -> let lines = text |> String.split_on_char '\n' in let processLine i line = - if Str.string_match (Str.regexp "^//[ ]*\\^") line 0 then + if Str.string_match (Str.regexp "^ *//[ ]*\\^") line 0 then let matched = Str.matched_string line in let len = line |> String.length in let mlen = String.length matched in diff --git a/analysis/tests/src/Hover.res b/analysis/tests/src/Hover.res index 500d51f82..344808577 100644 --- a/analysis/tests/src/Hover.res +++ b/analysis/tests/src/Hover.res @@ -5,7 +5,7 @@ type t = (int, float) // ^hov module Id = { -// ^hov + // ^hov type x = int } @@ -25,7 +25,7 @@ let cd = D.customDouble module HoverInsideModuleWithComponent = { let x = 2 // check that hover on x works -// ^hov + // ^hov @react.component let make = () => React.null } @@ -46,12 +46,12 @@ let num = 34 // ^hov module type Logger = { -// ^hov + // ^hov let log: string => unit } module JsLogger: Logger = { -// ^hov + // ^hov let log = (msg: string) => Js.log(msg) let _oneMore = 3 } @@ -61,10 +61,10 @@ module JJ = JsLogger module IdDefinedTwice = { -// ^hov - let x = 10 + // ^hov + let _x = 10 let y = 20 - let x = 10 + let _x = 10 } module A = {let x=13} diff --git a/analysis/tests/src/expected/Hover.res.txt b/analysis/tests/src/expected/Hover.res.txt index 4891f2bc0..8302e089c 100644 --- a/analysis/tests/src/expected/Hover.res.txt +++ b/analysis/tests/src/expected/Hover.res.txt @@ -38,7 +38,7 @@ Definition tests/src/Hover.res 58:14 {"uri": "Hover.res", "range": {"start": {"line": 47, "character": 12}, "end": {"line": 47, "character": 18}}} Hover tests/src/Hover.res 62:9 -{"contents": "```rescript\nmodule IdDefinedTwice = {\n let y: int\n let x: int\n}\n```"} +{"contents": "```rescript\nmodule IdDefinedTwice = {\n let y: int\n let _x: int\n}\n```"} Hover tests/src/Hover.res 71:7 {"contents": "```rescript\nmodule A = {\n let x: int\n}\n```"}