tsquery
tsquery copied to clipboard
maybe attribute eq/neq could be more type infered?
trafficstars
https://github.com/phenomnomnominal/tsquery/blob/a81e09346c1227a756ddd279e54728753614c2c9/src/matchers/attribute.ts#L39-L53
unlike esquery they dont have any type info, tsquery could be more type infered, for example, with code
const routeMap = [{}]
we could do somethings like:
VariableDeclaration[name.name="routeMap"][initializer=type(ArrayLiteralExpression)]
which is more accurate than some thing
VariableDeclaration[name.name="routeMap"]):has(ArrayLiteralExpression)
I don't really know how something like this would work, since the type information isn't necessarily available to you at the point when a query is running. Can you add some more details, give some use-cases, suggest how to integrate the type checker into TSQuery?