ParserManager.parse(Collections.singleton(source), new UserTask() {
@Override
public void run(ResultIterator ri) throws Exception {
ScalaParserResult pResult = (ScalaParserResult) ri.getParserResult(offset);
String clzFqn = ScalaSourceUtil.getBinaryClassName(pResult, lineNumber);
if (clzFqn == null) {
ErrorManager.getDefault().log(
ErrorManager.WARNING,
"No enclosing class for " + pResult.getSnapshot().getSource().getFileObject() + ", offset = " + offset);
result[0] = "";
} else {
result[0] = clzFqn;
}
}