From 537655a4c24af56f671eea3fe195dc35084e2a8c Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 29 Jun 2018 11:58:28 +0300 Subject: [PATCH] KotlinInspectionSuppressor: introduce more precise quick-fix names Related to KT-11154, KT-25169 --- .../kotlin/idea/inspections/KotlinInspectionSuppressor.kt | 2 ++ idea/testData/quickfix/suppress/external/suppressAvailable.kt | 3 ++- .../quickfix/suppress/external/suppressAvailable.kt.after | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/inspections/KotlinInspectionSuppressor.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/inspections/KotlinInspectionSuppressor.kt index 9cb42fd87b9..a79db4063b2 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/inspections/KotlinInspectionSuppressor.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/inspections/KotlinInspectionSuppressor.kt @@ -22,6 +22,8 @@ class KotlinInspectionSuppressor : InspectionSuppressor { object : SuppressQuickFix { override fun getFamilyName() = it.familyName + override fun getName() = it.text + override fun applyFix(project: Project, descriptor: ProblemDescriptor) = it.invoke(project, null, descriptor.psiElement) override fun isAvailable(project: Project, context: PsiElement) = it.isAvailable(project, null, context) diff --git a/idea/testData/quickfix/suppress/external/suppressAvailable.kt b/idea/testData/quickfix/suppress/external/suppressAvailable.kt index e7e5b49a53d..6fa33be07d9 100644 --- a/idea/testData/quickfix/suppress/external/suppressAvailable.kt +++ b/idea/testData/quickfix/suppress/external/suppressAvailable.kt @@ -1,4 +1,4 @@ -// "Suppress Warnings" "true" +// "Suppress 'SpellCheckingInspection' for val str" "true" // TOOL: com.intellij.spellchecker.inspections.SpellCheckingInspection // ACTION: Add 'const' modifier // ACTION: Typo: Change to... @@ -12,5 +12,6 @@ // ACTION: Convert property initializer to getter // ACTION: Inject language or reference // ACTION: To raw string literal +// ACTION: Suppress 'SpellCheckingInspection' for file suppressAvailable.kt val str = "kjsghkjshtiurhuig" \ No newline at end of file diff --git a/idea/testData/quickfix/suppress/external/suppressAvailable.kt.after b/idea/testData/quickfix/suppress/external/suppressAvailable.kt.after index 8fa8b38296c..ea3e174503c 100644 --- a/idea/testData/quickfix/suppress/external/suppressAvailable.kt.after +++ b/idea/testData/quickfix/suppress/external/suppressAvailable.kt.after @@ -1,4 +1,4 @@ -// "Suppress Warnings" "true" +// "Suppress 'SpellCheckingInspection' for val str" "true" // TOOL: com.intellij.spellchecker.inspections.SpellCheckingInspection // ACTION: Add 'const' modifier // ACTION: Typo: Change to... @@ -12,6 +12,7 @@ // ACTION: Convert property initializer to getter // ACTION: Inject language or reference // ACTION: To raw string literal +// ACTION: Suppress 'SpellCheckingInspection' for file suppressAvailable.kt @Suppress("SpellCheckingInspection") val str = "kjsghkjshtiurhuig" \ No newline at end of file