private void findDefinitionAbove(RankProfile profile) {
        ProgressIndicatorProvider.checkCanceled();
        if ( ! visited.add(profile)) return;
        ReadAction.compute(() -> findDefinitionIn(profile));
        for (var parent : ReadAction.compute(() -> profile.parents().values()))
            findDefinitionAbove(parent);
    }
Returns the profile which inherits the one we're to find the definition of, or null if
referringElement is not the name of an inherited profile.
integration/intellij/src/main/java/ai/vespa/intellij/schema/findUsages/RankProfileDefinitionFinder.java