Specify languages in kdoc code fragments
MODIFY
leakcanary-android-core/src/main/java/leakcanary/LeakCanary.kt
leakcanary-android-core/src/main/java/leakcanary/LeakCanary.kt
@@ -158,7 +158,7 @@ object LeakCanary {
*
* The list of filters can be built from [AndroidObjectInspectors]:
*
- * ```
+ * ```kotlin
* LeakCanary.config = LeakCanary.config.copy(
* leakingObjectFinder = FilteringLeakingObjectFinder(
* AndroidObjectInspectors.appLeakingObjectFilters
@@ -188,7 +188,7 @@ object LeakCanary {
* Builder for [LeakCanary.Config] intended to be used only from Java code.
*
* Usage:
- * ```
+ * ```kotlin
* LeakCanary.Config config = LeakCanary.getConfig().newBuilder()
* .retainedVisibleThreshold(3)
* .build();
@@ -196,7 +196,7 @@ object LeakCanary {
* ```
*
* For idiomatic Kotlin use `copy()` method instead:
- * ```
+ * ```kotlin
* LeakCanary.config = LeakCanary.config.copy(retainedVisibleThreshold = 3)
* ```
*/
@@ -278,12 +278,12 @@ object LeakCanary {
* The current LeakCanary configuration. Can be updated at any time, usually by replacing it with
* a mutated copy, e.g.:
*
- * ```
+ * ```kotlin
* LeakCanary.config = LeakCanary.config.copy(retainedVisibleThreshold = 3)
* ```
*
* In Java, use [LeakCanary.Config.Builder] instead:
- * ```
+ * ```java
* LeakCanary.Config config = LeakCanary.getConfig().newBuilder()
* .retainedVisibleThreshold(3)
* .build();
@@ -330,7 +330,7 @@ object LeakCanary {
* Note: you can change the default value by overriding the `leak_canary_add_launcher_icon`
* boolean resource:
*
- * ```
+ * ```xml
* <?xml version="1.0" encoding="utf-8"?>
* <resources>
* <bool name="leak_canary_add_launcher_icon">false</bool>

MODIFY
leakcanary-android-instrumentation/src/main/java/leakcanary/InstrumentationLeakDetector.kt
leakcanary-android-instrumentation/src/main/java/leakcanary/InstrumentationLeakDetector.kt
@@ -55,7 +55,7 @@ import java.io.File
* your command line for running the UI tests:
* `-e listener leakcanary.FailTestOnLeakRunListener`. The full command line
* should look something like this:
- * ```
+ * ```shell
* adb shell am instrument \\
* -w com.android.foo/android.support.test.runner.AndroidJUnitRunner \\
* -e listener leakcanary.FailTestOnLeakRunListener

MODIFY
leakcanary-deobfuscation-gradle-plugin/src/main/java/com/squareup/leakcanary/deobfuscation/LeakCanaryDeobfuscationExtension.kt
leakcanary-deobfuscation-gradle-plugin/src/main/java/com/squareup/leakcanary/deobfuscation/LeakCanaryDeobfuscationExtension.kt
@@ -25,7 +25,7 @@ open class LeakCanaryDeobfuscationExtension {
/**
* Variant filtering function. It should be overriden to tell LeakCanary for which obfuscated
* variants it should copy the mapping file into apk. For example this:
- * ```
+ * ```kotlin
* filterObfuscatedVariants { variant ->
* variant.name == "debug"
* }

MODIFY
leakcanary-object-watcher-android/src/main/java/leakcanary/AppWatcher.kt
leakcanary-object-watcher-android/src/main/java/leakcanary/AppWatcher.kt
@@ -53,7 +53,7 @@ object AppWatcher {
* first disable the automatic call by overriding the `leak_canary_watcher_auto_install` boolean
* resource:
*
- * ```
+ * ```xml
* <?xml version="1.0" encoding="utf-8"?>
* <resources>
* <bool name="leak_canary_watcher_auto_install">false</bool>
@@ -62,7 +62,7 @@ object AppWatcher {
*
* [watchersToInstall] can be customized to a subset of the default app watchers:
*
- * ```
+ * ```kotlin
* val watchersToInstall = AppWatcher.appDefaultWatchers(application)
* .filter { it !is RootViewWatcher }
* AppWatcher.manualInstall(
@@ -74,7 +74,7 @@ object AppWatcher {
* [watchersToInstall] can also be customized to ignore specific instances (e.g. here ignoring
* leaks of BadSdkLeakingFragment):
*
- * ```
+ * ```kotlin
* val watchersToInstall = AppWatcher.appDefaultWatchers(application, ReachabilityWatcher { watchedObject, description ->
* if (watchedObject !is BadSdkLeakingFragment) {
* AppWatcher.objectWatcher.expectWeaklyReachable(watchedObject, description)

Specify languages in kdoc code fragments