usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
408 stars 77 forks source link

`RASCAL.MF` generated by `newRascalProject` triggers an error in VS Code #2079

Closed sungshik closed 1 week ago

sungshik commented 2 weeks ago

Describe the bug

Function newRascalProject in module util::Reflective produces a META-INF/RASCAL.MF that triggers an error in VS Code when a Rascal terminal is opened.

image

To Reproduce

  1. Create a new Rascal project using function newRascalProject in module util::Reflective
  2. Open the new project in VS Code
  3. Open a new Rascal terminal (not necessarily using a code lens in a module)

Possible fix

This seems to be the code to generate RASCAL.MF:

https://github.com/usethesource/rascal/blob/42cf8017669a6984c9a7bfc49c83300745188e5a/src/org/rascalmpl/library/util/Reflective.rsc#L407-L412

Adding a single quote to line 412 might be enough (but I'm not sure):

    '";
jurgenvinju commented 2 weeks ago

I think adding '\n" would fix this. I have the feeling we fixed this one before.. but who knows. Good catch!

DavyLandman commented 1 week ago

I think @sungshik proposed fix is right, as indeed, a .MF file has to end with a blank newline. no spaces no nothing.

jurgenvinju commented 1 week ago

Right! Let's do it.

Isn't it strange that there is no parse error in the original buggy template? Doesn't every non-escaped newline inside a string come with a single quote?

sungshik commented 1 week ago

Right! Let's do it.

Ok, doing this now Done. See #2080.