tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
360 stars 109 forks source link

SPM support #245

Closed mattmassicotte closed 1 year ago

mattmassicotte commented 1 year ago

This adds Swift bindings and Swift Package Manager (SPM) support. This should require no maintenance on your part, and should not impact the actual parsers in any way. Other similar changes were made here:

https://github.com/tree-sitter/tree-sitter-go https://github.com/tree-sitter/tree-sitter-c https://github.com/tree-sitter/tree-sitter-haskell

This one is a little special, because of the two parsers. At first, I thought I could use a similar approach to https://github.com/MDeiml/tree-sitter-markdown, which also has two. However, the project is structured in a way that SPM cannot quite handle (the gitignores for the sub directories in particular). So, I just combined the two parsers into one single static lib target. I suppose this adds a binary size penalty for someone that only wanted one of the dialects. But I'm unsure how to address it without project layout changes and I just don't know if that's worth it.

bombardier200 commented 1 year ago

Is this something that you all are looking at adding? I would really love to see this get merged so that the swift community can use it!