<commit_before>package org.jetbrains.plugins.scala.codeInspection

import com.intellij.psi.PsiClass
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTrait
import org.jetbrains.plugins.scala.lang.psi.impl.toplevel.typedef.MixinNodes
import org.jetbrains.plugins.scala.lang.psi.types.ScDesignatorType

/**
  * @author Nikolay.Tropin
  */
package object methodSignature {

  private[methodSignature] def isScalaJSFacade(c: PsiClass) = {
    if (c == null) false
    else MixinNodes.linearization(c).exists {
      case ScDesignatorType(tr: ScTrait) => tr.qualifiedName == "scala.scalajs.js.Any"
      case _ => false
    }
  }

}
<commit_msg>PsiClass.isInheritor used instead of linearization for better performance<commit_after>package org.jetbrains.plugins.scala.codeInspection

import com.intellij.openapi.project.Project
import com.intellij.psi.PsiClass
import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTrait
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiManager

/**
  * @author Nikolay.Tropin
  */
package object methodSignature {

  private[methodSignature] def isScalaJSFacade(c: PsiClass): Boolean = {
    if (c == null) false
    else findJsAny(c.getProject).exists(c.isInheritor(_, /*checkDeep =*/true))
  }

  private def findJsAny(project: Project): Option[PsiClass] = {
    val manager = ScalaPsiManager.instance(project)
    val scope = GlobalSearchScope.allScope(project)
    manager.getCachedClasses(scope, "scala.scalajs.js.Any").find(_.isInstanceOf[ScTrait])
  }
}

{'fraction_non_alphanumeric': 0.1160431198478123, 'fraction_numerical': 0.0, 'mean_word_length': 4.78021978021978, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5834311', 'n_tokens_mistral': 551, 'n_tokens_neox': 527, 'n_words': 82}