Skip to content

Return an empty compact envelope for zero-match callees queries #5128

Description

@Widthdom

Summary

callees can fabricate one empty projected row for an exact zero-match query in compact JSON mode. The equivalent references and callers queries return the expected empty compact envelope.

Reproduction

cdidx callees DefinitelyNoSuchSymbol --exact-name --json --compact \
  --fields path,line --limit 1 --max-json-bytes 8192 --db .cdidx/codeindex.db

The same behavior is observable without --fields.

Actual

The response uses the bounded envelope and reports one result, for example:

{"metadata":{"command":"callees","result_count":1,"total_count":1,"format":"compact"},"results":[{}]}

Expected

The response should preserve the compact location envelope and report no results:

{"format":"compact","count":0,"results":[]}

Notes

This was observed while reviewing #5094, but is pre-existing and independent of projected --body validation, so it is intentionally left out of that fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions