Search in sources :

Example 1 with GenericElementSignatureProvider

use of com.intellij.codeInsight.folding.impl.GenericElementSignatureProvider 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);
}
Also used : ProperTextRange(com.intellij.openapi.util.ProperTextRange) UsageInfo2UsageAdapter(com.intellij.usages.UsageInfo2UsageAdapter) GenericElementSignatureProvider(com.intellij.codeInsight.folding.impl.GenericElementSignatureProvider)

Aggregations

GenericElementSignatureProvider (com.intellij.codeInsight.folding.impl.GenericElementSignatureProvider)1 ProperTextRange (com.intellij.openapi.util.ProperTextRange)1 UsageInfo2UsageAdapter (com.intellij.usages.UsageInfo2UsageAdapter)1