mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fixed hierarchy view.
This commit is contained in:
parent
7e9281e310
commit
bed6b31350
2 changed files with 25 additions and 9 deletions
|
@ -99,17 +99,32 @@ public class IndexerTypesJob2 extends IndexerJob2 {
|
||||||
addType(entry, getPathForEntry( entry ), index2ICElement( entry.getKind() ), name, entry.getEnclosingNames(), monitor);
|
addType(entry, getPathForEntry( entry ), index2ICElement( entry.getKind() ), name, entry.getEnclosingNames(), monitor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IIndex.TYPE_DERIVED :
|
|
||||||
if (name.length() != 0) { // skip anonymous structs
|
|
||||||
addSuperTypeReference(entry, name, entry.getEnclosingNames(), monitor);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IEntryResult[] typeEntries = fProjectIndex.getEntries( IIndex.TYPE, IIndex.TYPE_DERIVED, IIndex.ANY );
|
||||||
|
for( int j = 0; j < typeEntries.length; ++j )
|
||||||
|
{
|
||||||
|
if (monitor.isCanceled())
|
||||||
|
throw new InterruptedException();
|
||||||
|
|
||||||
|
IEntryResult entry = typeEntries[j];
|
||||||
|
String name = entry.extractSimpleName();
|
||||||
|
switch( entry.getKind() )
|
||||||
|
{
|
||||||
|
case IIndex.TYPE_DERIVED :
|
||||||
|
if (name.length() != 0) { // skip anonymous structs
|
||||||
|
addSuperTypeReference(entry, name, entry.getEnclosingNames(), monitor);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getPathForEntry(IEntryResult entry) {
|
private String getPathForEntry(IEntryResult entry) {
|
||||||
|
@ -176,7 +191,8 @@ public class IndexerTypesJob2 extends IndexerJob2 {
|
||||||
throw new InterruptedException();
|
throw new InterruptedException();
|
||||||
|
|
||||||
IPath path = PathUtil.getWorkspaceRelativePath(getPathForEntry( entry, i ));
|
IPath path = PathUtil.getWorkspaceRelativePath(getPathForEntry( entry, i ));
|
||||||
info.addDerivedReference(new TypeReference(path, fProject));
|
|
||||||
|
info.addDerivedReference(new TypeReference(path, fProject));
|
||||||
//
|
//
|
||||||
// // get absolute path
|
// // get absolute path
|
||||||
// IPath path = new Path(file.getPath());
|
// IPath path = new Path(file.getPath());
|
||||||
|
|
|
@ -187,16 +187,16 @@ class CTagEntry{
|
||||||
funEntry.serialize(output);
|
funEntry.serialize(output);
|
||||||
}
|
}
|
||||||
} else if (kind.equals(CTagsConsoleParser.STRUCT)){
|
} else if (kind.equals(CTagsConsoleParser.STRUCT)){
|
||||||
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_STRUCT,IIndex.DECLARATION, fullName, getModifiers(), fileNum);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_STRUCT,IIndex.DEFINITION, fullName, getModifiers(), fileNum);
|
||||||
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
||||||
typeEntry.setBaseTypes(getInherits());
|
typeEntry.setBaseTypes(getInherits());
|
||||||
typeEntry.serialize(output);
|
typeEntry.serialize(output);
|
||||||
} else if (kind.equals(CTagsConsoleParser.TYPEDEF)){
|
} else if (kind.equals(CTagsConsoleParser.TYPEDEF)){
|
||||||
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_TYPEDEF,IIndex.DECLARATION, fullName, getModifiers(), fileNum);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_TYPEDEF,IIndex.DEFINITION, fullName, getModifiers(), fileNum);
|
||||||
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
||||||
typeEntry.serialize(output);
|
typeEntry.serialize(output);
|
||||||
} else if (kind.equals(CTagsConsoleParser.UNION)){
|
} else if (kind.equals(CTagsConsoleParser.UNION)){
|
||||||
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_UNION,IIndex.DECLARATION, fullName, getModifiers(), fileNum);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_UNION,IIndex.DEFINITION, fullName, getModifiers(), fileNum);
|
||||||
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
||||||
typeEntry.serialize(output);
|
typeEntry.serialize(output);
|
||||||
} else if (kind.equals(CTagsConsoleParser.VARIABLE)){
|
} else if (kind.equals(CTagsConsoleParser.VARIABLE)){
|
||||||
|
|
Loading…
Add table
Reference in a new issue