@Override
  public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
    PsiFile file = parameters.getOriginalFile();
    Project project = file.getProject();
    Document document = PsiDocumentManager.getInstance(project).getDocument(file);
    if (document == null) return;
    if (!CommitMessage.isCommitMessage(document)) return;

    String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
    CompletionResultSet prefixed = result.withPrefixMatcher(new PlainPrefixMatcher(prefix, true));

    int start = parameters.getOffset() - prefix.length();
    CharSequence charSequence = document.getCharsSequence();
    for (String knownPrefix : PREFIXES) {
      if (StringUtil.startsWithIgnoreCase(knownPrefix, prefix) && start > 0 && charSequence.charAt(start - 1) == '\n') {
        prefixed.addElement(LookupElementBuilder.create(knownPrefix));
      }
      else if (start >= knownPrefix.length() + 1 &&
          charSequence.charAt(start - knownPrefix.length() - 1) == '\n' &&
          charSequence.subSequence(start - knownPrefix.length(), start).toString().equals(knownPrefix)) {
        result.stopHere();
        int count = parameters.getInvocationCount();
        if (count > 0 || !prefix.isEmpty()) {
          CompletionResultSet usersSet = result.withPrefixMatcher(new PlainPrefixMatcher(prefix, count == 0));
          for (VcsUser user : project.getService(VcsUserRegistry.class).getUsers()) {
            usersSet.addElement(LookupElementBuilder.create(user.toString()).withIcon(AllIcons.General.User));
          }
        }
        return;
      }
    }
  }
@Override
  public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result)