KMT-1003 [compose resources] reduce search scope to file level

(cherry picked from commit 96084359b47d4d2fe38c5d66698058307da1f146)

GitOrigin-RevId: 4e024ade3cb5c9587631dcae09118c88aa95d899
This commit is contained in:
Alexandru Resiga
2025-05-05 13:53:02 +02:00
committed by intellij-monorepo-bot
parent f23ed106be
commit 8a1b71a325

View File

@@ -193,8 +193,8 @@ internal fun String.getModuleName(): String? = when (count { it == ':' }) {
/** check if the new layout from version 1.8.1 is used */
private fun KtElement.isNewLayout(): Boolean {
val moduleScope = module?.let { GlobalSearchScope.moduleScope(it) } ?: return false
return KotlinPropertyShortNameIndex["MD", project, moduleScope].any { it.containingFile == containingFile }
val fileScope = GlobalSearchScope.fileScope(containingFile)
return KotlinPropertyShortNameIndex["MD", project, fileScope].isNotEmpty()
}
private val log by lazy { fileLogger() }