Open iDylanK opened 2 years ago
Interesting. does it happen for every file or a specific file? And have you tried running the code inside eclipse or the command line?
We implemented a SIG model in rascal using eclipse. However, we can’t get eclipse to perform well. That’s why we want to start our new project using vscode.
First we want to get our built project working. We changed some minor things to get it up and running in vscode. All seems to be working fine, except for these messages occurring. It shows this message for all files (smallsql0.21) and thus spams the terminal.
How it’s implemented:
M3 model = createM3FromDirectory(|file://loc_smallsql0.21|);
set[loc] files = files(model);
files = {f | loc f <- files, f.extension == "java"};
for (file <- files) {
Declaration ast = createAstFromFile(file, false);
}
could you try running it from the command line? https://update.rascal-mpl.org/console/rascal-shell-release.jar
@rodinaarssen pointed out that in the Eclipse version of the REPL, we are loosing the output printed on stderr, while in vscode we are showing that to the user. There seems to be a debug print for certain nodes: https://github.com/usethesource/rascal/blob/master/src/org/rascalmpl/library/lang/java/m3/internal/ASTConverter.java#L157
So it could be that this message is always there, it's just hidden inside eclipse.
Ah that explains it, thank you! I get the same result running it from the command line. Do you have any suggestions on how to prevent this?
Not currently. I can imagine that it's annoying to keep seeing these prints.
I think we should migrate that print to use the logging framework, but that won't help you now.
We investigated this NPE some years ago; it happens deep inside the JDK compiler and so far we have not had bad results while ignoring it. However, we should take a newer version of the compiler and see if it still happens, and debug it again.
Possibly related:
I'm trying to use Visual Code but I'm running in a few issues.
The function createM3FromDirectory works.
createAstFromFile(loc, false)
also works but prints something like:Got NPE for node String catalog org.rascalmpl.library.lang.java.m3.internal.ASTConverter.resolveType(ASTConverter.java:154)
However, it does work and returns the correct Declaration.