From f500172b918f260c1b349fdc0c880ad5bf3def4a Mon Sep 17 00:00:00 2001 From: Nicolay Mitropolsky Date: Tue, 24 Jul 2018 13:00:51 +0300 Subject: [PATCH] Uast: `UastContext.findPlugin` reverted to rely on language of the given element --- uast/uast-common/src/org/jetbrains/uast/UastContext.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/uast/uast-common/src/org/jetbrains/uast/UastContext.kt b/uast/uast-common/src/org/jetbrains/uast/UastContext.kt index 0a6205feb42a..108d5fa87ffb 100644 --- a/uast/uast-common/src/org/jetbrains/uast/UastContext.kt +++ b/uast/uast-common/src/org/jetbrains/uast/UastContext.kt @@ -42,11 +42,7 @@ class UastContext(val project: Project) : UastLanguagePlugin { get() = UastLanguagePlugin.getInstances() fun findPlugin(element: PsiElement): UastLanguagePlugin? { - // we're searching for plugin for file because sometimes java elements are used in another languages (see Drools) - val containingFile = element.containingFile?.takeIf { - it !is PsiCompiledFile // Don't trust compiled files because of KT-18054 - } - val language = (containingFile ?: element).language + val language = element.language return languagePlugins.firstOrNull { it.language == language } }