FieldDeclaration not included in Outline view [message #25175] |
Mon, 09 June 2008 19:37 |
Eclipse User |
|
|
|
I investigated this and discovered that:
a) FieldDeclaration was/is intended to be converted to a SourceField
model element.
b) That conversion does not take place in the existing DLTK code or in
the Python example code (it may happen for other languages).
To fix this, I made these changes to my subclass of
SourceElementRequestVisitor
1) Added:
a)
public boolean visit(FieldDeclaration field) throws Exception {
this.fNodes.push(field);
ISourceElementRequestor.FieldInfo fi = new
ISourceElementRequestor.FieldInfo();
fi.name = field.getName();
fi.modifiers = field.getModifiers();
fi.nameSourceStart = field.getNameStart();
fi.nameSourceEnd = field.getNameEnd() - 1;
fi.declarationStart = field.sourceStart();
this.fRequestor.enterField(fi);
return true;
}
b)
public boolean endvisit(FieldDeclaration field) throws Exception {
this.fRequestor.exitField(field.sourceEnd());
this.fNodes.pop();
return true;
}
2) Modified:
public boolean visit(Statement statement) throws Exception {
boolean retValue = true;
if (statement instanceof FieldDeclaration) {
retValue = visit((FieldDeclaration)statement);
}
return retValue;
}
3) Modified:
public boolean endvisit(Statement s) throws Exception {
boolean retVal = true;
if (s instanceof FieldDeclaration) {
retVal = endvisit((FieldDeclaration)s);
}
return retVal;
}
Chuck
|
|
|
Powered by
FUDForum. Page generated in 0.02378 seconds