LS4P
LS4P copied to clipboard
[BUG] Escaped characters and addition of multiple lines in a string give compilation errors
Bug:
code like:
String s = "\n";
String s= "\"";
println("X" +
"X");
Give compilation errors due to the fact the quotation character is replaced with multiple escaped characters ("\"") https://github.com/processing-language-server/LS4P/blob/1998f6e973460b392da3d2bcfa53da494970b9c5/server/src/grammer/terms/preprocessingsnippets.ts#L113-L122
Possible Solution
I think the problem lies at the method to create the java file:
https://github.com/processing-language-server/LS4P/blob/1998f6e973460b392da3d2bcfa53da494970b9c5/server/src/parser.ts#L39-L44 It now uses an echo command to create the file. If instead a method like fs.writeFileSync()
is used there is no need for escaping quotation characters to write the java file. All characters should be written to the file "as is".