public static List<Diagnostic> resolveRankExpressionReferences(SchemaNode node, ParseContext context) {
        List<Diagnostic> diagnostics = new ArrayList<>();

        if (node.getLanguageType() == LanguageType.RANK_EXPRESSION) {

            diagnostics.addAll(resolveRankExpression(node, context));

        } else {
            for (Node child : node) {
                diagnostics.addAll(resolveRankExpressionReferences(child.getSchemaNode(), context));
            }
        }

        return diagnostics;
    }
Resolves rank expression references in the tree

@param node        The schema node to resolve the rank expression references in.
@param context     The parse context.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/resolvers/RankExpressionSymbolResolver.java