mirror of
https://github.com/revanced/smali.git
synced 2025-05-07 18:04:32 +02:00
Workaround for issue with fake Object field type during indexing
This commit is contained in:
parent
4bc2334c39
commit
660d4b5fd9
@ -32,6 +32,8 @@
|
||||
package org.jf.smalidea.psi.stub.element;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.psi.PsiTypeElement;
|
||||
import com.intellij.psi.stubs.IndexSink;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.psi.stubs.StubInputStream;
|
||||
@ -62,7 +64,20 @@ public class SmaliFieldElementType extends SmaliStubElementType<SmaliFieldStub,
|
||||
}
|
||||
|
||||
@Override public SmaliFieldStub createStub(@NotNull SmaliField psi, StubElement parentStub) {
|
||||
return new SmaliFieldStub(parentStub, psi.getName(), psi.getType().getCanonicalText());
|
||||
try {
|
||||
String fieldType;
|
||||
PsiTypeElement typeElement = psi.getTypeElement();
|
||||
if (typeElement != null) {
|
||||
fieldType = typeElement.getType().getCanonicalText();
|
||||
} else {
|
||||
fieldType = "java.lang.Object";
|
||||
}
|
||||
|
||||
return new SmaliFieldStub(parentStub, psi.getName(), fieldType);
|
||||
} catch (IndexNotReadyException ex) {
|
||||
System.out.println(psi.getName());
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user