GumTreeDiff/gumtree

use treesitter parse ast failed

Opened this issue · 4 comments

maven dependency
<dependency> <groupId>com.github.gumtreediff</groupId> <artifactId>gen.treesitter</artifactId> <version>4.0.0-beta2</version> </dependency>

this is code:
Run.initGenerators(); String srcFile = "/Users/haoyu/Downloads/java17-gumtree/a.java"; String dstFile = "/Users/haoyu/Downloads/java17-gumtree/c.java"; Tree src = TreeGenerators.getInstance().getTree(srcFile).getRoot(); Tree dst = TreeGenerators.getInstance().getTree(dstFile).getRoot(); Matcher defaultMatcher = Matchers.getInstance().getMatcher(); MappingStore mappings = defaultMatcher.match(src, dst); EditScriptGenerator editScriptGenerator = new SimplifiedChawatheScriptGenerator(); EditScript editScript = editScriptGenerator.computeActions(mappings); // computes the edit script
Prompt error after execution
Cannot run program "tree-sitter-parser.py" (in directory "/var/folders/c8/lxxw4ffd28nb0s0d4nbwpn_m0000gn/T"): error=2, No such file or directory
I find project wiki don not find solution, can provide a solution?

I think that the external tree sitter parser python script is not installed correctly! Cheers.

Sure! Here: https://github.com/GumTreeDiff/tree-sitter-parser

Normally, since GumTree 4.0.0-beta3 there are the new gen.treesitter-ng bindings that allow using tree-sitter without our python parser (however no documentation on it at the moment).

Cheers.

Thanks, I install tree-sitter-javascript and tree-sitter-typescript.
parse javascript is normal, can output xml normally result,
But parsing typescript will prompt symbol not found error
This is error stack
image
I'm not sure what other preparations need to be made.

Sorry I do not reproduce the bug. Can you detail the installation steps?