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

import com.intellij.psi.search.GlobalSearchScope
import gutter.OverrideGutter
import highlighter.{DefaultHighlighter, AnnotatorHighlighter}
import lang.psi.api.statements.{ScFunction, ScValue, ScVariable}
import lang.psi.api.toplevel.imports.ScImportSelector
import lang.psi.api.toplevel.typedef.{ScClass, ScTypeDefinition, ScTrait, ScObject}
import lang.psi.api.toplevel.{ScEarlyDefinitions, ScTyped}
import lang.psi.api.expr.{ScAnnotationExpr, ScAnnotation, ScNameValuePair, ScReferenceExpression}
import _root_.scala.collection.mutable.HashSet
import lang.psi.api.base.types.ScSimpleTypeElement
import lang.psi.api.base.patterns.ScBindingPattern
import lang.psi.api.base.patterns.ScReferencePattern
import lang.psi.api.toplevel.templates.ScTemplateBody
import lang.psi.impl.toplevel.synthetic.ScSyntheticClass
import lang.lexer.ScalaTokenTypes
import lang.psi.api.statements.params.ScTypeParam
import com.intellij.openapi.util.TextRange
import com.intellij.lang.annotation._
import org.jetbrains.plugins.scala.lang.psi.api.base._
import org.jetbrains.plugins.scala.lang.resolve._
import com.intellij.psi._
import com.intellij.codeInspection._
import org.jetbrains.plugins.scala.annotator.intention._
import org.jetbrains.plugins.scala.overrideImplement.ScalaOIUtil
import quickfix.ImplementMethodsQuickFix

/**
 * User: <NAME>
 * Date: 23.06.2008
 */

class ScalaAnnotator extends Annotator {

  def annotate(element: PsiElement, holder: AnnotationHolder) {
    element match {
      case x: ScFunction => {
        //addOverrideGutter(x, holder)
      }
      case x: ScTypeDefinition => {
        checkImplementedMethods(x, holder)
      }
      case x: ScReferenceExpression if x.qualifier == None => { //todo: temporary case
        x.bind match {
          case Some(_) => AnnotatorHighlighter.highlightReferenceElement(x, holder)
          case None => {
            val myProject = x.getProject
            val function = JavaPsiFacade.getInstance(myProject).getShortNamesCache().getClassesByName _
            val classes = function(x.refName, GlobalSearchScope.allScope(myProject)).filter((y: PsiClass) =>
                y match {
                  case _: ScObject => true
                  case _ => false
                })
            if (classes.length > 0) checkNotQualifiedReferenceElement(x, holder)
          }
        }<commit_msg>deleted annotation about not implemented functions<commit_after>package org.jetbrains.plugins.scala.annotator

import com.intellij.psi.search.GlobalSearchScope
import gutter.OverrideGutter
import highlighter.{DefaultHighlighter, AnnotatorHighlighter}
import lang.psi.api.statements.{ScFunction, ScValue, ScVariable}
import lang.psi.api.toplevel.imports.ScImportSelector
import lang.psi.api.toplevel.typedef.{ScClass, ScTypeDefinition, ScTrait, ScObject}
import lang.psi.api.toplevel.{ScEarlyDefinitions, ScTyped}
import lang.psi.api.expr.{ScAnnotationExpr, ScAnnotation, ScNameValuePair, ScReferenceExpression}
import _root_.scala.collection.mutable.HashSet
import lang.psi.api.base.types.ScSimpleTypeElement
import lang.psi.api.base.patterns.ScBindingPattern
import lang.psi.api.base.patterns.ScReferencePattern
import lang.psi.api.toplevel.templates.ScTemplateBody
import lang.psi.impl.toplevel.synthetic.ScSyntheticClass
import lang.lexer.ScalaTokenTypes
import lang.psi.api.statements.params.ScTypeParam
import com.intellij.openapi.util.TextRange
import com.intellij.lang.annotation._
import org.jetbrains.plugins.scala.lang.psi.api.base._
import org.jetbrains.plugins.scala.lang.resolve._
import com.intellij.psi._
import com.intellij.codeInspection._
import org.jetbrains.plugins.scala.annotator.intention._
import org.jetbrains.plugins.scala.overrideImplement.ScalaOIUtil
import quickfix.ImplementMethodsQuickFix

/**
 * User: <NAME>
 * Date: 23.06.2008
 */

class ScalaAnnotator extends Annotator {

  def annotate(element: PsiElement, holder: AnnotationHolder) {
    element match {
      case x: ScFunction => {
        //addOverrideGutter(x, holder)
      }
      case x: ScTypeDefinition => {
        //checkImplementedMethods(x, holder)
      }
      case x: ScReferenceExpression if x.qualifier == None => { //todo: temporary case
        x.bind match {
          case Some(_) => AnnotatorHighlighter.highlightReferenceElement(x, holder)
          case None => {
            val myProject = x.getProject
            val function = JavaPsiFacade.getInstance(myProject).getShortNamesCache().getClassesByName _
            val classes = function(x.refName, GlobalSearchScope.allScope(myProject)).filter((y: PsiClass) =>
                y match {
                  case _: ScObject => true
                  case _ => false
                })
            if (classes.length > 0) checkNotQualifiedReferenceElement(x, holder)
          }
        }
{'fraction_non_alphanumeric': 0.09690002052966537, 'fraction_numerical': 0.003695339765961815, 'mean_word_length': 3.7578125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '1465645', 'n_tokens_mistral': 1490, 'n_tokens_neox': 1432, 'n_words': 259}