import net.sourceforge.phpeclipse.internal.compiler.ast.AbstractMethodDeclaration;
import net.sourceforge.phpeclipse.internal.compiler.ast.CompilationUnitDeclaration;
+import net.sourceforge.phpeclipse.internal.compiler.ast.ImportReference;
import net.sourceforge.phpeclipse.internal.compiler.ast.MethodDeclaration;
import net.sourceforge.phpeclipse.internal.compiler.ast.TypeDeclaration;
doc.add(Field.Keyword("filename", file.getName()));
doc.add(Field.Keyword("path", file.getProjectRelativePath().toString()));
}
+ if (computedUnit.imports != null) {
+ ImportReference imp;
+ for (int i=0; i<computedUnit.imports.length; i++) {
+ // add the php include
+ imp = computedUnit.imports[i];
+ String incl = new String(imp.includeSource);
+ doc.add(Field.Keyword("i", incl));
+ doc.add(Field.UnIndexed(incl, "include meta-info"));
+ }
+ }
if (computedUnit.types != null) {
Object obj;
MethodDeclaration m;
TypeDeclaration c;
- for (int i = computedUnit.types.size(); --i >= 0;) {
+ for (int i=0; i<computedUnit.types.size(); i++) {
obj = computedUnit.types.get(i);
if (obj instanceof MethodDeclaration) {
m = (MethodDeclaration) obj;
// add the php function name
String function = new String(m.selector);
doc.add(Field.Keyword("f", function));
- doc.add(Field.UnIndexed(function, "class meta-info"));
+ doc.add(Field.UnIndexed(function, "function meta-info"));
} else if (obj instanceof TypeDeclaration) {
c = (TypeDeclaration) obj;
// add the class-name