Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » FieldDeclaration not included in Outline view
FieldDeclaration not included in Outline view [message #25175] Mon, 09 June 2008 23:37
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
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
Previous Topic:Ruby module in DLTK
Next Topic:Remote Launch Configuration Tab
Goto Forum:
  


Current Time: Sat Jul 27 09:58:31 GMT 2024

Powered by FUDForum. Page generated in 0.03562 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top