private static Optional<Symbol> findMapValueDefinition(ParseContext context, Symbol fieldDefinition) {
        if (fieldDefinition.getType() != SymbolType.FIELD) return Optional.empty();
        Node dataTypeNode = fieldDefinition.getNode().getNextSibling().getNextSibling();

        if (dataTypeNode == null || !(dataTypeNode.getASTClass() == dataType.class)) return Optional.empty();

        if (dataTypeNode.size() == 0 || !(dataTypeNode.get(0).getASTClass() == mapDataType.class)) return Optional.empty();

        Node valueNode = dataTypeNode.get(0).get(4);

        if (!valueNode.hasSymbol()) return Optional.empty();

        switch(valueNode.getSymbol().getStatus()) {
            case DEFINITION:
                return Optional.of(valueNode.getSymbol());
			case REFERENCE:
                return context.schemaIndex().getSymbolDefinition(valueNode.getSymbol());
            case BUILTIN_REFERENCE:
            case INVALID:
			case UNRESOLVED:
            default:
                return Optional.empty();
        }
    }
This finds the definition of a field inside a struct, where the struct is used as a type for some parent field
It solves the case where we have 
struct foo { field bar }
field baz type foo {}
And try to access baz.bar

In this case baz is the parent field and bar is the subfield

@param node the node pointing to the subfield declaration 
@param fieldDefinition the symbol where the parent field is *defined*
@param context 

@return the definition of the field inside the struct if found
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/resolvers/SymbolReferenceResolver.java