From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.devel Subject: Clarification about treesit-font-lock-settings Date: Sat, 25 Feb 2023 16:33:13 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f4a30105f587f800" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36282"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 25 16:50:17 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVwoT-0009If-8J for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Feb 2023 16:50:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVwne-0008RK-4E; Sat, 25 Feb 2023 10:49:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVwYf-0005wr-A6 for emacs-devel@gnu.org; Sat, 25 Feb 2023 10:33:57 -0500 Original-Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVwYc-0004qo-RN for emacs-devel@gnu.org; Sat, 25 Feb 2023 10:33:57 -0500 Original-Received: by mail-ed1-x531.google.com with SMTP id h16so8716258edz.10 for ; Sat, 25 Feb 2023 07:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=7WVSjoWHujIzYN18d1i28ww0VXQTwsoy94KLAM6yRUA=; b=mmjmO0E5mncnacNN7f4VMJ03p1lpgX8KeBoy7M6SZqgQkk73kjxkV95vnkNrAbmV3C MfLJ0EoKM7Nd0E++BLxwzgPN9i5/MVw4hMTXq7j01q64op0yIiBpYA1f+F8EymPnPtpe vT+UEaeS18INaMmL6KhifwNhmsHTbztb/JsGCRi0OX8rDvyMH3MjYh3gScCGSRb55ay4 4Ax7Ktwks6QYMCl4b7AHTuW45bWM9sbxy+1EaNUZO0ThN+C5+iYXJbrf+7syNrMETImN vt7dmH5k8/DcvDXGjcICW+0Pa3/KvcRsOBwHBQdkBx4mapSt8wT8wApUXtq3gELgOtFg n6qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7WVSjoWHujIzYN18d1i28ww0VXQTwsoy94KLAM6yRUA=; b=4Xksxj77hQwNRWs3xbaRfIYu3rjNl2Jr5XLR55ioIX/6LNnGJHEJnPKMb+LUewLu6X xlOPGZMlN/Kf+N8wKnIZF3QR0WOGf96UW5M+PtSUrmWbN8fe89y85n+Wjdv4E862dWyY YHSSqVOvN88aZMaehHpk0iLRSV2BRfUx9lcCru7yv4bd3iyDAp72kUn94zKwvLBx+qWS 4zKwCAlHHFgIhRExoIqa9sIUkbbs2yWZP5DOgTMQPbL8XWVmXWx6ln1yagkuudug7GCt ZImxX/aG0GnI9ImHySRdiGarF0s6mOJGoHNVOlMG07uk+e8oSEd+SbcbHCli+KQnybZu sb8Q== X-Gm-Message-State: AO0yUKXlwBxUqM43xbihtaGMGbukwUwRhD/BCogU/5nZ3I9gEpfyNd3o /fixb98fbtEqE5n+eXT7ErvzhUtm/QIWCkTJYn9avUm/fvs= X-Google-Smtp-Source: AK7set/vPF8DrAhxKA6Jrv7KNouuH0wr+2UctqG5o+ztiTJMRV/mrAOXugqnnnW5ea9/eWTpQg02liyvrCpMrLl3Fsg= X-Received: by 2002:a17:906:4f0a:b0:878:561c:6665 with SMTP id t10-20020a1709064f0a00b00878561c6665mr12487028eju.0.1677339229724; Sat, 25 Feb 2023 07:33:49 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=v.pupillo@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 25 Feb 2023 10:49:25 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303803 Archived-At: --000000000000f4a30105f587f800 Content-Type: text/plain; charset="UTF-8" Hi, I'm trying to understand how treesit-font-lock-settings works. PHP supports annotations for classes, methods, functions, parameters, properties and class constants, for e.g (this test come from php-mode): Hi,
I'm trying to understand how treesit-font-lock= -settings works.
PHP supports annotations for classes, methods, function= s, parameters,
properties and class constants, for e.g (this test come = from php-mode):

<?php

#[
=C2=A0Deprecated
]
func= tion f($arg1,
=C2=A0#[Deprecated] $arg2){}
#Deprecated <-- this is= a comment

I would like to highlight the "Deprecated" anno= tation.
"treesit-query-validation" says that this query is va= lid:
(treesit-query-validate 'php
'((attribute (name (:match = "Deprecated")) @font-lock-comment-delimiter-face))

This is= the rule I wrote:
=C2=A0 =C2=A0:language 'php
=C2=A0 =C2=A0:feat= ure 'attribute
=C2=A0 =C2=A0'((attribute (name (:match "Dep= recated"))) @font-lock-comment-delimiter-
face)


When I u= se my "php-ts-mode" on that code snippet, emacs reports the follo= wing
errors:
Error during display: (jit-lock-function 1) reported (t= reesit-query-error
"Predicate `equal' requires two arguments b= ut only given" 1)
Error during display: (jit-lock-function 6) repor= ted (treesit-query-error
"Predicate `equal' requires two argum= ents but only given" 1)
Set report [2 times]

Is this a bug o= r am I doing something wrong?
My "php-ts-mode" works quite wel= l. Except for the annotations the syntax
highlighting is as good as php= -mode.

Thank you.

Vincenzo --000000000000f4a30105f587f800--