@Override
  public @Nullable String getLineIndent(@NotNull Project project, @NotNull Editor editor, Language language, int offset) {
    Document document = editor.getDocument();
    final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
    documentManager.commitDocument(document);
    PsiFile file = documentManager.getPsiFile(document);
    if (file == null) return "";
    return CodeStyleManager.getInstance(project).getLineIndent(file, offset, FormattingMode.ADJUST_INDENT_ON_ENTER);
  }
@Override
  public @Nullable String getLineIndent(@NotNull Project project, @NotNull Editor editor, Language language, int offset)