tree-sitter-grammars / tree-sitter-hcl

HCL grammar for tree-sitter
https://tree-sitter-grammars.github.io/tree-sitter-hcl/
Apache License 2.0
95 stars 20 forks source link

SPM support #26

Closed mattmassicotte closed 1 year ago

mattmassicotte commented 2 years ago

This adds Swift bindings and Swift Package Manager (SPM) support. I maintain the tree-sitter Swift binding here https://github.com/chimeHQ/SwiftTreeSitter

Here are some examples of other PRs:

tree-sitter/tree-sitter-go#79 tree-sitter/tree-sitter-c#105 tree-sitter/tree-sitter-haskell#91

These are manually created. They should not ever impact the parser. There no need for you to publish packages or take action for releases. The exclude patterns are pretty safe to get out of sync. They can, in some circumstances, generate warnings for Swift users. But, it's really minor.

Oh, and thanks for making this. It's awesome!

MichaHoffmann commented 1 year ago

Hey, Thanks for the PR. Sorry for the late response i hadnt checked notifications!

mattmassicotte commented 1 year ago

No worries! I know these can take a while to get to.

mattmassicotte commented 1 year ago

Anything else I can help with to pass review?

MichaHoffmann commented 1 year ago

Just quick question: do i need to look out for stuff when releasing a new version?

mattmassicotte commented 1 year ago

Nope, you don't need to think about the Swift binding at all. The worst thing that could happen is changing from a C++-bsaed scanner to a C-based one. That would break the package, but is quite a rare change to make. And the fix is simple.

I think you can safely ignore this binding altogether and just do whatever you think is best for the parser. If anything comes up I, or someone else that depends on the Swift package will fix it.