in intellij-feature-extractor/src/main/java/com/jetbrains/intellij/feature/extractor/extractor/FileTypeFactoryExtractor.kt [258:285]
fun tryParseExtensionMatcher(): String? {
val oldPos = pos
val new = instructions[pos++]
if (new is TypeInsnNode && new.desc == EXTENSIONS_MATCHER) {
if (instructions[pos++].opcode == DUP) {
val argumentInsn = instructions[pos++]
if (argumentInsn.opcode == Opcodes.LDC || argumentInsn.opcode == Opcodes.GETSTATIC) {
val initInvoke = instructions[pos]
val frame = frames[pos]
pos++
if (initInvoke is MethodInsnNode
&& initInvoke.name == "<init>"
&& initInvoke.owner == EXTENSIONS_MATCHER
&& initInvoke.desc == "(Ljava/lang/String;)V"
) {
val string = CodeAnalysis().evaluateConstantString(method, frames, frame.getOnStack(0))
if (string != null) {
return "*.$string"
}
}
}
}
}
pos = oldPos
return null
}