helix
helix copied to clipboard
feat: add Fennel language
Adds support for Fennel. Queries were converted from nvim-treesitter, should I add a comment noting that?
You need to run cargo xtask docgen
and commit the changes.
Do we really need another grammar? We have tree-sitter-scheme
already, you could reuse it with some custom highlighting queries.
Tree-sitter-scheme is also oddly large (1.5MB), I think because of all of the regexes in the grammar definition.
We might be able to support all lisps with one tree-sitter-sexp grammar?
Should have thought of that earlier, I only tried to reuse the queries before. Just tried using the Scheme grammar and copying queries dir: looks great at first glance, one would just have to make sure all builtins are queried correctly I guess. I'll have a deeper look tomorrow.
As for unifying lisps, there is AbstractMachinesLab/tree-sitter-sexp, last commit was two years ago though.
I have no actual dog in this fight but in passing I'll note that there can be some fairly disparate syntax between Lisp's. CL, Clojure, Fennel and Racket all have pretty different keywords and opinions about things like character literals and compile directives.
So I've been using this patch for a while now, and I think the conclusion of the Lisp-syntax discussion was that Fennel should get it's own one since there are too many discrepancies between the Lisp dialects.
Since this is marked as inactive, should I create a new pr where feedback can be addressed to get this merged?
@archseer using scheme grammar won't work, fennel uses square and curly brackets
That should be handled by the scheme grammar, other brackets are just syntax sugar
clsoing this one as stale. I don't think we will add an extra grammar here so any language definition should be reusing the scheme grammar. Thank you for contributing.