private static void resolveStructInheritance(SchemaNode inheritanceNode, ParseContext context, List<Diagnostic> diagnostics) {
        if (inheritanceNode.getPreviousSibling() != null && inheritanceNode.getPreviousSibling().getASTClass() == COMMA.class) {
            diagnostics.add(new SchemaDiagnostic.Builder()
                             .setRange(inheritanceNode.getRange())
                             .setMessage("Inheriting multiple structs is not supported.")
                             .setSeverity(DiagnosticSeverity.Error)
                             .build());
            return;
        }
        Node myStructDefinitionNode = inheritanceNode.getParent().getPreviousSibling();

        if (myStructDefinitionNode == null) {
            return;
        }

        if (!myStructDefinitionNode.hasSymbol()) {
            return;
        }

        Optional<Symbol> parentSymbol = context.schemaIndex().findSymbol(inheritanceNode.getSymbol());
        if (parentSymbol.isEmpty()) {
            // Handled elsewhere
            return;
        }

        if (!context.schemaIndex().tryRegisterStructInheritance(myStructDefinitionNode.getSymbol(), parentSymbol.get())) {
            diagnostics.add(new SchemaDiagnostic.Builder()
                    .setRange( inheritanceNode.getRange())
                    .setMessage( "Cannot inherit from " + parentSymbol.get().getShortIdentifier() + " because " + parentSymbol.get().getShortIdentifier() + " inherits from this struct.")
                    .setSeverity( DiagnosticSeverity.Error)
                    .build() );
        }


        // Look for redeclarations

        Symbol structDefinitionSymbol = myStructDefinitionNode.getSymbol();

        Map<String, Symbol> inheritedFields = new HashMap<>();
        List<Symbol> myFields = new ArrayList<>();

        for (Symbol fieldSymbol : context.schemaIndex().listSymbolsInScope(structDefinitionSymbol, SymbolType.FIELD)) {
            if (fieldSymbol.getScope().equals(structDefinitionSymbol)) {
                myFields.add(fieldSymbol);
            } else {
                inheritedFields.put(fieldSymbol.getShortIdentifier(), fieldSymbol);
            }
        }

        for (Symbol fieldSymbol : myFields) {
            if (!inheritedFields.containsKey(fieldSymbol.getShortIdentifier())) continue;
            diagnostics.add(new SchemaDiagnostic.Builder()
                    .setRange(fieldSymbol.getNode().getRange())
                    .setMessage("struct " + myStructDefinitionNode.getText() + " cannot inherit from " + parentSymbol.get().getShortIdentifier() + " and redeclare field " + fieldSymbol.getShortIdentifier())
                    .setSeverity(DiagnosticSeverity.Error)
                    .setCode(DiagnosticCode.INHERITS_STRUCT_FIELD_REDECLARED)
                    .build());
        }
    }
Assuming first parsing step is done, use the list of unresolved inheritance
declarations to register the inheritance at index.
@return List of diagnostic found during inheritance handling
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/resolvers/InheritanceResolver.java