private static Optional<Symbol> resolveFieldInStructReference(SchemaNode node, Symbol structDefinition, ParseContext context) {
        Optional<Symbol> referencedSymbol = context.schemaIndex().findSymbol(structDefinition, SymbolType.FIELD, node.getText());

        if (referencedSymbol.isPresent()) {
            // TODO: maybe we could have a findSymbol that doesn't allow going up in scope
            if (!context.schemaIndex().isInScope(referencedSymbol.get(), structDefinition)) {
                return Optional.empty();
            }

            //referencedSymbol = Optional.ofNullable(context.schemaIndex().findSymbol(context.fileURI(), SymbolType.FIELD_IN_STRUCT, structDefinition.getLongIdentifier() + "." + node.getText()));
            node.setSymbolType(referencedSymbol.get().getType());
        }
        return referencedSymbol;
    }
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