private ArrayList<Diagnostic> identifyDefinitionInRankExpression(SchemaNode node) {
        ArrayList<Diagnostic> ret = new ArrayList<>();

        if (!node.isASTInstance(ai.vespa.schemals.parser.rankingexpression.ast.identifierStr.class)) {
            return ret;
        }

        Node parent = node.getParent();
        if (parent == null) return ret;

        Node grandParent = parent.getParent();
        if (grandParent == null) return ret;

        if (parent.isASTInstance(tensorTypeDimension.class) && grandParent.isASTInstance(tensorType.class)) {
            handleTensorTypeDefinitions(node, grandParent.getSchemaNode(), ret);
            return ret;
        }

        if (!grandParent.isASTInstance(lambdaFunction.class) || grandParent.size() < 1) {
            return ret;
        }

        // This is specific to lambda function definitions
        SchemaNode lambdaDefinitionNode = grandParent.get(0).getSchemaNode();
        if (!lambdaDefinitionNode.hasSymbol()) {

            Optional<Symbol> parentScope = CSTUtils.findScope(parent);
    
            if (parentScope.isEmpty()) {
                return ret;
            }
    
            lambdaDefinitionNode.setSymbol(SymbolType.LAMBDA_FUNCTION, context.fileURI(), parentScope.get(), "lambda_" + node.hashCode());
            lambdaDefinitionNode.setSymbolStatus(SymbolStatus.DEFINITION);
            context.schemaIndex().insertSymbolDefinition(lambdaDefinitionNode.getSymbol());
        }

        
        node.setSymbol(SymbolType.PARAMETER, context.fileURI(), lambdaDefinitionNode.getSymbol());

        if (context.schemaIndex().findSymbolsInScope(node.getSymbol()).size() == 0) {
            node.setSymbolStatus(SymbolStatus.DEFINITION);
            context.schemaIndex().insertSymbolDefinition(node.getSymbol());
        } else {
            node.setSymbolStatus(SymbolStatus.INVALID);
        }

        return ret;
    }
Some datatypes need to define symbols.
Currently only map, which defines MAP_KEY and MAP_VALUE symbols at the dataType nodes inside the map
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/parser/schema/IdentifySymbolDefinition.java