<commit_before>package org.jetbrains.plugins.groovy.lang.completion;

import com.intellij.codeInsight.lookup.CharFilter;
import com.intellij.codeInsight.lookup.Lookup;
import org.jetbrains.annotations.Nullable;

/**
 * @author ilyas
 */
public class GroovyReferenceCharFilter extends CharFilter {
  @Nullable
  public Result acceptChar(char c, int pefixLength, Lookup lookup) {
    if (Character.isJavaIdentifierPart(c) || c == '\'') return Result.ADD_TO_PREFIX;
    else if (c == '\n' || c == '\t') {
      return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
    }
    return Result.HIDE_LOOKUP;
  }

}<commit_msg>restore finish lookup with dot<commit_after>package org.jetbrains.plugins.groovy.lang.completion;

import com.intellij.codeInsight.lookup.CharFilter;
import com.intellij.codeInsight.lookup.Lookup;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.GroovyFileType;

/**
 * @author ilyas
 */
public class GroovyReferenceCharFilter extends CharFilter {
  @Nullable
  public Result acceptChar(char c, int pefixLength, Lookup lookup) {
    if (!lookup.getPsiFile().getViewProvider().getLanguages().contains(GroovyFileType.GROOVY_LANGUAGE)) return null;

    if (Character.isJavaIdentifierPart(c) || c == '\'') {
      return Result.ADD_TO_PREFIX;
    }
    else if (c == '\n' || c == '\t') {
      return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
    }
    return Result.HIDE_LOOKUP;
  }

}
{'fraction_non_alphanumeric': 0.1213832039520113, 'fraction_numerical': 0.0, 'mean_word_length': 4.474903474903475, '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': '4674915', 'n_tokens_mistral': 482, 'n_tokens_neox': 461, 'n_words': 88}