From unknown Sat Aug 16 21:11:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#69589 <69589@debbugs.gnu.org> To: bug#69589 <69589@debbugs.gnu.org> Subject: Status: 29.2; Invalid query in js--treesit-font-lock-settings prevents syntax highlighting Reply-To: bug#69589 <69589@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:11:22 +0000 retitle 69589 29.2; Invalid query in js--treesit-font-lock-settings prevent= s syntax highlighting reassign 69589 emacs submitter 69589 "Divvy Cr." severity 69589 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 12:36:11 2024 Received: (at submit) by debbugs.gnu.org; 6 Mar 2024 17:36:11 +0000 Received: from localhost ([127.0.0.1]:51334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhvBa-0004kc-Fa for submit@debbugs.gnu.org; Wed, 06 Mar 2024 12:36:11 -0500 Received: from lists.gnu.org ([209.51.188.17]:34594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhv2A-0004UP-6f for submit@debbugs.gnu.org; Wed, 06 Mar 2024 12:26:27 -0500 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 1rhv1e-0007Ls-Ih for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2024 12:25:54 -0500 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhv1c-0004YU-Iy for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2024 12:25:54 -0500 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-6080f51bf0aso8850397b3.0 for ; Wed, 06 Mar 2024 09:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709745951; x=1710350751; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=uPvggfXoSwt5RhWEzwP/srfqg5sJtBwL11XNmaYSp9M=; b=fBaXJHLHLG9lmYO8cIh5cmQJPB5WYSz9Du687ESVeMLn+a2VfrUt5b3eg2y6Zr1RDd a5okMcrtIH2Z/XJdVqsJ0NwY28yGap6qQ5ku6ibsz1ub7eIrDtZJQYP38mGWPKAs+gQR CjKDaGI/tK2WVd7OJ23dLauVhvgjWgzL8+HbIPflKI8/uMLidPUA0pdSECssw5AAz8M1 Hvzm9DNL5bgbzGKBkpPcdeMSE4+gQmGmJmqVJOlIzFNufsfe71rKtPym8Yl5CeenbRcC AeERmtBPQPK7a/VbcN8yvtMuQPIxwH13m41SGUCzhnQTt6A0TpaY3NqQY9OatU2JSbaK fqSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709745951; x=1710350751; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uPvggfXoSwt5RhWEzwP/srfqg5sJtBwL11XNmaYSp9M=; b=aUO4MGpJqQ15mMP0Yb48ABtsMTrNMeL67e/7Yu4N2Um+t7WYn7JrVBvDCpaYkGM9qA q6UGpsUOqPyGcKdiMr83suWX642OWnVeKTA6CwS7W98u7Uvhee+0FrKHqz2yiskM/viw xbancF+tEni8uiYbEAf2/9HY4laFLfh9eT6oxOpbIk0SvxNcDmF70tBSsO3lSWme/x/K G5pMjaizl9UBb4/s0Qfgt4tZ9z2FsAIm+P18fvEQHW38hZ1GPYEvl7gdA5iJfvyCn77T CIV9MyXpVXeFhTTDaIVfAmHpmf0xuwj9hc2G3VKMBGqOcnHzJjsB+q4NcTSrNbbmsD7i 4NFg== X-Gm-Message-State: AOJu0Ywpz+g9/uDpPUNmXXUwpseN9Khw9iJUxBJVnnugL3VdPXuzn87l pEj6Bf+ZPouXrdV96jmkKd8Lo9EJLw8gaPbOOOTzUwvFm6B6jLXqvAX5dofE931RPfnMsyGJ1ol IgpKv9ScMLomAcu+wXHO3HuFjS7f92sHDyEKjRw== X-Google-Smtp-Source: AGHT+IF5e0sIqo7EbVtnpIC272l1m0UmrMgaUnUZJJkN+4ZoMSTObgjBAERM0K+G6PsTzr44NaunCB0cylEh6jU9FLA= X-Received: by 2002:a81:4c17:0:b0:609:e9dd:696f with SMTP id z23-20020a814c17000000b00609e9dd696fmr99874ywa.5.1709745950563; Wed, 06 Mar 2024 09:25:50 -0800 (PST) MIME-Version: 1.0 From: "Divvy Cr." Date: Wed, 6 Mar 2024 17:25:40 +0000 Message-ID: Subject: 29.2; Invalid query in js--treesit-font-lock-settings prevents syntax highlighting To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000000a27a806130140da" Received-SPF: pass client-ip=2607:f8b0:4864:20::1133; envelope-from=divvycr@gmail.com; helo=mail-yw1-x1133.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 06 Mar 2024 12:36:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000000a27a806130140da Content-Type: text/plain; charset="UTF-8" Open a JavaScript file containing 'const x = 10;' for instance. Then, enable js-ts-mode (M-x js-ts-mode). Expected the literal '10' to be highlighted with font-lock-number-face, but it is not. The apparent reason is that the 'function' node name used in treesit-font-lock-rules to define js--treesit-font-lock-settings (in the file js.el) is a valid elisp function (C-h f function). This invalidates the query, as verified by running the following: (treesit-query-validate 'javascript ((function name: (identifier) @font-lock-function-name-face) (class_declaration name: (identifier) @font-lock-type-face) (function_declaration name: (identifier) @font-lock-function-name-face) (method_definition name: (property_identifier) @font-lock-function-name-face) (formal_parameters [(identifier) @font-lock-variable-name-face (array_pattern (identifier) @font-lock-variable-name-face) (object_pattern (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) (variable_declarator name: (identifier) @font-lock-variable-name-face) (variable_declarator name: (identifier) @font-lock-function-name-face value: [(function) (arrow_function)]) (variable_declarator name: [(array_pattern (identifier) @font-lock-variable-name-face) (object_pattern (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) ;; full module imports (import_clause (identifier) @font-lock-variable-name-face) ;; named imports with aliasing (import_clause (named_imports (import_specifier alias: (identifier) @font-lock-variable-name-face))) ;; named imports without aliasing (import_clause (named_imports (import_specifier !alias name: (identifier) @font-lock-variable-name-face))) ;; full namespace import (* as alias) (import_clause (namespace_import (identifier) @font-lock-variable-name-face)))) Note that this query is taken directly from the definition of js--tresit-font-lock-settings. Removing the invalid snippet above from the definition of js--treesit-font-lock-settings fixes this bug. In GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2024-03-05 built on DV-Portable System Description: Ubuntu 22.04.4 LTS Configured using: 'configure --with-pgtk --with-native-compilation --without-compress-install --with-tree-sitter' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB Important settings: value of $LANG: C.UTF-8 locale-coding-system: utf-8-unix Major mode: JavaScript Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr cl-print thingatpt help-fns radix-tree emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils pp wid-edit descr-text js c-ts-common treesit json map byte-opt imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 146459 33528) (symbols 48 22745 0) (strings 32 97373 2695) (string-bytes 1 2500148) (vectors 16 25550) (vector-slots 8 853209 33493) (floats 8 53 28) (intervals 56 282 0) (buffers 984 14)) --0000000000000a27a806130140da Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Open a = JavaScript file containing 'const x =3D 10;' for instance. Then,enable js-ts-mode (M-x js-ts-mode). Expected the literal '10' to b= e
highlighted with font-lock-number-face, but it is not.

The appa= rent reason is that the 'function' node name used in
treesit-fon= t-lock-rules to define js--treesit-font-lock-settings (in the
file js.el= ) is a valid elisp function (C-h f function). This invalidates
the query= , as verified by running the following:

(treesit-query-validate '= ;javascript ((function
=C2=A0 =C2=A0 =C2=A0 name: (identifier) @font-loc= k-function-name-face)

=C2=A0 =C2=A0 =C2=A0(class_declaration
=C2= =A0 =C2=A0 =C2=A0 name: (identifier) @font-lock-type-face)

=C2=A0 = =C2=A0 =C2=A0(function_declaration
=C2=A0 =C2=A0 =C2=A0 name: (identifie= r) @font-lock-function-name-face)

=C2=A0 =C2=A0 =C2=A0(method_defini= tion
=C2=A0 =C2=A0 =C2=A0 name: (property_identifier) @font-lock-functio= n-name-face)

=C2=A0 =C2=A0 =C2=A0(formal_parameters
=C2=A0 =C2=A0= =C2=A0 [(identifier) @font-lock-variable-name-face
=C2=A0 =C2=A0 =C2=A0= =C2=A0(array_pattern (identifier) @font-lock-variable-name-face)
=C2=A0= =C2=A0 =C2=A0 =C2=A0(object_pattern (shorthand_property_identifier_pattern= ) @font-lock-variable-name-face)])

=C2=A0 =C2=A0 =C2=A0(variable_dec= larator
=C2=A0 =C2=A0 =C2=A0 name: (identifier) @font-lock-variable-name= -face)

=C2=A0 =C2=A0 =C2=A0(variable_declarator
=C2=A0 =C2=A0 =C2= =A0 name: (identifier) @font-lock-function-name-face
=C2=A0 =C2=A0 =C2= =A0 value: [(function) (arrow_function)])

=C2=A0 =C2=A0 =C2=A0(varia= ble_declarator
=C2=A0 =C2=A0 =C2=A0 name: [(array_pattern (identifier) @= font-lock-variable-name-face)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(object_pattern
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= shorthand_property_identifier_pattern) @font-lock-variable-name-face)])
=
=C2=A0 =C2=A0 =C2=A0;; full module imports
=C2=A0 =C2=A0 =C2=A0(impo= rt_clause (identifier) @font-lock-variable-name-face)
=C2=A0 =C2=A0 =C2= =A0;; named imports with aliasing
=C2=A0 =C2=A0 =C2=A0(import_clause (na= med_imports (import_specifier
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 alias: (identifier) @font-lock-variable-name-face)))
=C2=A0 = =C2=A0 =C2=A0;; named imports without aliasing
=C2=A0 =C2=A0 =C2=A0(impo= rt_clause (named_imports (import_specifier
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 !alias
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 name: (identifier) @font-lock-variable-name-face)))

= =C2=A0 =C2=A0 =C2=A0;; full namespace import (* as alias)
=C2=A0 =C2=A0 = =C2=A0(import_clause (namespace_import (identifier)
=C2=A0 =C2=A0 =C2=A0= @font-lock-variable-name-face))))

Note that this query is taken dire= ctly from the definition of
js--tresit-font-lock-settings.

Removi= ng the invalid snippet above from the definition of
js--treesit-font-loc= k-settings fixes this bug.


In GNU Emacs 29.2 (build 1, x86_64-pc= -linux-gnu, GTK+ Version 3.24.33,
=C2=A0cairo version 1.16.0) of 2024-03= -05 built on DV-Portable
System Description: Ubuntu 22.04.4 LTS

C= onfigured using:
=C2=A0'configure --with-pgtk --with-native-compilat= ion
=C2=A0--without-compress-install --with-tree-sitter'

Conf= igured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTIN= GS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES= NATIVE_COMP
NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS = TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB

Important sett= ings:
=C2=A0 value of $LANG: C.UTF-8
=C2=A0 locale-coding-system: utf= -8-unix

Major mode: JavaScript

Minor modes in effect:
=C2= =A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 show-paren-mod= e: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2= =A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-= mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
= =C2=A0 blink-cursor-mode: t
=C2=A0 line-number-mode: t
=C2=A0 indent-= tabs-mode: t
=C2=A0 transient-mark-mode: t
=C2=A0 auto-composition-mo= de: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t<= br>
Load-path shadows:
None found.

Features:
(shadow sort m= ail-extr cl-print thingatpt help-fns radix-tree emacsbug
message mailcap= yank-media puny dired dired-loaddefs rfc822 mml mml-sec
password-cache = epa derived epg rfc6068 epg-config gnus-util
text-property-search time-d= ate mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-util= s mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail= -utils pp wid-edit descr-text js
c-ts-common treesit json map byte-opt i= menu cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-en= gine cc-vars cc-defs
cl-loaddefs comp comp-cstr warnings icons subr-x rx= cl-seq cl-macs gv
cl-extra help-mode bytecomp byte-compile cl-lib rmc i= so-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hook= s lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-w= in pgtk-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list = replace
newcomment text-mode lisp-mode prog-mode register page tab-bar m= enu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-l= ock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice = seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
= misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
= cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyri= llic chinese composite emoji-zwj charscript charprop case-table
epa-hook= jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs= theme-loaddefs faces cus-face macroexp files window
text-properties ove= rlay sha1 md5 base64 format env code-pages mule
custom widget keymap has= htable-print-readable backquote threads dbusbind
inotify dynamic-setting= system-font-setting font-render-setting cairo
gtk pgtk lcms2 multi-tty = make-network-process native-compile emacs)

Memory information:
((= conses 16 146459 33528)
=C2=A0(symbols 48 22745 0)
=C2=A0(strings 32 = 97373 2695)
=C2=A0(string-bytes 1 2500148)
=C2=A0(vectors 16 25550)=C2=A0(vector-slots 8 853209 33493)
=C2=A0(floats 8 53 28)
=C2=A0(i= ntervals 56 282 0)
=C2=A0(buffers 984 14))
--0000000000000a27a806130140da-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 12:48:47 2024 Received: (at 69589) by debbugs.gnu.org; 6 Mar 2024 17:48:47 +0000 Received: from localhost ([127.0.0.1]:51343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhvNm-00057O-Gh for submit@debbugs.gnu.org; Wed, 06 Mar 2024 12:48:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhvNl-00056h-8O for 69589@debbugs.gnu.org; Wed, 06 Mar 2024 12:48:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhvNA-0005VA-Rt; Wed, 06 Mar 2024 12:48:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x89VzVykmsiBJ3FVn0qoqokk0jI/2tUf3bV+1m+4ajs=; b=aaenPHdI7iAw BNe5OpuSVTHJ30SbTaeteVJ4gKrS2pAQut2UpjqMVrHiE3S7kyR0cIMKTaijo1aU+F62YLFB2yloX LodcHVxMUAXeI/GAeluJ0F/eSRlbIaZ9bT4aoD7K6ZTJdGys+Ogy5+fjgLJy/s+mye/ipff/RycDg zuqvvUAdYSdgPJbEtGsk/leiyoQ4nxN4KXyAS4g6PD+AQe7HsGfgHuTm+LFnSpdfwceNNab5iccZQ lc5bBxtybvqM4Qu2AaaSZd4DVC0ihyvtDBe0wCglQQjFargZUtgoHjEQLi8a7kwprYNcz5ms1H/sM yOy4LtkiOg/89TCT6Gr7Uw==; Date: Wed, 06 Mar 2024 19:48:05 +0200 Message-Id: <86wmqfjlpm.fsf@gnu.org> From: Eli Zaretskii To: "Divvy Cr." In-Reply-To: (divvycr@gmail.com) Subject: Re: bug#69589: 29.2; Invalid query in js--treesit-font-lock-settings prevents syntax highlighting References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69589 Cc: 69589@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Divvy Cr." > Date: Wed, 6 Mar 2024 17:25:40 +0000 > > Open a JavaScript file containing 'const x = 10;' for instance. Then, > enable js-ts-mode (M-x js-ts-mode). Expected the literal '10' to be > highlighted with font-lock-number-face, but it is not. > > The apparent reason is that the 'function' node name used in > treesit-font-lock-rules to define js--treesit-font-lock-settings (in the > file js.el) is a valid elisp function (C-h f function). This invalidates > the query, as verified by running the following: > > (treesit-query-validate 'javascript ((function > name: (identifier) @font-lock-function-name-face) > > (class_declaration > name: (identifier) @font-lock-type-face) > > (function_declaration > name: (identifier) @font-lock-function-name-face) > > (method_definition > name: (property_identifier) @font-lock-function-name-face) > > (formal_parameters > [(identifier) @font-lock-variable-name-face > (array_pattern (identifier) @font-lock-variable-name-face) > (object_pattern (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) > > (variable_declarator > name: (identifier) @font-lock-variable-name-face) > > (variable_declarator > name: (identifier) @font-lock-function-name-face > value: [(function) (arrow_function)]) > > (variable_declarator > name: [(array_pattern (identifier) @font-lock-variable-name-face) > (object_pattern > (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) > > ;; full module imports > (import_clause (identifier) @font-lock-variable-name-face) > ;; named imports with aliasing > (import_clause (named_imports (import_specifier > alias: (identifier) @font-lock-variable-name-face))) > ;; named imports without aliasing > (import_clause (named_imports (import_specifier > !alias > name: (identifier) @font-lock-variable-name-face))) > > ;; full namespace import (* as alias) > (import_clause (namespace_import (identifier) > @font-lock-variable-name-face)))) > > Note that this query is taken directly from the definition of > js--tresit-font-lock-settings. > > Removing the invalid snippet above from the definition of > js--treesit-font-lock-settings fixes this bug. Thanks, I believe this is bug#68879, which was already solved in the development code about a month ago. See commit 2f69353e4a75 on the emacs-29 branch of the Emacs Git repository. Can you try patching js.el with that change? From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 14:22:36 2024 Received: (at 69589-done) by debbugs.gnu.org; 6 Mar 2024 19:22:36 +0000 Received: from localhost ([127.0.0.1]:51450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhwqY-0007cC-Em for submit@debbugs.gnu.org; Wed, 06 Mar 2024 14:22:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhwqV-0007by-Ua for 69589-done@debbugs.gnu.org; Wed, 06 Mar 2024 14:22:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhwpu-0007E3-DE; Wed, 06 Mar 2024 14:21:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=g3x1sruerPaCAwn1ONW3CATFYMK8qiPxCGOl3gymKOk=; b=KIpcNrx3SMFp D/eADbgooYcnnVDE62v4TCxk26jePF9mGpR4A9/VMa/9If00uFzwwJKCfjqyN/IbB452KWZo6GLPl UUL8yjmOycR697Qeph17wfC6yj+EAJ8RlpyaGQj/Z+waCdzRASVGyhld8OeT/1wCXRuQm/QHSp1cN 6hsm1c1YKtmHzkdOZfb02liFnTSudFrLbnJizCKsa03CVD8Rlcg5WEHymrOFRwqVJivqwRh0oKR64 s9LPyVlhPPXQQe4wVVw3VCcTaqbdRxDsqKVjWIAKR2TQzHD6R/7CDAyq8HS+d45C7lQeVgEbPQna1 k7u3xrfDfxEq+sKfV4x1oA==; Date: Wed, 06 Mar 2024 21:21:51 +0200 Message-Id: <86v85zjhdc.fsf@gnu.org> From: Eli Zaretskii To: "Divvy Cr." In-Reply-To: (divvycr@gmail.com) Subject: Re: bug#69589: 29.2; Invalid query in js--treesit-font-lock-settings prevents syntax highlighting References: <86wmqfjlpm.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69589-done Cc: 69589-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Divvy Cr." > Date: Wed, 6 Mar 2024 18:00:50 +0000 > > Ah, yep, that solves it. Cheers! Thanks for testing, I'm therefore closing this bug. From unknown Sat Aug 16 21:11:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 04 Apr 2024 11:24:26 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator