@Nullable
  private static List<TextRange> askSelectioner(@NotNull PsiElement element,
                                                @NotNull CharSequence text,
                                                int cursorOffset,
                                                @NotNull Editor editor,
                                                @NotNull ExtendWordSelectionHandler selectioner) {
    try {
      long stamp = editor.getDocument().getModificationStamp();
      List<TextRange> ranges = selectioner.select(element, text, cursorOffset, editor);
      if (stamp != editor.getDocument().getModificationStamp()) {
        throw new AssertionError("Selectioner " + selectioner + " has changed the document");
      }
      return ranges;
    }
    catch (IndexNotReadyException e) {
      return null;
    }
  }
@Nullable
  private static List<TextRange> askSelectioner(@NotNull PsiElement element,
                                                @NotNull CharSequence text,
                                                int cursorOffset,
                                                @NotNull Editor editor,
                                                @NotNull ExtendWordSelectionHandler selectioner)