A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00445.html below:

Re: Tree-sitter documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Stefan Kangas Subject: Re: Tree-sitter documentation Date: Tue, 8 Nov 2022 07:36:43 -0800
Eli Zaretskii <eliz@gnu.org> writes:

>> Alists has too much layers of parenthesizes that is verbose and easy to get 
>> wrong. Compare:

(BTW, they are much easier to edit with something like paredit.
I guess you already use it.)

> I don't share your pessimism about alists.  And the way the functions
> are defined now are also very error-prone and complicate the code,
> which needs to distinguish between several very different signatures.
>
> How about making the query itself the value of a keyword/value pair?
> Like this:
>
>    :language 'python
>    :override t
>    :feature 'string
>    :query '((string :anchor "\"" @python--treesit-fontify-string)
>             (string) @contextual)

I don't mind if it's not a well-formed plist myself, if the last element
is always the query.  It saves some typing.

On that note, I'd probably prefer it if we had something like this:

(treesit-font-lock-rules
 '(;; To avoid repetitive typing:
   (:default t
    :language 'python
    :override t)
   (:feature 'string
    '((string :anchor "\"" @python--treesit-fontify-string)
      (string) @contextual))
   (:feature 'string-interpolation
    '((interpolation (identifier) @font-lock-variable-name-face))))))



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4