jyp / dante

392 stars 51 forks source link

Reject newline match in module names #126

Closed arthurl closed 5 years ago

arthurl commented 5 years ago

On my GHCi interpreter, the “Compiling \<module>” notification isn’t always followed by some status message, i.e. not always of the form e.g. [1 of 1] Compiling Lib [flags changed]. For example,

*Lib> :r
[1 of 1] Compiling Lib

<dir_name>/Lib.hs:15:3: error:
    parse error (possibly incorrect indentation or mismatched brackets)
   |
15 |   Right rel <- withTransaction dbconn $ do
   |   ^
Failed, no modules loaded.

Without rejecting the newline match, the progress regex (^\\[\\([0-9]*\\) of \\([0-9]*\\)\\] Compiling \\([^ ]*\\).*) will thus match the next two lines, i.e. the 3rd capture group will match

Lib

<dir_name>/Lib.hs:15:3:

As a result, the error message is gone, and flycheck reports no errors.

jyp commented 5 years ago

Nice catch, thanks!