Closed Adrijaned closed 4 years ago
Thanks for reporting!
Which version of the plugin?
@Adrijaned Ok, I can reproduce this issue in latest beta.
It's because the parser sees your second case as quasi quotation and that's right when the QuasiQuotes language extension is enabled...
I don't know how to fix this issue.
Ooof, sorry for not getting to you earlier with the plugin version, only just got to PC. I'm only a beginner haskeller, but my quick google search revealed that quasiquotations have always the following syntax: [ident|..|]
. Would it be possible to issue something like warning, prefferably at the line where the quasiquote is started, saying "A QuasiQuotation expression was started, but never ended", if the matching |]
cannot be found until the end of file? An intent inserting the missing space for the warning along the lines of "Did you mean to write list comprehension?" would be appreciated too.
saying "A QuasiQuotation expression was started, but never ended
Yep, after some more digging, to get that behavior I have to move the quasi quotes element from the lexer to the bnf but that’s a risky change... but will try it.
I don't succeed in finding a proper solution for this issue. Each alternative solution I found had bigger issues than this issue.
@ice1000 Can you help?
Random guess: access language extensions in the lexer
It’s not about language extensions, it’s about the quasi quote extension syntax which starts similar as a for comprehension.
In don’t see a way in the QQ definition of the lexer to go back when there in no |]
at the end.
Should be fixed in beta69.
Please reopen if still an issue.
When doing , everything works as expected. However, if I for whatever reason miss the space in before the first pipe, this happens: Please note that the dark yellow continues until the very end of file, no matter what is after it. Code compiles and behives as expected in both cases.