diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeMetaInfo/models/CodeMetaInfo.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeMetaInfo/models/CodeMetaInfo.kt index f02720921411..02f0e5fd8901 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeMetaInfo/models/CodeMetaInfo.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeMetaInfo/models/CodeMetaInfo.kt @@ -112,8 +112,14 @@ fun createCodeMetaInfo(obj: Any, renderConfiguration: AbstractCodeMetaInfoRender } is HighlightInfo -> { val codeMetaInfo: CodeMetaInfo = when(renderConfiguration) { - is HighlightingConfiguration -> HighlightingCodeMetaInfo(renderConfiguration, obj) - is FileLevelHighlightingConfiguration -> FileLevelHighlightingCodeMetaInfo(renderConfiguration, obj) + is HighlightingConfiguration -> { + if (obj.isFileLevelAnnotation) return emptyList() + HighlightingCodeMetaInfo(renderConfiguration, obj) + } + is FileLevelHighlightingConfiguration -> { + if (!obj.isFileLevelAnnotation) return emptyList() + FileLevelHighlightingCodeMetaInfo(renderConfiguration, obj) + } else -> error(errorMessage()) } diff --git a/plugins/kotlin/idea/tests/testData/highlighterMetaInfo/mismatchPackageDirectoryFileLevelProblem.kt.highlighting.k2 b/plugins/kotlin/idea/tests/testData/highlighterMetaInfo/mismatchPackageDirectoryFileLevelProblem.kt.highlighting.k2 index 243370ba36f1..21d500867625 100644 --- a/plugins/kotlin/idea/tests/testData/highlighterMetaInfo/mismatchPackageDirectoryFileLevelProblem.kt.highlighting.k2 +++ b/plugins/kotlin/idea/tests/testData/highlighterMetaInfo/mismatchPackageDirectoryFileLevelProblem.kt.highlighting.k2 @@ -1,4 +1,4 @@ -x +x // TOOL: org.jetbrains.kotlin.idea.k2.codeinsight.inspections.PackageDirectoryMismatchInspection // IGNORE_K1 // IMPLICIT_PACKAGE_PREFIX: "foo"