helix icon indicating copy to clipboard operation
helix copied to clipboard

feat: add Fennel language

Open diktomat opened this issue 1 year ago • 4 comments

Adds support for Fennel. Queries were converted from nvim-treesitter, should I add a comment noting that?

diktomat avatar Sep 15 '22 16:09 diktomat

You need to run cargo xtask docgen and commit the changes.

kirawi avatar Sep 15 '22 20:09 kirawi

Do we really need another grammar? We have tree-sitter-scheme already, you could reuse it with some custom highlighting queries.

archseer avatar Sep 16 '22 03:09 archseer

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?

the-mikedavis avatar Sep 16 '22 15:09 the-mikedavis

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.

diktomat avatar Sep 19 '22 09:09 diktomat

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.

icefoxen avatar Feb 17 '23 17:02 icefoxen

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?

Jummit avatar Aug 03 '23 14:08 Jummit

@archseer using scheme grammar won't work, fennel uses square and curly brackets

p00f avatar Sep 11 '23 10:09 p00f

That should be handled by the scheme grammar, other brackets are just syntax sugar

archseer avatar Sep 11 '23 11:09 archseer

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.

pascalkuthe avatar Apr 13 '24 23:04 pascalkuthe