private void shortenReferences() {
    performWrite(() -> {
      final PsiFile file = getPsiFile();
      if (file != null) {
        IntList indices = initEmptyVariables();
        getSegments().setSegmentsGreedy(false);
        for (TemplateOptionalProcessor processor : TemplateOptionalProcessor.EP_NAME.getExtensionList()) {
          processor.processText(myProject, getTemplate(), getDocument(), myTemplateRange, getEditor());
        }
        getSegments().setSegmentsGreedy(true);
        restoreEmptyVariables(indices);
      }
    });
  }
private void shortenReferences()