This repository was archived by the owner on Nov 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 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
2325Contributions welcome. These queries are used by Codeium Search to index your
2426code 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
You can’t perform that action at this time.
0 commit comments