diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml
index 70b17f54617..1e2daceba9e 100644
--- a/idea/src/META-INF/plugin.xml
+++ b/idea/src/META-INF/plugin.xml
@@ -512,7 +512,7 @@
language="kotlin"
implementationClass="org.jetbrains.kotlin.idea.refactoring.rename.KotlinResolveSnapshotProvider"/>
-
+
diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/spellchecker/KotlinSpellcheckingStrategy.kt b/idea/src/org/jetbrains/kotlin/idea/codeInsight/spellchecker/KotlinSpellcheckingStrategy.kt
index 85b1360213f..dbcbfaf1646 100644
--- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/spellchecker/KotlinSpellcheckingStrategy.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/spellchecker/KotlinSpellcheckingStrategy.kt
@@ -14,33 +14,40 @@
* limitations under the License.
*/
-package org.jetbrains.kotlin.idea
+package org.jetbrains.kotlin.idea.codeInsight.spellchecker
-import com.intellij.codeInspection.SuppressQuickFix
import com.intellij.psi.PsiComment
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiNameIdentifierOwner
import com.intellij.spellchecker.inspections.PlainTextSplitter
import com.intellij.spellchecker.tokenizer.SpellcheckingStrategy
-import com.intellij.spellchecker.tokenizer.SuppressibleSpellcheckingStrategy
import com.intellij.spellchecker.tokenizer.Tokenizer
import com.intellij.spellchecker.tokenizer.TokenizerBase
-import org.jetbrains.kotlin.psi.KtLiteralStringTemplateEntry
+import org.jetbrains.kotlin.lexer.KtTokens
+import org.jetbrains.kotlin.psi.*
-class KotlinSpellcheckingStrategy: SpellcheckingStrategy() {
+class KotlinSpellcheckingStrategy : SpellcheckingStrategy() {
private val plainTextTokenizer = TokenizerBase(PlainTextSplitter.getInstance())
private val emptyTokenizer = SpellcheckingStrategy.EMPTY_TOKENIZER
override fun getTokenizer(element: PsiElement?): Tokenizer {
- @Suppress("UNCHECKED_CAST")
- return when {
- element is PsiNameIdentifierOwner || element is PsiComment ->
- super.getTokenizer(element)
-
- element is KtLiteralStringTemplateEntry -> plainTextTokenizer
-
- else ->
- emptyTokenizer
+ return when (element) {
+ is PsiComment -> super.getTokenizer(element)
+ is KtParameter -> {
+ val function = (element.parent as? KtParameterList)?.parent as? KtNamedFunction
+ when {
+ function?.hasModifier(KtTokens.OVERRIDE_KEYWORD) == true -> emptyTokenizer
+ else -> super.getTokenizer(element)
+ }
+ }
+ is PsiNameIdentifierOwner -> {
+ when {
+ element is KtModifierListOwner && element.hasModifier(KtTokens.OVERRIDE_KEYWORD) -> emptyTokenizer
+ else -> super.getTokenizer(element)
+ }
+ }
+ is KtLiteralStringTemplateEntry -> plainTextTokenizer
+ else -> emptyTokenizer
}
}
}
diff --git a/idea/testData/checker/infos/TyposInOverrideParams.kt b/idea/testData/checker/infos/TyposInOverrideParams.kt
new file mode 100644
index 00000000000..926e78009a2
--- /dev/null
+++ b/idea/testData/checker/infos/TyposInOverrideParams.kt
@@ -0,0 +1,15 @@
+abstract class Base {
+ abstract fun foo(oher: Int)
+
+ abstract val smalVal: Int
+ abstract fun smalFun()
+}
+
+class Other : Base() {
+ override fun foo(oher: Int) {
+ }
+
+ override val smalVal: Int get() = 1
+ override fun smalFun() {}
+}
+
diff --git a/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java b/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java
index a0668c4ba4f..691a520a849 100644
--- a/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java
+++ b/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java
@@ -960,6 +960,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
doTestWithInfos(fileName);
}
+ @TestMetadata("TyposInOverrideParams.kt")
+ public void testTyposInOverrideParams() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/infos/TyposInOverrideParams.kt");
+ doTestWithInfos(fileName);
+ }
+
@TestMetadata("WrapIntoRef.kt")
public void testWrapIntoRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/infos/WrapIntoRef.kt");