Search in sources :

Example 1 with BaseFileObject

use of org.eclipse.ceylon.langtools.tools.javac.file.BaseFileObject in project ceylon by eclipse.

the class AbstractDiagnosticFormatter method formatSource.

public String formatSource(JCDiagnostic d, boolean fullname, Locale l) {
    JavaFileObject fo = d.getSource();
    if (fo == null)
        // d should have source set
        throw new IllegalArgumentException();
    String name;
    if (fullname)
        name = fo.getName();
    else if (fo instanceof BaseFileObject)
        name = ((BaseFileObject) fo).getShortName();
    else
        name = BaseFileObject.getSimpleName(fo);
    return OSUtil.color(name, OSUtil.Color.blue);
}
Also used : JavaFileObject(org.eclipse.ceylon.javax.tools.JavaFileObject) BaseFileObject(org.eclipse.ceylon.langtools.tools.javac.file.BaseFileObject)

Aggregations

JavaFileObject (org.eclipse.ceylon.javax.tools.JavaFileObject)1 BaseFileObject (org.eclipse.ceylon.langtools.tools.javac.file.BaseFileObject)1