private static @Nullable FormattingModel createFormattingModel(@NotNull PsiFile file, int offset) {
    FormattingModelBuilder builder = LanguageFormatting.INSTANCE.forContext(file);
    if (builder == null) return null;
    CodeStyleSettings settings = CodeStyle.getSettings(file);
    return builder.createModel(FormattingContext.create(file, TextRange.create(offset, offset), settings, FormattingMode.REFORMAT));
  }
private static @Nullable FormattingModel createFormattingModel(@NotNull PsiFile file, int offset)