py-tree-sitter icon indicating copy to clipboard operation
py-tree-sitter copied to clipboard

Missing parser.c error for typescript

Open prabhu opened this issue 3 years ago • 1 comments

While trying to invoke build_library with typescript is resulting in missing src/parser.c error. Is there any documentation on which languages are supported with the python binding?

prabhu avatar Oct 31 '21 13:10 prabhu

I had the same problem 👋

The TypeScript package is weird because it contains two grammars: typescript and tsx. Pointing to just the root of tree-sitter-typescript (or tree-sitter-typescript-master if you just cloned it from GitHub) will return a "can't find file: src/parser.c" because that file is located in the nested folder typescript or tsx.

To fix the problem: give the path to build_library as .../tree-sitter-typescript-master/tsx (if you want to work with TypeScript JSX) or .../tree-sitter-typescript-master/typescript (if you just want TypeScript) where ... is all the path stuff preceding the tree-sitter-typescript-master folder (i.e. vendor if you're following the README.md example so the resulting path is vender/tree-sitter-typescript-master/{tsx or typescript}).

dkt2 avatar Mar 06 '22 19:03 dkt2