Skip to content

Fix test warning; allow indented test comment marker #198

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

Merged
merged 1 commit into from
Apr 29, 2021
Merged
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: 1 addition & 1 deletion analysis/src/Commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions analysis/tests/src/Hover.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type t = (int, float)
// ^hov

module Id = {
// ^hov
// ^hov
type x = int
}

Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion analysis/tests/src/expected/Hover.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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```"}
Expand Down