Fix bad language check in find usages that caused falling to text search

This commit is contained in:
Nikolay Krasko
2017-04-13 16:55:52 +03:00
parent 331279583d
commit e1de0b9cd8
2 changed files with 5 additions and 2 deletions
@@ -279,7 +279,7 @@ class ExpressionsOfTypeProcessor(
val scope = GlobalSearchScope.projectScope(project).excludeFileTypes(KotlinFileType.INSTANCE, XmlFileType.INSTANCE)
testLog?.add("Searched references to ${logPresentation(psiClass)} in non-Kotlin files")
searchReferences(psiClass, scope) { reference ->
if (reference.element.language != JavaFileType.INSTANCE) { // reference in some JVM language can be method parameter (but we don't know)
if (reference.element.language != JavaLanguage.INSTANCE) { // reference in some JVM language can be method parameter (but we don't know)
LOG.info(getFallbackDiagnosticsMessage(reference))
downShiftToPlainSearch()
return@searchReferences false
@@ -1,4 +1,7 @@
Resolved java class to descriptor: JavaSAM
Searched references to JavaClass.takeSAM(JavaSAM sam) in non-Java files
Searched references to JavaSAM in non-Kotlin files
Searched references to pack.A
Used plain search of parameter a of A(val a: Int, val b: String) in whole search scope
Used plain search of parameter a of A(val a: Int, val b: String) in LocalSearchScope:
CLASS:A
{ val (x, y) = it }