oxc/crates/oxc_query
u9g 1c6b87b415
feat(query): Unify spread types, add ExpressionArrayElement, and ancestors is nullish now (#788)
```diff

- ArrayElementAST
- SpreadArrayElement
- SpreadArrayElementAST
- SpreadIntoObject
- SpreadIntoObjectAST

+ ExpressionArrayElement
+ ExpressionArrayElement implements HasSpan
+ ExpressionArrayElement implements ArrayElement
+ ExpressionArrayElement.expression

+ ExpressionArrayElementAST
+ ExpressionArrayElementAST implements ArrayElement
+ ExpressionArrayElementAST implements HasSpan
+ ExpressionArrayElementAST implements ExpressionArrayElement

+ Spread
+ Spread implements ObjectProperty
+ Spread implements ArrayElement
+ Spread implements HasSpan
+ Spread.expression

+ SpreadAST
+ SpreadAST implements ObjectProperty
+ SpreadAST implements HasSpan
+ SpreadAST implements ArrayElement
+ SpreadAST implements ASTNode
+ SpreadAST implements Spread

```
2023-08-25 13:29:06 +08:00
..
examples fix(parser,semantic): make semantic own Trivias (#711) 2023-08-10 15:30:32 +08:00
src feat(query): Unify spread types, add ExpressionArrayElement, and ancestors is nullish now (#788) 2023-08-25 13:29:06 +08:00
Cargo.toml feat(query): add Paren*Expr* type and add index to Argument type and fix todo in ObjectExpr (#780) 2023-08-24 04:21:02 +00:00
README.md Add oxc_query crate (#625) 2023-07-26 13:03:00 +08:00

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.