mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 22:35:43 +02:00
Patch for Dave Daoust: Fixes up the string demangling in IEntryResult + IndexerView
This commit is contained in:
parent
ebffc66e0d
commit
fae118c182
4 changed files with 43 additions and 6 deletions
|
@ -28,6 +28,8 @@ public interface IEntryResult {
|
||||||
public int getRefKind();
|
public int getRefKind();
|
||||||
public String getName();
|
public String getName();
|
||||||
|
|
||||||
|
public String getDisplayString();
|
||||||
|
|
||||||
public String getStringMetaKind();
|
public String getStringMetaKind();
|
||||||
public String getStringKind();
|
public String getStringKind();
|
||||||
public String getStringRefKind();
|
public String getStringRefKind();
|
||||||
|
|
|
@ -196,5 +196,38 @@ public String getStringRefKind() {
|
||||||
return String.valueOf(ICIndexStorageConstants.encodingTypes[reftype]);
|
return String.valueOf(ICIndexStorageConstants.encodingTypes[reftype]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDisplayString() {
|
||||||
|
switch (meta_type) {
|
||||||
|
case IIndex.FUNCTION:
|
||||||
|
case IIndex.METHOD:
|
||||||
|
int startReturn = longname.indexOf(")R/"); //$NON-NLS-1$
|
||||||
|
int finishReturn = longname.indexOf("/R("); //$NON-NLS-1$
|
||||||
|
int startParam = longname.indexOf(")/"); //$NON-NLS-1$
|
||||||
|
int finishParam = longname.indexOf("/("); //$NON-NLS-1$
|
||||||
|
|
||||||
|
String functionName;
|
||||||
|
String arguments = longname.substring(startParam + 2, finishParam);
|
||||||
|
|
||||||
|
// TODO: flip arguments
|
||||||
|
arguments = arguments.replace('/',',');
|
||||||
|
|
||||||
|
arguments = '(' + arguments + ')';
|
||||||
|
|
||||||
|
if (startReturn == -1 || finishReturn == -1) {
|
||||||
|
// there is no return type !!!
|
||||||
|
functionName = longname.substring(0, startParam -1);
|
||||||
|
return functionName + arguments ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
String returnType = longname.substring(startReturn + 3, finishReturn);
|
||||||
|
functionName = longname.substring(0, startReturn -1);
|
||||||
|
return functionName + arguments + ':' + returnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return longname;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,8 @@ public class IndexerNodeLeaf implements IAdaptable {
|
||||||
private class IndexerPropertySource implements IPropertySource {
|
private class IndexerPropertySource implements IPropertySource {
|
||||||
|
|
||||||
private static final String IENTRYRESULT = "IEntryResult"; //$NON-NLS-1$
|
private static final String IENTRYRESULT = "IEntryResult"; //$NON-NLS-1$
|
||||||
private static final String NAME = "Name"; //$NON-NLS-1$
|
private static final String NAME = "Encoded Name"; //$NON-NLS-1$
|
||||||
|
private static final String DNAME = "Display Name"; //$NON-NLS-1$
|
||||||
private static final String IENTRYRESULT_GETWORD__ = "IEntryResult#getWord()"; //$NON-NLS-1$
|
private static final String IENTRYRESULT_GETWORD__ = "IEntryResult#getWord()"; //$NON-NLS-1$
|
||||||
private static final String REFS = "References"; //$NON-NLS-1$
|
private static final String REFS = "References"; //$NON-NLS-1$
|
||||||
private static final String OFFSETS_LINE = "Line "; //$NON-NLS-1$
|
private static final String OFFSETS_LINE = "Line "; //$NON-NLS-1$
|
||||||
|
@ -111,7 +112,11 @@ public class IndexerNodeLeaf implements IAdaptable {
|
||||||
text = new TextPropertyDescriptor(new TextDescriptorId(NAME, entryResult.getName()), NAME);
|
text = new TextPropertyDescriptor(new TextDescriptorId(NAME, entryResult.getName()), NAME);
|
||||||
text.setCategory(IENTRYRESULT);
|
text.setCategory(IENTRYRESULT);
|
||||||
descriptors = (IPropertyDescriptor[])ArrayUtil.append(IPropertyDescriptor.class, descriptors, text);
|
descriptors = (IPropertyDescriptor[])ArrayUtil.append(IPropertyDescriptor.class, descriptors, text);
|
||||||
|
|
||||||
|
text = new TextPropertyDescriptor(new TextDescriptorId(DNAME, entryResult.getDisplayString()), DNAME);
|
||||||
|
text.setCategory(IENTRYRESULT);
|
||||||
|
descriptors = (IPropertyDescriptor[])ArrayUtil.append(IPropertyDescriptor.class, descriptors, text);
|
||||||
|
|
||||||
// add IEntryResult
|
// add IEntryResult
|
||||||
text = new TextPropertyDescriptor(new TextDescriptorId("MetaKind", entryResult.getStringMetaKind()), "MetaKind");
|
text = new TextPropertyDescriptor(new TextDescriptorId("MetaKind", entryResult.getStringMetaKind()), "MetaKind");
|
||||||
text.setCategory(IENTRYRESULT);
|
text.setCategory(IENTRYRESULT);
|
||||||
|
@ -174,7 +179,7 @@ public class IndexerNodeLeaf implements IAdaptable {
|
||||||
if (!parent.isDisplayFullName())
|
if (!parent.isDisplayFullName())
|
||||||
return getShortName();
|
return getShortName();
|
||||||
|
|
||||||
return getName();
|
return result.getDisplayString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFiltersType() {
|
public int getFiltersType() {
|
||||||
|
|
|
@ -73,9 +73,6 @@ public class IndexerViewPluginImages {
|
||||||
"union_obj.gif",
|
"union_obj.gif",
|
||||||
"derived.gif",
|
"derived.gif",
|
||||||
"friend.gif",
|
"friend.gif",
|
||||||
"fwd_class.gif",
|
|
||||||
"fwd_struct.gif",
|
|
||||||
"fwd_union.gif",
|
|
||||||
"include_obj.gif"
|
"include_obj.gif"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue