code: private static String makeFqn( File file )
    {
      String path = file.getAbsolutePath();
      int srcIndex = path.indexOf( "src" + File.separatorChar );
      if( srcIndex >= 0 )
      {
        String fqn = path.substring( srcIndex + 4 ).replace( File.separatorChar, '.' );
        return fqn.substring( 0, fqn.lastIndexOf( '.' ) );
      }
      else
      { // the Gosu Scratchpad case
        String fqn = file.getName();
        fqn = NOPACKAGE + '.' + fqn.substring( 0, fqn.lastIndexOf( '.' ) ).replace( " ", "" );
        return fqn;
      }
    }
docs: Note this is a giant hack, we need to instead get the type name from the psiClass