private static void resolveRankProfileInheritance(SchemaNode inheritanceNode, ParseContext context, List<Diagnostic> diagnostics) {
        Node myRankProfileDefinitionNode = inheritanceNode.getParent().getPreviousSibling();
        String inheritedIdentifier = inheritanceNode.getText();

        if (myRankProfileDefinitionNode == null) return;
        if (!myRankProfileDefinitionNode.hasSymbol() || myRankProfileDefinitionNode.getSymbol().getStatus() != SymbolStatus.DEFINITION) return;

        List<Symbol> parentSymbols = context.schemaIndex().findSymbols(inheritanceNode.getSymbol());

        if (parentSymbols.isEmpty() || 
            // prevents rank-profile default inherits default from causing cyclic inheritance
            (
             rankProfileBuiltinIdentifier(inheritedIdentifier) 
             && myRankProfileDefinitionNode.getSymbol().getShortIdentifier().equals(inheritedIdentifier)
            )
        ) {
            if (rankProfileBuiltinIdentifier(inheritedIdentifier)) {
                inheritanceNode.setSymbolStatus(SymbolStatus.BUILTIN_REFERENCE);
                return;
            }
            // Otherwise handled in resolve symbol ref
            return;
        }

        if (parentSymbols.size() > 1 && !parentSymbols.get(0).fileURIEquals(context.fileURI())) {
            String note = "\nNote:";

            for (Symbol symbol : parentSymbols) {
                note += "\nDefined in " + FileUtils.fileNameFromPath(symbol.getFileURI());
            }

            diagnostics.add(new SchemaDiagnostic.Builder()
                    .setRange( inheritanceNode.getRange())
                    .setMessage( inheritedIdentifier + " is ambiguous in this context. " + note)
                    .setSeverity( DiagnosticSeverity.Warning)
                    .build());
        }

        // Choose last one, if more than one (undefined behaviour if ambiguous).
        Symbol parentSymbol = parentSymbols.get(0);
        Symbol definitionSymbol = myRankProfileDefinitionNode.getSymbol();

        if (!checkRankProfileInheritanceCollisions(context, definitionSymbol, parentSymbol, inheritanceNode, diagnostics)) return;

        if (!context.schemaIndex().tryRegisterRankProfileInheritance(definitionSymbol, parentSymbol)) {
            diagnostics.add(new SchemaDiagnostic.Builder()
                    .setRange(inheritanceNode.getRange())
                    .setMessage("Cannot inherit from " + parentSymbol.getShortIdentifier() + " because " + parentSymbol.getShortIdentifier() + " inherits from this rank profile. ")
                    .setSeverity(DiagnosticSeverity.Error)
                    .build());

            return;
        }
    }
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