You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add pagination (--limit, --offset, --all) across all query commands
Commands now have default result limits to prevent unbounded output:
definition (3), symbols (100), references (50). When truncated, a
compact hint on stderr guides toward narrowing or paging forward.
JSON output uses a paginated envelope {total, offset, limit, results}
when results are truncated or offset > 0, bare array otherwise.
Definition results are sorted by symbol priority (types first) and
paginated before reading bodies from disk to avoid wasted I/O.
Closes#15
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,6 +185,18 @@ Use `--file src/index.rs` to scope the search to a single file. Includes both de
185
185
186
186
References are computed on-the-fly via AST walking (not indexed), so results are always fresh.
187
187
188
+
### Pagination
189
+
190
+
Commands have default result limits to keep output bounded: definition shows 3, symbols 100, references 50. When results are truncated, cx prints a hint:
191
+
192
+
```
193
+
cx: 3/32 definitions for "OnTypeModel" | --from PATH to narrow | --offset 3 for more | --all
194
+
```
195
+
196
+
Use `--offset N` to page forward, `--all` to bypass the limit, or `--limit N` to override the default. Narrowing with `--from` / `--file` / `--kind` is usually better than paging.
197
+
198
+
With `--json`, paginated output uses `{total, offset, limit, results: [...]}`. Non-paginated output remains a bare array.
199
+
188
200
## How it works
189
201
190
202
On first invocation, cx builds an index by parsing all source files with tree-sitter. The index stores symbols, signatures, and byte ranges for every file. Subsequent invocations incrementally update only changed files.
0 commit comments