public static boolean isHighlightingCompleted(@NotNull FileEditor fileEditor, @NotNull Project project) {
    return fileEditor instanceof TextEditor textEditor
           && getInstanceEx(project).getFileStatusMap().allDirtyScopesAreNull(textEditor.getEditor().getDocument());
  }
public static boolean isHighlightingCompleted(@NotNull FileEditor fileEditor, @NotNull Project project)