Closed liaodalin19903 closed 2 months ago
it's type_identifier
not identifier
, just look at a parse tree to see what you should query for.
it's
type_identifier
notidentifier
, just look at a parse tree to see what you should query for.
@amaanq thanks for your reply, I still have several questions:
What tool did you use to print the contents of the snapshot? Is it tree-sitter-cli?
where is the type_identifier definition? I didn't find it in: node-tree-sitter nor define-grammar.js
Yes it's the cli but it's a fork with the -oc
flag, I'll upstream that functionality soon enough.
it's aliased, and it's in the JavaScript grammar (which TypeScript extends). node-tree-sitter
is just the nodejs bindings for tree-sitter.
When use
new Query()
to create query instance, the TypeScript will get error:1)JavaScript test success: https://github.com/liaodalin19903/Test-demos/tree/bug-003-nodetreesitter/nodejs-test-demos/nodejs-demo-02-nodetreesitter
new Query() execute no problem:
2)TypeScript test fail: https://github.com/liaodalin19903/Test-demos/tree/bug-003-nodetreesitter/nodejs-test-demos/nodejs-demo-03-nodetreesitter
new Query() execute error
Error: