tsquery-playground
tsquery-playground copied to clipboard
Cannot get direct descendants of Block when preceeded by Constructor or FunctionDeclaration
The Playground seems to think that there is an additional unidentifiable node sitting between Block and its children when preceeded by Constructor or FunctionDeclaration
Code:
function A() {
this.a = 1;
}
class B {
constructor() {
this.a = 1;
}
}
AST Queries
The following will not work:
ClassDeclaration > Constructor > Block > ExpressionStatement
FunctionDeclaration > Block > ExpressionStatement
Where, these do work:
ClassDeclaration > Constructor > Block > * > ExpressionStatement
ClassDeclaration > Constructor > Block ExpressionStatement
FunctionDeclaration > Block > * > ExpressionStatement
FunctionDeclaration > Block ExpressionStatement