void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) { Editor editor = parameters.getEditor(); if (!isCompletionEnabled(parameters) || LiveTemplateCompletionContributor.shouldShowAllTemplates() || editor.getCaretModel().getCaretCount() != 1) { // disabled or covered with com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor return; } PsiFile originalFile = parameters.getOriginalFile(); PostfixLiveTemplate postfixLiveTemplate = getPostfixLiveTemplate(originalFile, editor); if (postfixLiveTemplate != null) { postfixLiveTemplate.addCompletions(parameters, result.withPrefixMatcher(new MyPrefixMatcher(result.getPrefixMatcher().getPrefix()))); String possibleKey = postfixLiveTemplate.computeTemplateKeyWithoutContextChecking(new CustomTemplateCallback(editor, originalFile)); if (possibleKey != null) { result = result.withPrefixMatcher(possibleKey); result.restartCompletionOnPrefixChange( StandardPatterns.string().oneOf(postfixLiveTemplate.getAllTemplateKeys(originalFile, parameters.getOffset()))); } } }