PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new YamlPsiElementVisitor() { @Override public void visitAlias(@NotNull YAMLAlias alias) { PsiReference reference = alias.getReference(); if (reference != null && reference.resolve() == null) { holder.registerProblem( reference, YAMLBundle.message("inspections.unresolved.alias.message", alias.getAliasName()), ProblemHighlightType.GENERIC_ERROR_OR_WARNING ); } } }; }