mirror of
https://github.com/revanced/smali.git
synced 2025-05-19 23:47:06 +02:00
Add smali classes to the main shortname index
This ensures the classes are available for autocompletion, e.g. in a java file or while adding a watch when debugging
This commit is contained in:
parent
48aacd2c01
commit
312921148d
@ -48,4 +48,15 @@ public class SmaliClassStatementStub extends StubBase<SmaliClassStatement> {
|
||||
@Nullable public String getQualifiedName() {
|
||||
return qualifiedName;
|
||||
}
|
||||
|
||||
@Nullable public String getName() {
|
||||
if (qualifiedName == null) {
|
||||
return null;
|
||||
}
|
||||
int lastDot = qualifiedName.lastIndexOf('.');
|
||||
if (lastDot < 0) {
|
||||
return qualifiedName;
|
||||
}
|
||||
return qualifiedName.substring(lastDot+1);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
package org.jf.smalidea.psi.stub.element;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.impl.java.stubs.index.JavaStubIndexKeys;
|
||||
import com.intellij.psi.stubs.IndexSink;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.psi.stubs.StubInputStream;
|
||||
@ -86,6 +87,11 @@ public class SmaliClassElementType extends SmaliStubElementType<SmaliClassStub,
|
||||
if (qualifiedName != null) {
|
||||
sink.occurrence(SmaliClassNameIndex.KEY, qualifiedName);
|
||||
}
|
||||
|
||||
final String shortName = smaliClassStatementStub.getName();
|
||||
if (shortName != null) {
|
||||
sink.occurrence(JavaStubIndexKeys.CLASS_SHORT_NAMES, shortName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user