as31: Drop custom Kotlin Android lint, register quickfixes with extension point

This commit is contained in:
Vyacheslav Gerasimov
2017-05-04 15:54:08 +03:00
committed by Nikolay Krasko
parent 686d8a1756
commit 11ee744340
232 changed files with 869 additions and 9570 deletions
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add Parcelable Implementation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintParcelCreatorInspection
import android.os.Parcel
import android.os.Parcelable
class <caret>MissingCreator : Parcelable {
override fun writeToParcel(dest: Parcel?, flags: Int) {
TODO("not implemented")
}
override fun describeContents(): Int {
TODO("not implemented")
}
}
@@ -0,0 +1,5 @@
// INTENTION_TEXT: Add Parcelable Implementation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintParcelCreatorInspection
import android.os.Parcelable
class <caret>NoImplementation : Parcelable
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@SomeAnnotationWithClass(<caret>VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
companion object {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>VectorDrawable()) {
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class MyVectorDrawable : <caret>VectorDrawable() {
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @RequiresApi(KITKAT) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintInlinedApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
class Test {
fun foo(): Int {
return android.R.attr.<caret>windowTranslucentStatus
}
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> <caret>VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
import android.app.Activity
import android.os.Environment
class MainActivity : Activity() {
fun getSdCard(fromEnvironment: Boolean) = if (fromEnvironment) Environment.getExternalStorageDirectory().path else "<caret>/sdcard"
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
import android.annotation.SuppressLint
import android.app.Activity
import android.os.Environment
class MainActivity : Activity() {
@SuppressLint("Something")
fun getSdCard(fromEnvironment: Boolean) = if (fromEnvironment) Environment.getExternalStorageDirectory().path else "<caret>/sdcard"
}
@@ -0,0 +1,4 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
class SdCard(val path: String = "<caret>/sdcard")
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
fun foo() {
val (a: String, b: String) = "<caret>/sdcard"
}
operator fun CharSequence.component1(): String = "component1"
operator fun CharSequence.component2(): String = "component2"
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
fun foo(l: Any) = l
fun bar() {
foo() {
"<caret>/sdcard"
}
}
@@ -0,0 +1,6 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
fun foo(l: Any) = l
val bar = foo() { "<caret>/sdcard" }
@@ -0,0 +1,4 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
fun foo(path: String = "<caret>/sdcard") = path
@@ -0,0 +1,4 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
val getPath = { "<caret>/sdcard" }
@@ -0,0 +1,4 @@
// INTENTION_TEXT: Suppress: Add @SuppressLint("SdCardPath") annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintSdCardPathInspection
val path = "<caret>/sdcard"
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@SomeAnnotationWithClass(<caret>VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
companion object {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>VectorDrawable()) {
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class MyVectorDrawable : <caret>VectorDrawable() {
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(KITKAT) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintInlinedApiInspection
class Test {
fun foo(): Int {
return android.R.attr.<caret>windowTranslucentStatus
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> <caret>VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INTENTION_NOT_AVAILABLE
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@SomeAnnotationWithClass(<caret>VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INTENTION_NOT_AVAILABLE
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>VectorDrawable()) {
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable = <caret>VectorDrawable()
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
if (flag)
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
if (flag) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintInlinedApiInspection
class Test {
fun foo(): Int {
return android.R.attr.<caret>windowTranslucentStatus
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> <caret>VectorDrawable()
else -> VectorDrawable()
}
}
}