private static List<Editor> getActiveEditors(@NotNull Document document) {
    Application application = ApplicationManager.getApplication();
    // ignore caret placing when exiting
    if (application.isDisposed()) {
      return Collections.emptyList();
    }
    List<Editor> activeEditors = new ArrayList<>();
    Editor localEditor = getActiveLocalEditor(document);
    if (localEditor != null) {
      activeEditors.add(localEditor);
    }
    for (ClientEditorManager manager : application.getServices(ClientEditorManager.class, ClientKind.REMOTE)) {
      Iterator<Editor> iterator = manager.editorsSequence().iterator();
      while (iterator.hasNext()) {
        Editor editor = iterator.next();
        if (UIUtil.hasFocus(editor.getContentComponent()) && editor.getDocument() == document) {
          activeEditors.add(editor);
        }
      }
    }
    return activeEditors;
  }
private static List<Editor> getActiveEditors(@NotNull Document document)