<commit_before>package org.jetbrains.plugins.scala.lang.resolve

import com.intellij.psi.scope._
import com.intellij.psi._

import _root_.scala.collection.Set
import _root_.scala.collection.immutable.HashSet

class CompletionProcessor(override val kinds: Set[ResolveTargets.Value]) extends BaseProcessor(kinds) {

  def execute(element: PsiElement, state: ResolveState): Boolean = {
    if (kindMatches(element)) {
      val named = element.asInstanceOf[PsiNamedElement]
      candidatesSet += new ScalaResolveResult (named)
    }<commit_msg>filter duplicate completion variants<commit_after>package org.jetbrains.plugins.scala.lang.resolve

import com.intellij.psi.scope._
import com.intellij.psi._

import _root_.scala.collection.Set
import _root_.scala.collection.mutable.HashSet

class CompletionProcessor(override val kinds: Set[ResolveTargets.Value]) extends BaseProcessor(kinds) {
  val names = new HashSet[String]
  def execute(element: PsiElement, state: ResolveState): Boolean = {
    val named = element.asInstanceOf[PsiNamedElement]
    if (kindMatches(element)) {
      val name = named.getName
      if (!names.contains(name)) {
        names += name
        candidatesSet += new ScalaResolveResult(named)
      }
    }
{'fraction_non_alphanumeric': 0.09813463098134631, 'fraction_numerical': 0.0, 'mean_word_length': 4.660550458715596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '833502', 'n_tokens_mistral': 367, 'n_tokens_neox': 363, 'n_words': 77}