CleanroomMC/GroovyScript

Non-.groovy file extensions are logged differently

Closed this issue · 0 comments

in GroovyLogImpl the regex only looks for files matching .groovy instead of any of the options in the run config, meaning non-.groovy extensions are not equally supported.
should only be a minor concern, since not matching just means it gets logged in a different way (at x.run(x.gvy:3) vs in test.groovy in line 3)

Pattern pattern = Pattern.compile("(\\w*).run\\(\\1.groovy:(\\d*)\\)");
for (String line : prepareStackTrace(throwable.getStackTrace())) {
Matcher matcher = pattern.matcher(line);
if (matcher.matches()) {
writeLogLine("\t\tin " + matcher.group(1) + ".groovy in line " + matcher.group(2));
} else {
writeLogLine("\t\tat " + line);
}
}

public static final String[] GROOVY_SUFFIXES = {".groovy", ".gvy", ".gy", ".gsh"};