fix javadoc injection
This commit is contained in:
parent
333d5889b7
commit
35afc6a296
|
@ -97,7 +97,7 @@ class PhytotelmaPlugin : Plugin<Project> {
|
||||||
IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES to "1",
|
IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES to "1",
|
||||||
IFernflowerPreferences.BYTECODE_SOURCE_MAPPING to "1",
|
IFernflowerPreferences.BYTECODE_SOURCE_MAPPING to "1",
|
||||||
IFernflowerPreferences.REMOVE_SYNTHETIC to "1",
|
IFernflowerPreferences.REMOVE_SYNTHETIC to "1",
|
||||||
IFernflowerPreferences.LOG_LEVEL to "warn",
|
IFernflowerPreferences.LOG_LEVEL to "error",
|
||||||
IFernflowerPreferences.THREADS to Runtime.getRuntime().availableProcessors().toString(),
|
IFernflowerPreferences.THREADS to Runtime.getRuntime().availableProcessors().toString(),
|
||||||
IFernflowerPreferences.INDENT_STRING to "\t"
|
IFernflowerPreferences.INDENT_STRING to "\t"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,18 +8,18 @@ import org.jetbrains.java.decompiler.struct.StructMethod
|
||||||
|
|
||||||
class ParchmentJavadocProvider(private val parchment: Parchment) : IFabricJavadocProvider {
|
class ParchmentJavadocProvider(private val parchment: Parchment) : IFabricJavadocProvider {
|
||||||
override fun getClassDoc(structClass: StructClass): String? {
|
override fun getClassDoc(structClass: StructClass): String? {
|
||||||
return parchment.getClass(structClass.qualifiedName).orElse(null)?.javadoc?.joinToString { "\n" }
|
return parchment.getClass(structClass.qualifiedName).orElse(null)?.javadoc?.joinToString("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getFieldDoc(structClass: StructClass, structField: StructField): String? {
|
override fun getFieldDoc(structClass: StructClass, structField: StructField): String? {
|
||||||
return parchment.getClass(structClass.qualifiedName)
|
return parchment.getClass(structClass.qualifiedName)
|
||||||
.flatMap { it.getField(structField.name, structField.descriptor) }
|
.flatMap { it.getField(structField.name, structField.descriptor) }
|
||||||
.orElse(null)?.javadoc?.joinToString { "\n" }
|
.orElse(null)?.javadoc?.joinToString("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getMethodDoc(structClass: StructClass, structMethod: StructMethod): String? {
|
override fun getMethodDoc(structClass: StructClass, structMethod: StructMethod): String? {
|
||||||
return parchment.getClass(structClass.qualifiedName)
|
return parchment.getClass(structClass.qualifiedName)
|
||||||
.flatMap { it.getMethod(structMethod.name, structMethod.descriptor) }
|
.flatMap { it.getMethod(structMethod.name, structMethod.descriptor) }
|
||||||
.orElse(null)?.javadoc?.joinToString { "\n" }
|
.orElse(null)?.javadoc?.joinToString("\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue