mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] missing kdoc inspection: skip functional parameters, they can't have explicit kdocs on them
^KTIJ-35899 fixed GitOrigin-RevId: f9a88b5c281675d30b56850e8991578de5ae04bc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
49ce77ebcb
commit
eb41f6abd9
+5
@@ -9195,6 +9195,11 @@ public abstract class HighLevelQuickFixTestGenerated extends AbstractHighLevelQu
|
||||
runTest("../../../idea/tests/testData/quickfix/kdocMissingDocumentation/funWithKDoc.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionalParameter.kt")
|
||||
public void testFunctionalParameter() throws Exception {
|
||||
runTest("../../../idea/tests/testData/quickfix/kdocMissingDocumentation/functionalParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalFun.kt")
|
||||
public void testInternalFun() throws Exception {
|
||||
runTest("../../../idea/tests/testData/quickfix/kdocMissingDocumentation/internalFun.kt");
|
||||
|
||||
+5
-2
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.idea.kdoc.findKDocByPsi
|
||||
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.psi.KtVisitor
|
||||
import org.jetbrains.kotlin.psi.namedDeclarationVisitor
|
||||
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||
@@ -36,8 +37,10 @@ internal class KDocMissingDocumentationInspection : KotlinApplicableInspectionBa
|
||||
visitTargetElement(it, holder, isOnTheFly)
|
||||
}
|
||||
|
||||
override fun isApplicableByPsi(element: KtNamedDeclaration): Boolean =
|
||||
!TestUtils.isInTestSourceContent(element) && element.findKDocByPsi() == null
|
||||
override fun isApplicableByPsi(element: KtNamedDeclaration): Boolean {
|
||||
if (element is KtParameter && element.isFunctionTypeParameter) return false
|
||||
return !TestUtils.isInTestSourceContent(element) && element.findKDocByPsi() == null
|
||||
}
|
||||
|
||||
override fun getApplicableRanges(element: KtNamedDeclaration): List<TextRange> =
|
||||
ApplicabilityRanges.declarationName(element)
|
||||
|
||||
+5
@@ -11002,6 +11002,11 @@ public abstract class K1QuickFixTestGenerated extends AbstractK1QuickFixTest {
|
||||
runTest("testData/quickfix/kdocMissingDocumentation/funWithKDoc.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionalParameter.kt")
|
||||
public void testFunctionalParameter() throws Exception {
|
||||
runTest("testData/quickfix/kdocMissingDocumentation/functionalParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalFun.kt")
|
||||
public void testInternalFun() throws Exception {
|
||||
runTest("testData/quickfix/kdocMissingDocumentation/internalFun.kt");
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// "Add documentation" "false"
|
||||
|
||||
val p: (<caret>s: String) -> Boolean = { true }
|
||||
Reference in New Issue
Block a user