public List<Symbol> findSymbols(Symbol scope, SymbolType type, String shortIdentifier) {
        // First candidates are all symbols with correct type and correct short identifier

        // Special case for schema and document because a schema can sometimes refer to a document and vice versa
        if (type == SymbolType.SCHEMA || type == SymbolType.DOCUMENT) {
            SymbolType firstCheck = (type == SymbolType.SCHEMA ? SymbolType.SCHEMA : SymbolType.DOCUMENT);
            List<Symbol> schemaDefinitions = 
                symbolDefinitions.get(firstCheck)
                               .stream()
                               .filter(symbolDefinition -> symbolDefinition.getShortIdentifier().equals(shortIdentifier))
                               .toList();

            if (!schemaDefinitions.isEmpty()) return schemaDefinitions;
            return symbolDefinitions.get(firstCheck == SymbolType.SCHEMA ? SymbolType.DOCUMENT : SymbolType.SCHEMA)
                               .stream()
                               .filter(symbolDefinition -> symbolDefinition.getShortIdentifier().equals(shortIdentifier))
                               .toList();
        }

        // logger.println("Looking for symbol: " + shortIdentifier + " type " + type.toString());
        while (scope != null) {
            // logger.println("  Checking scope: " + scope.getLongIdentifier());
            List<Symbol> result = findSymbolsInScope(scope, type, shortIdentifier);

            if (!result.isEmpty()) {
                return result;
            }
            scope = scope.getScope();
        }

        return new ArrayList<>();
    }
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