Commit 41e5378f authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Fixed handling of class inheritance for doc comments


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 988764b5
......@@ -627,13 +627,15 @@ public final class ClassTypeBody extends TTCN3Scope implements IReferenceChainEl
content.addText("<b>" + def.getIdentifier().getDisplayName() + "</b>");
if (isOverride) {
content.addStyledText(" (overridden)", SWT.ITALIC);
} else if (def.isInherited()) {
content.addStyledText(" (inherited)", SWT.ITALIC);
if (def.getMyScope() instanceof ClassTypeBody) {
final ClassTypeBody parentBody = (ClassTypeBody)def.getMyScope();
if (! parentBody.equals(this)) {
final Class_Type parentClass = parentBody.getMyType();
final Def_Type parentType = (Def_Type)parentClass.getNameParent();
} else {
if (isDefintionInherited(def)) {
content.addStyledText(" (inherited)", SWT.ITALIC);
}
final ClassTypeBody parentBody = (ClassTypeBody)def.getNameParent();
if (! parentBody.equals(this)) {
final Class_Type parentClass = parentBody.getMyType();
final Def_Type parentType = (Def_Type)parentClass.getNameParent();
if (parentType.hasDocumentComment()) {
final Map<String,String> parentMembers = parentType.getDocumentComment().getMembers();
if (parentMembers != null) {
memberText = parentMembers.get(id);
......@@ -660,4 +662,13 @@ public final class ClassTypeBody extends TTCN3Scope implements IReferenceChainEl
return maxoffset + 1;
}
/**
* Checks if the given definition is inherited
* @param definition
* @return
*/
public boolean isDefintionInherited(Definition definition) {
return extendsGainedDefinitions.containsKey(definition.getIdentifier().getDisplayName());
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment