<commit_before>package org.jetbrains.plugins.scala.failed.annotator

import com.intellij.lang.annotation.AnnotationHolder
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.annotator.{AnnotatorPart, AnnotatorTestBase, ScopeAnnotator}
import org.jetbrains.plugins.scala.failed.annotator.ScopeAnnotatorTest.MyAnnotatorPart
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTemplateDefinition
import org.junit.experimental.categories.Category

/**
  * User: Dmitry.Naydanov
  * Date: 25.03.16.
  */
@Category(Array(classOf[PerfCycleTests]))
class ScopeAnnotatorTest extends AnnotatorTestBase(new MyAnnotatorPart) {
  def testSCL7116(): Unit = assert(
    messages(
      """
        |object SynoHilite {
        |    def foo(x: Option[String]): String = {
        |        println(x)
        |        x.get
        |    }
        |
        |    def foo(y: Option[Int]): Int = {
        |        println(y)
        |        y.get
        |    }
        |}
      """.stripMargin).isEmpty
  )
}

object ScopeAnnotatorTest {
  class MyAnnotatorPart extends AnnotatorPart[ScTemplateDefinition] {
    private val myAnnotator = new ScopeAnnotator {}
    
    override def kind: Class[ScTemplateDefinition] = classOf[ScTemplateDefinition]

    override def annotate(element: ScTemplateDefinition, holder: AnnotationHolder, typeAware: Boolean) {
      myAnnotator.annotateScope(element, holder)
    }
  }
}<commit_msg>add test for #SCL-8633 tag: Test created<commit_after>package org.jetbrains.plugins.scala.failed.annotator

import com.intellij.lang.annotation.AnnotationHolder
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.annotator.{AnnotatorPart, AnnotatorTestBase, ScopeAnnotator}
import org.jetbrains.plugins.scala.failed.annotator.ScopeAnnotatorTest.MyAnnotatorPart
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTemplateDefinition
import org.junit.experimental.categories.Category

/**
  * User: Dmitry.Naydanov
  * Date: 25.03.16.
  */
@Category(Array(classOf[PerfCycleTests]))
class ScopeAnnotatorTest extends AnnotatorTestBase(new MyAnnotatorPart) {
  def testSCL7116(): Unit = assert(
    messages(
      """
        |object SynoHilite {
        |    def foo(x: Option[String]): String = {
        |        println(x)
        |        x.get
        |    }
        |
        |    def foo(y: Option[Int]): Int = {
        |        println(y)
        |        y.get
        |    }
        |}
      """.stripMargin).isEmpty
  )

  def testSCL8633(): Unit = assert(
    messages(
      """
        |object SCL8633 {
        |  def a(x: Int) = x
        |
        |  def <ref>a(x: => Int) = x
        |}
      """.stripMargin).isEmpty
  )
}

object ScopeAnnotatorTest {
  class MyAnnotatorPart extends AnnotatorPart[ScTemplateDefinition] {
    private val myAnnotator = new ScopeAnnotator {}
    
    override def kind: Class[ScTemplateDefinition] = classOf[ScTemplateDefinition]

    override def annotate(element: ScTemplateDefinition, holder: AnnotationHolder, typeAware: Boolean) {
      myAnnotator.annotateScope(element, holder)
    }
  }
}
{'fraction_non_alphanumeric': 0.1073015873015873, 'fraction_numerical': 0.010158730158730159, 'mean_word_length': 2.998730964467005, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3874894', 'n_tokens_mistral': 1057, 'n_tokens_neox': 998, 'n_words': 166}