mirror of
https://github.com/revanced/smali.git
synced 2025-05-05 00:54:25 +02:00
Ensure that SmaliCodeFragmentFactory is only used for smali files
This commit is contained in:
parent
4f16feb476
commit
93ae7badcd
@ -53,6 +53,7 @@ import com.sun.tools.jdi.LocationImpl;
|
||||
import org.jf.dexlib2.analysis.AnalyzedInstruction;
|
||||
import org.jf.dexlib2.analysis.RegisterType;
|
||||
import org.jf.smalidea.SmaliFileType;
|
||||
import org.jf.smalidea.SmaliLanguage;
|
||||
import org.jf.smalidea.psi.impl.SmaliInstruction;
|
||||
import org.jf.smalidea.psi.impl.SmaliMethod;
|
||||
|
||||
@ -66,6 +67,11 @@ public class SmaliCodeFragmentFactory extends DefaultCodeFragmentFactory {
|
||||
return super.createCodeFragment(item, wrapContext(project, context), project);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isContextAccepted(PsiElement contextElement) {
|
||||
return contextElement.getLanguage() == SmaliLanguage.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaCodeFragment createPresentationCodeFragment(TextWithImports item, PsiElement context, Project project) {
|
||||
return super.createPresentationCodeFragment(item, wrapContext(project, context), project);
|
||||
|
Loading…
x
Reference in New Issue
Block a user