mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
--- <details open="true"><summary>Generated summary (powered by <a href="https://app.graphite.dev">Graphite</a>)</summary> > # TL;DR > This pull request adds new properties to the `ArrowFunction`, `FnDeclaration`, and `Function` interfaces in the Trustfall schema. It also adds implementation for resolving these properties in the `adapter.rs` and `properties.rs` files. Additionally, it adds a new method `function_scope_flag` to the `Vertex` struct in the `vertex.rs` file. > > # What changed > - Added new properties (`is_getter`, `is_setter`, `is_constructor`) to the `ArrowFunction`, `FnDeclaration`, and `Function` interfaces in the Trustfall schema. > - Implemented the resolution of these properties in the `resolve_arrow_function_property`, `resolve_fn_declaration_property`, and `resolve_function_property` functions in the `properties.rs` file. > - Added a new method `function_scope_flag` to the `Vertex` struct in the `vertex.rs` file. > > # How to test > 1. Run the test suite to ensure that all existing tests pass. > 2. Add new tests to cover the newly added properties and the `function_scope_flag` method. > 3. Run the test suite again and ensure that all tests pass. > > # Why make this change > - The new properties (`is_getter`, `is_setter`, `is_constructor`) provide additional information about functions in the Trustfall schema, allowing clients to query for these properties. > - The `function_scope_flag` method in the `Vertex` struct provides a convenient way to access the scope flags of a function node, which can be useful for various analysis and processing tasks. </details> |
||
|---|---|---|
| .. | ||
| examples | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
oxc_query
What is this?
oxc_query is a trustfall adapter which can be used for querying data about code.
Example: Query the name of every variable declared in a js/ts/tsx file
query {
File {
variable_declaration {
left {
assignment_to_variable_name @filter(op: "is_not_null") @output # we filter not null because destructured variables will be null when outputted on this edge.
}
}
}
}
Hint: See example/simple.rs for how to run this query.