Skip to content
This repository was archived by the owner on Nov 2, 2025. It is now read-only.

Commit 1a84344

Browse files
pqnCopybara Bot
andauthored
Project import generated by Copybara. (#5)
GitOrigin-RevId: e7bf5c3d2d8b010c32c960544bd25ee17023a7ed Co-authored-by: Copybara Bot <[email protected]>
1 parent 2207f38 commit 1a84344

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
# codeium-parse
1717

18-
This repository contains tools built with [tree-sitter](https://github.com/tree-sitter/tree-sitter) that let you:
18+
_A command line tool for parsing code syntax_
19+
20+
This repository contains a binary built with [tree-sitter](https://github.com/tree-sitter/tree-sitter) that let you:
1921
* Inspect the concrete syntax tree of a source file
2022
* Use pre-written tree-sitter query files to locate important symbols in source code
21-
* Optionally format output in JSON to use the results in your own applications
23+
* Format output in JSON to use the results in your own applications
2224

2325
Contributions welcome. These queries are used by Codeium Search to index your
2426
code locally for semantic search! Adding queries for your language here will
@@ -29,7 +31,21 @@ In particular, this repo provides a binary prepackaged with:
2931
* A large number of tree-sitter grammars
3032
* An implementation of many common query predicates
3133

32-
## Usage example
34+
## Example
35+
36+
```shell
37+
# Print all names and arguments from function definitions.
38+
# Requires fd and jq.
39+
fd -e js \
40+
| xargs -i ./parse -quiet -use_tags_query -json -json_include_path -file '{}' \
41+
| jq -r '.
42+
| select(.captures."definition.function" != null)
43+
| .file + ":" + .captures.name[0].text + .captures."codeium.parameters"[0].text'
44+
# Output:
45+
# examples/example.js:add(a, b)
46+
```
47+
48+
## Getting started
3349

3450
```console
3551
$ ./download_parse.sh

0 commit comments

Comments
 (0)