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

import com.intellij.debugger.SourcePosition
import com.intellij.debugger.engine.SourcePositionProvider
import com.intellij.debugger.impl.{DebuggerContextImpl, PositionUtil}
import com.intellij.debugger.ui.tree.{FieldDescriptor, LocalVariableDescriptor, NodeDescriptor}
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScBindingPattern
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScReferenceExpression
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
import org.jetbrains.plugins.scala.lang.refactoring.util.ScalaNamesUtil

import scala.annotation.tailrec

/**
 * @author Nikolay.Tropin
 */
class ScalaSourcePositionProvider extends SourcePositionProvider {
  override def computeSourcePosition(descriptor: NodeDescriptor,
                                     project: Project,
                                     context: DebuggerContextImpl,
                                     nearest: Boolean): SourcePosition = {

    val contextElement = PositionUtil.getContextElement(context)
    val isScala = contextElement match {
      case _: ScalaPsiElement => true
      case _ => false
    }
    if (!isScala) return null

    descriptor match {<commit_msg>checking scala element fixed (cherry picked from commit 766c732)<commit_after>package org.jetbrains.plugins.scala.debugger

import com.intellij.debugger.SourcePosition
import com.intellij.debugger.engine.SourcePositionProvider
import com.intellij.debugger.impl.{DebuggerContextImpl, PositionUtil}
import com.intellij.debugger.ui.tree.{FieldDescriptor, LocalVariableDescriptor, NodeDescriptor}
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.ScalaLanguage
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScBindingPattern
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScReferenceExpression
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
import org.jetbrains.plugins.scala.lang.refactoring.util.ScalaNamesUtil

import scala.annotation.tailrec

/**
 * @author Nikolay.Tropin
 */
class ScalaSourcePositionProvider extends SourcePositionProvider {
  override def computeSourcePosition(descriptor: NodeDescriptor,
                                     project: Project,
                                     context: DebuggerContextImpl,
                                     nearest: Boolean): SourcePosition = {

    val contextElement = PositionUtil.getContextElement(context)
    val isScala = contextElement.getLanguage.isKindOf(ScalaLanguage.Instance)
    if (!isScala) return null

    descriptor match {
{'fraction_non_alphanumeric': 0.07957371225577264, 'fraction_numerical': 0.0021314387211367673, 'mean_word_length': 3.838487972508591, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7252017', 'n_tokens_mistral': 788, 'n_tokens_neox': 753, 'n_words': 130}