@Override
  public @NotNull PsiElementVisitor buildVisitor(final @NotNull ProblemsHolder holder, final boolean isOnTheFly) {
    if (!Registry.is("spellchecker.inspection.enabled", true)) {
      return PsiElementVisitor.EMPTY_VISITOR;
    }
    final SpellCheckerManager manager = SpellCheckerManager.getInstance(holder.getProject());
    var scope = buildAllowedScopes();

    return new PsiElementVisitor() {
      @Override
      public void visitElement(final @NotNull PsiElement element) {
        if (holder.getResultCount() > 1000) return;

        final ASTNode node = element.getNode();
        if (node == null) {
          return;
        }

        final Language language = element.getLanguage();
        var strategy = getSpellcheckingStrategy(element, language);
        if(strategy == null)
          return;

        if(!strategy.elementFitsScope(element, scope))
          return;

        PsiFile containingFile = holder.getFile();
        if (Boolean.TRUE.equals(containingFile.getUserData(InjectedLanguageManager.FRANKENSTEIN_INJECTION))) {
          return;
        }

        tokenize(element, language, new MyTokenConsumer(manager, holder, LanguageNamesValidation.INSTANCE.forLanguage(language)), scope);
      }
    };
  }
@Override
  public @NotNull PsiElementVisitor buildVisitor(final @NotNull ProblemsHolder holder, final boolean isOnTheFly)