rascal
rascal copied to clipboard
Bug: IO.readFileLines ("Unsupported scheme 'java+compilationUnit'")
Description The readFileLines function, from the IO package, is unable to read the file while there is no reason that the function should not be able to read it. It gives the following error: IO("Unsupported scheme 'java+compilationUnit'").
To Reproduce The following piece of code already demonstrates the issue, if you have a project imported into Eclipse that it can analyse. It creates an M3 from the testProject. The files function from m3::Core returns a set of locations which specify the locations of the files from the project. When trying to read a file from the project it throws an error.
import IO;
import lang::java::jdt::m3::Core;
import lang::java::m3::Core;
void demoFunc() {
m3x = createM3FromEclipseProject(|project://testProject|);
projectFiles = files(m3x);
for(file <- projectFiles) {
readFileLines(file);
}
}
Expected behaviour I expected the file to be read out, and the content to be placed in a string array.
Stack trace
Rascal Version: 0.24.2, see |release-notes://0.24.2|
rascal>import Helper;
ok
rascal>demoFunc();
|std:///IO.rsc|(15157,756,<620,0>,<640,24>): IO("Unsupported scheme 'java+compilationUnit'")
at somewhere (|std:///IO.rsc|(15157,756,<620,0>,<640,24>))
at readFileLines(|project://TQM/src/Helper.rsc|(367,4,<15,17>,<15,21>))
at $root$(|prompt:///|(0,11,<1,0>,<1,11>)ok
Context Using Eclipse version 4.25.0, and observed in the following Rascal versions: 0.22.0, 0.23.0, 0.24.2