public List<Symbol> findSymbolsInScope(Symbol scope, SymbolType type, String shortIdentifier) {
        if (scope.getType() == SymbolType.RANK_PROFILE) {
            return rankProfileInheritanceGraph.findFirstMatches(scope, rankProfileDefinitionSymbol -> {
                var definedInScope = findSymbolInConcreteScope(rankProfileDefinitionSymbol, type, shortIdentifier);
                if (definedInScope.isEmpty()) return null;
                return definedInScope;
            }).stream().map(result -> result.result.get()).toList();
        } else if (scope.getType() == SymbolType.STRUCT) {
            return structInheritanceGraph.findFirstMatches(scope, rankProfileDefinitionSymbol -> {
                var definedInScope = findSymbolInConcreteScope(rankProfileDefinitionSymbol, type, shortIdentifier);
                if (definedInScope.isEmpty()) return null;
                return definedInScope;
            }).stream().map(result -> result.result.get()).toList();
        } else if (scope.getType() == SymbolType.DOCUMENT || scope.getType() == SymbolType.SCHEMA) {
            return documentInheritanceGraph.findFirstMatches(scope.getFileURI(), ancestorURI -> {

                List<Symbol> match = symbolDefinitions.get(type)
                    .stream()
                    .filter(symbolDefinition -> symbolDefinition.getScope() != null
                            && (symbolDefinition.getScope().getType() == SymbolType.SCHEMA || symbolDefinition.getScope().getType() == SymbolType.DOCUMENT)
                            && symbolDefinition.getShortIdentifier().equals(shortIdentifier)
                            && symbolDefinition.getScope().getFileURI().equals(ancestorURI))
                    .toList();

                if (match.isEmpty()) return null;

                return Optional.of(match.get(0));
            }).stream().map(result -> result.result.get()).toList();
        }

        Optional<Symbol> symbol = findSymbolInConcreteScope(scope, type, shortIdentifier);
        List<Symbol> result = new ArrayList<>();
        if (symbol.isPresent())result.add(symbol.get());
        return result;
    }
Searches for symbols in the schema index that match the given symbol.

@return A list of symbols that match the given symbol.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/index/SchemaIndex.java