public Map<String, List<Function>> definedFunctions() {
        if (functions != null) return functions;
        functions = new HashMap<>();
        for (SdFunctionDefinition function : PsiTreeUtil.findChildrenOfType(definition, SdFunctionDefinition.class))
            functions.computeIfAbsent(function.getName(), k -> new ArrayList<>()).add(Function.from(function, this));
        PsiTreeUtil.findChildrenOfType(definition, SdFirstPhaseDefinition.class).stream().findFirst()
                   .map(firstPhase -> Function.from(firstPhase, this))
                   .ifPresent(firstPhase -> functions.put(firstPhase.name(), List.of(firstPhase)));
        PsiTreeUtil.findChildrenOfType(definition, SdSecondPhaseDefinition.class).stream().findFirst()
                   .map(secondPhase -> Function.from(secondPhase, this))
                   .ifPresent(secondPhase -> functions.put(secondPhase.name(), List.of(secondPhase)));
        return functions;
    }
Returns the functions defined in this.
integration/intellij/src/main/java/ai/vespa/intellij/schema/model/RankProfile.java