use of com.intellij.usages.UsageInfo2UsageAdapter in project intellij-community by JetBrains.
the class UsageSerializable method serializeMe.
@Override
public void serializeMe(UsageInfo info, StringBuilder os) throws IOException {
//final SmartPsiElementPointer<?> pointer = info.getSmartPointer();
final GenericElementSignatureProvider provider = new GenericElementSignatureProvider();
final String signature = provider.getSignature(info.getElement());
append(os, info.getFile().getVirtualFile().getPath());
os.append(separator);
append(os, signature);
os.append(separator);
final ProperTextRange rangeInElement = info.getRangeInElement();
if (rangeInElement == null) {
append(os, "-1");
os.append(separator);
append(os, "-1");
os.append(separator);
} else {
append(os, String.valueOf(rangeInElement.getStartOffset()));
os.append(separator);
append(os, String.valueOf(rangeInElement.getEndOffset()));
os.append(separator);
}
append(os, String.valueOf(info.isNonCodeUsage()));
os.append(separator);
append(os, String.valueOf(info.isDynamicUsage()));
os.append(separator);
final String text = new UsageInfo2UsageAdapter(info).getPlainText();
append(os, text);
os.append(separator);
}
Aggregations