This is a CodeQL extractor based on tree-sitter.
To build the extractor, run scripts/create-extractor-pack.sh
The vendored tree-sitter-swift grammar lives at
extractor/tree-sitter-swift/. After editing grammar.js (or any other
grammar source), run scripts/regenerate-grammar.sh to:
- regenerate
extractor/tree-sitter-swift/src/{parser.c, grammar.json, node-types.json}(and thesrc/tree_sitter/*.hheaders) viatree-sitter generate; and - refresh
extractor/tree-sitter-swift/node-types.yml, the human-readable companion tosrc/node-types.jsonproduced by yeast'snode_types_yamlbinary.
node-types.yml is the recommended review surface for grammar changes —
it shows the impact of a grammar tweak on the named node kinds, fields,
and child types in a form much easier to read than the raw JSON.
-
If you changed the extractor code, always rebuild it before running tests.
-
To run all tests, run
codeql test run --search-path extractor-pack ql/test -
Do not edit
.expectedfiles manually. To update the expected output, pass--learnto thecodeql test runcommand. -
To run a specific test, pass the specific directory to the
codeql test runcommand instead ofql/test.