vscode-scala-syntax icon indicating copy to clipboard operation
vscode-scala-syntax copied to clipboard

Fix #226: Parse quoted blocks with spaces (`' {`)

Open lolgab opened this issue 4 years ago • 7 comments

Fixes the linked issue.

lolgab avatar Nov 11 '21 22:11 lolgab

That does not seem right. I believe that the syntax requires the quote to be immediately followed by a curly brace. I will double check.

nicolasstucki avatar Nov 12 '21 13:11 nicolasstucki

That does not seem right. I believe that the syntax requires the quote to be immediately followed by a curly brace. I will double check.

It doesn't actually. At least last time I checked it did compile with whitespaces :O

tgodzik avatar Nov 12 '21 13:11 tgodzik

Indeed. I opened an issue to fix this in https://github.com/lampepfl/dotty/issues/13951.

For

' 	{ 2 }
' [ String ]

it looks like the current highlighting is correct for both Scala 2 and Scala 3 (after bug fix) as it is an unclosed Char or a Char with illegal contents.

nicolasstucki avatar Nov 15 '21 09:11 nicolasstucki

Thank you @nicolasstucki for fixing the underlying issue :)

lolgab avatar Nov 17 '21 13:11 lolgab

@nicolasstucki should we reopen this PR since it turns out it's a correct behaviour?

tgodzik avatar Dec 09 '21 19:12 tgodzik

I'm reopening since the compiler is not changing behavior. Still, this change is not perfect because it doesn't parse a comment in the middle of ' and {.

lolgab avatar Dec 10 '21 10:12 lolgab

This is still missing some cases, see and other comments in that thread https://github.com/scala/vscode-scala-syntax/pull/227#discussion_r777565313

nicolasstucki avatar Jan 13 '22 10:01 nicolasstucki

This was fixed in #250

nicolasstucki avatar Apr 03 '23 07:04 nicolasstucki