[Support] Update a language grammar. #9570
-
In response to #2033, I mentioned a few issues with Swift support, and @Dispersia gave me some pointers on how to update the grammar and make a PR. I've made a start, but ran into a Helix-specific issue, and didn't want to keep asking @Dispersia for advice. I cloned the Swift TreeSitter project and Helix, set I then edited [[grammar]]
name = "swift"
source = { git = "https://github.com/alex-pinkus/tree-sitter-swift", rev = "1c586339fb00014b23d6933f2cc32b588a226f3b" } When I tried to rebuild Helix (using
I don't know how to address this, and can't find any more information. I don't know Rust either, so am not familiar with Cargo etc. Any advice would be appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We use the files that the tree-sitter CLI generates like |
Beta Was this translation helpful? Give feedback.
We use the files that the tree-sitter CLI generates like
src/parser.c
but tree-sitter-swift doesn't include these in its main branch (see https://github.com/alex-pinkus/tree-sitter-swift?tab=readme-ov-file#where-is-your-parserc). Instead you'll need to use a revision from thewith-generated-files
branch https://github.com/alex-pinkus/tree-sitter-swift/tree/with-generated-files