public TypeCompletionHandler( @NotNull CompletionParameters parameters, @NotNull CompletionResultSet result, int weight) { super(parameters, result); _filter = getDefaultFilter(parameters.getPosition()); _weight = weight; _prefixMatcher = result.getPrefixMatcher(); _javaCtx = parameters.getPosition() instanceof PsiIdentifier; }
protected CompletionSorter getCompletionSorter( final CompletionParameters parameters, final CompletionResultSet result) { PrefixMatcher _prefixMatcher = result.getPrefixMatcher(); CompletionSorter _defaultSorter = CompletionSorter.defaultSorter(parameters, _prefixMatcher); AbstractCompletionContributor.DispreferKeywordsWeigher _dispreferKeywordsWeigher = new AbstractCompletionContributor.DispreferKeywordsWeigher(); return _defaultSorter.weighBefore("liftShorter", _dispreferKeywordsWeigher); }
@Override protected void addCompletions( @NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) { UnicodeCharacterNames.iterate( name -> { if (result.getPrefixMatcher().prefixMatches(name)) { final String type = new String(new int[] {UnicodeCharacterNames.getCodePoint(name)}, 0, 1); if (myEmbrace) { result.addElement(createLookupElement("{" + name + "}", type, emptyIcon)); } else { result.addElement( TailTypeDecorator.withTail( createLookupElement(name, type, emptyIcon), TailType.createSimpleTailType('}'))); } } ProgressManager.checkCanceled(); }); }