public static void invoke(@NotNull final Project project, @NotNull final Editor editor, @Nullable PsiFile file) {
    PsiDocumentManager.getInstance(project).commitAllDocuments();

    final SelectionModel selectionModel = editor.getSelectionModel();
    if (file == null && !selectionModel.hasSelection()) {
      selectionModel.selectWordAtCaret(false);
    }
    if (file == null || selectionModel.hasSelection()) {
      doRangeHighlighting(editor, project);
      return;
    }

    final HighlightUsagesHandlerBase<?> handler = createCustomHandler(editor, file);
    if (handler != null) {
      final String featureId = handler.getFeatureId();

      if (featureId != null) {
        FeatureUsageTracker.getInstance().triggerFeatureUsed(featureId);
      }

      handler.highlightUsages();
      return;
    }

    DumbService.getInstance(project).withAlternativeResolveEnabled(() -> {
      if (!HighlightUsagesKt.highlightUsages(project, editor, file)) {
        handleNoUsageTargets(file, editor, selectionModel, project);
      }
    });
  }
public static void invoke(@NotNull final Project project, @NotNull final Editor editor, @Nullable PsiFile file)