mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Uast: UastContext.findPlugin reverted to rely on language of the given element
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user