From unknown Tue Aug 19 23:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59445: 29.0.50; Tweak tree sitter faces in Java and TypeScript Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Nov 2022 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 59445@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166903282110126 (code B ref -1); Mon, 21 Nov 2022 12:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Nov 2022 12:13:41 +0000 Received: from localhost ([127.0.0.1]:45638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox5gD-0002dF-3O for submit@debbugs.gnu.org; Mon, 21 Nov 2022 07:13:41 -0500 Received: from lists.gnu.org ([209.51.188.17]:37060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox5gA-0002d7-HM for submit@debbugs.gnu.org; Mon, 21 Nov 2022 07:13:39 -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 1ox5g9-0002yb-QV for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 07:13:38 -0500 Received: from out0.migadu.com ([2001:41d0:2:267::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox5g7-0005QY-1g for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 07:13:37 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1669032812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=RO08eZv1ZOUF7Zwy1de8ufihBgxo1MF03q6EQ9h0OD0=; b=aevmMsEyqAqi4UFZ1eBLKECtDR5GjNsIprvZx4wHRWywPgM0Q2gysFrItqkjuyB1Phnvih I8ZahVrYyxnYmZwpLCPVjlHTdOrgvwUSHevsnoXYNJIQA8hqNcflTS68bBzIOLnTC07feQ 5qJDKxnjgKkeyB7S3s1NOVl1+7JDidMXbGww70/6+1tZSBl/lj9BQyVKuCPhJqVyyhP9YG vmz8To+lJsw4HTGoRodVMzMUPUEl1XeQjC6XtutAAb5T1fK8aUYk9s9E2ejSTkp4PjECef /5rWM7HIK6u/bTvcWU/w32ihABPSvo7pk6MLZcmiVHzppGdaIpgPr8dIvPWzWg== From: Theodor Thornhill Date: Mon, 21 Nov 2022 13:13:25 +0100 Message-ID: <87a64k8pzu.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=theo@thornhill.no; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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.4 (--) --=-=-= Content-Type: text/plain Hi Yuan! I tweaked Java and TypeScript a little. Feel free to apply when you have the time :) Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Tweak-faces-in-Java-and-TypeScript.patch >From 5fa011d763f6c799766361104e5372e10a31b54c Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Mon, 21 Nov 2022 13:12:03 +0100 Subject: [PATCH] Tweak faces in Java and TypeScript * lisp/progmodes/java-ts-mode.el (java-ts-mode--operators): Remove @ as an operator. (java-ts-mode--font-lock-settings): Use constant-face for @ to match rest of the annotation. Add bracket, delimiter and use some of the new faces. (java-ts-mode--imenu): Clean up the implementation a little. (java-ts-mode): Refer to the new features. * lisp/progmodes/ts-mode.el (ts-mode--font-lock-settings, ts-mode): Add in bracket and delimiter'. --- lisp/progmodes/java-ts-mode.el | 85 ++++++++++++++++++---------------- lisp/progmodes/ts-mode.el | 21 ++++++--- 2 files changed, 60 insertions(+), 46 deletions(-) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 62962b7293..d6e8a9d638 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -111,18 +111,14 @@ java-ts-mode--keywords "C keywords for tree-sitter font-locking.") (defvar java-ts-mode--operators - '("@" "+" ":" "++" "-" "--" "&" "&&" "|" "||" - "!=" "==" "*" "/" "%" "<" "<=" ">" ">=" "=" - "-=" "+=" "*=" "/=" "%=" "->" "^" "^=" "&=" - "|=" "~" ">>" ">>>" "<<" "::" "?") + '("+" ":" "++" "-" "--" "&" "&&" "|" "||" "=" + "!=" "==" "*" "/" "%" "<" "<=" ">" ">=" + "-=" "+=" "*=" "/=" "%=" "->" "^" "^=" + "|=" "~" ">>" ">>>" "<<" "::" "?" "&=") "C operators for tree-sitter font-locking.") (defvar java-ts-mode--font-lock-settings (treesit-font-lock-rules - :language 'java - :override t - :feature 'basic - '((identifier) @font-lock-variable-name-face) :language 'java :override t :feature 'comment @@ -144,7 +140,8 @@ java-ts-mode--font-lock-settings :language 'java :override t :feature 'operator - `([,@java-ts-mode--operators] @font-lock-builtin-face) + `([,@java-ts-mode--operators] @font-lock-operator-face + "@" @font-lock-constant-face) :language 'java :override t :feature 'annotation @@ -186,6 +183,8 @@ java-ts-mode--font-lock-settings (method_reference (identifier) @font-lock-type-face) + (scoped_identifier (identifier) @font-lock-variable-name-face) + ((scoped_identifier name: (identifier) @font-lock-type-face) (:match "^[A-Z]" @font-lock-type-face)) @@ -201,6 +200,12 @@ java-ts-mode--font-lock-settings `((method_declaration name: (identifier) @font-lock-function-name-face) + (variable_declarator + name: (identifier) @font-lock-variable-name-face) + + (element_value_pair + key: (identifier) @font-lock-property-face) + (formal_parameter name: (identifier) @font-lock-variable-name-face) @@ -215,7 +220,15 @@ java-ts-mode--font-lock-settings (method_invocation name: (identifier) @font-lock-function-name-face) - (argument_list (identifier) @font-lock-variable-name-face))) + (argument_list (identifier) @font-lock-variable-name-face)) + + :language 'java + :feature 'bracket + '((["(" ")" "[" "]" "{" "}"]) @font-lock-bracket-face) + + :language 'java + :feature 'delimiter + '((["," ":" ";"]) @font-lock-delimiter-face)) "Tree-sitter font-lock settings.") (defun java-ts-mode--imenu-1 (node) @@ -243,33 +256,27 @@ java-ts-mode--imenu-1 (defun java-ts-mode--imenu () "Return Imenu alist for the current buffer." (let* ((node (treesit-buffer-root-node)) - (class-tree - `("Class" . ,(java-ts-mode--imenu-1 - (treesit-induce-sparse-tree - node "^class_declaration$" nil 1000)))) - (interface-tree - `("Interface" . ,(java-ts-mode--imenu-1 - (treesit-induce-sparse-tree - node "^interface_declaration$" nil 1000)))) - (enum-tree - `("Enum" . ,(java-ts-mode--imenu-1 - (treesit-induce-sparse-tree - node "^enum_declaration$" nil 1000)))) - (record-tree - `("Record" . ,(java-ts-mode--imenu-1 - (treesit-induce-sparse-tree - node "^record_declaration$" nil 1000)))) - (method-tree - `("Method" . ,(java-ts-mode--imenu-1 - (treesit-induce-sparse-tree - node "^method_declaration$" nil 1000))))) - (cl-remove-if - #'null - `(,(when (cdr class-tree) class-tree) - ,(when (cdr interface-tree) interface-tree) - ,(when (cdr enum-tree) enum-tree) - ,(when (cdr record-tree) record-tree) - ,(when (cdr method-tree) method-tree))))) + (class-tree (treesit-induce-sparse-tree + node "^class_declaration$" nil 1000)) + (interface-tree (treesit-induce-sparse-tree + node "^interface_declaration$" nil 1000)) + (enum-tree (treesit-induce-sparse-tree + node "^enum_declaration$" nil 1000)) + (record-tree (treesit-induce-sparse-tree + node "^record_declaration$" nil 1000)) + (method-tree (treesit-induce-sparse-tree + node "^method_declaration$" nil 1000)) + (class-index (java-ts-mode--imenu-1 class-tree)) + (interface-index (java-ts-mode--imenu-1 interface-tree)) + (enum-index (java-ts-mode--imenu-1 enum-tree)) + (record-index (java-ts-mode--imenu-1 record-tree)) + (method-index (java-ts-mode--imenu-1 method-tree))) + (append + (when class-index `(("Class" . ,class-index))) + (when interface-index `(("Interface" . ,interface-index))) + (when enum-index `(("Enum" . ,enum-index))) + (when record-index `(("Record" . ,record-index))) + (when method-index `(("Method" . ,method-index)))))) ;;;###autoload (define-derived-mode java-ts-mode prog-mode "Java" @@ -302,9 +309,9 @@ java-ts-mode ;; Font-lock. (setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings) (setq-local treesit-font-lock-feature-list - '((basic comment keyword constant string operator) + '((comment keyword constant string) (type definition expression literal annotation) - ())) + (bracket delimiter operator))) ;; Imenu. (setq-local imenu-create-index-function #'java-ts-mode--imenu) diff --git a/lisp/progmodes/ts-mode.el b/lisp/progmodes/ts-mode.el index 01719a89ee..a91eba6501 100644 --- a/lisp/progmodes/ts-mode.el +++ b/lisp/progmodes/ts-mode.el @@ -210,18 +210,18 @@ ts-mode--font-lock-settings :language 'tsx :override t :feature 'property - `((pair key: (property_identifier) @font-lock-variable-name-face) + `((pair key: (property_identifier) @font-lock-property-face) (pair value: (identifier) @font-lock-variable-name-face) (pair - key: (property_identifier) @font-lock-function-name-face + key: (property_identifier) @font-lock-property-face value: [(function) (arrow_function)]) (property_signature - name: (property_identifier) @font-lock-variable-name-face) + name: (property_identifier) @font-lock-property-face) - ((shorthand_property_identifier) @font-lock-variable-name-face) + ((shorthand_property_identifier) @font-lock-property-face) ((shorthand_property_identifier_pattern) @font-lock-variable-name-face)) @@ -230,7 +230,7 @@ ts-mode--font-lock-settings :override t :feature 'pattern `((pair_pattern - key: (property_identifier) @font-lock-variable-name-face) + key: (property_identifier) @font-lock-property-face) (array_pattern (identifier) @font-lock-variable-name-face)) @@ -249,7 +249,14 @@ ts-mode--font-lock-settings [(nested_identifier (identifier)) (identifier)] @font-lock-function-name-face) - (jsx_attribute (property_identifier) @font-lock-constant-face))) + (jsx_attribute (property_identifier) @font-lock-constant-face)) + :language 'tsx + :feature 'bracket + '((["(" ")" "[" "]" "{" "}"]) @font-lock-bracket-face) + + :language 'tsx + :feature 'delimiter + '((["," ":" ";"]) @font-lock-delimiter-face)) "Tree-sitter font-lock settings.") ;;;###autoload @@ -297,7 +304,7 @@ ts-mode (setq-local treesit-font-lock-feature-list '((comment declaration) (string keyword identifier expression constant) - (property pattern jsx))) + (property pattern jsx bracket delimiter))) ;; Imenu. (setq-local imenu-create-index-function #'js--treesit-imenu) -- 2.34.1 --=-=-=-- From unknown Tue Aug 19 23:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59445: 29.0.50; Tweak tree sitter faces in Java and TypeScript Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 02:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: 59445@debbugs.gnu.org Received: via spool by 59445-submit@debbugs.gnu.org id=B59445.16690847891322 (code B ref 59445); Tue, 22 Nov 2022 02:40:02 +0000 Received: (at 59445) by debbugs.gnu.org; 22 Nov 2022 02:39:49 +0000 Received: from localhost ([127.0.0.1]:49276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxJCP-0000LG-Dr for submit@debbugs.gnu.org; Mon, 21 Nov 2022 21:39:49 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]:59697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxJCJ-0000Kz-T6 for 59445@debbugs.gnu.org; Mon, 21 Nov 2022 21:39:48 -0500 Date: Tue, 22 Nov 2022 02:39:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1669084776; x=1669343976; bh=3bmXWwmg7Zcytc42AFiT1t321xC4ECVI2DtWfMGGEOA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=RkiisnrFMxcMPMxEuSv0bBlkD317yvgjJCORpm5sdn7F5K6DvU21MNdOTdOKRG3iP NxPOwoSQB4WIxiJyhu8YieWHGuP/Dzefab+Xwq1K8ETikoCcz4ijwRF17m9j1o6q/4 5jGM8Gsc6KiL6/H1CHcKkPb4Ac7rErBdLS/tUa7nDli/g1+1p8MP2BSc68SB7gXuwP isulcEB2Me7kxLrp4neRyNhhYRhF48dc2dOxe7tobhJQvUt4k+h4xXQGYirVJVFoL6 C2ry0lGtYMi+PRksYwkUqANm6c5NpMjb2KGt3D0yy+p/5+T4i0ujnVUVZ8c5FrFRKx eidfIXuYkJD0Q== From: Randy Taylor Message-ID: In-Reply-To: <87a64k8pzu.fsf@thornhill.no> References: <87a64k8pzu.fsf@thornhill.no> Feedback-ID: 44397038:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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: -1.0 (-) On Monday, November 21st, 2022 at 07:13, Theodor Thornhill via "Bug reports= for GNU Emacs, the Swiss army knife of text editors" wrote: >=20 > Hi Yuan! >=20 > I tweaked Java and TypeScript a little. >=20 > Feel free to apply when you have the time :) >=20 > Theo Looks good. For java-ts-mode.el can you show examples of what bracket and delimiter hig= hlight with your changes? I couldn't get them to highlight anything when I = tested and I had the exact same queries as you, hence why I left them out o= f my patch. Similar thing occurred with sh-script.el. From unknown Tue Aug 19 23:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59445: 29.0.50; Tweak tree sitter faces in Java and TypeScript References: <87a64k8pzu.fsf@thornhill.no> In-Reply-To: <87a64k8pzu.fsf@thornhill.no> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 11:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Randy Taylor Cc: 59445@debbugs.gnu.org, Theodor Thornhill Received: via spool by 59445-submit@debbugs.gnu.org id=B59445.16691170517073 (code B ref 59445); Tue, 22 Nov 2022 11:38:02 +0000 Received: (at 59445) by debbugs.gnu.org; 22 Nov 2022 11:37:31 +0000 Received: from localhost ([127.0.0.1]:50042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxRak-0001pw-LO for submit@debbugs.gnu.org; Tue, 22 Nov 2022 06:37:31 -0500 Received: from mx0b-0016e101.pphosted.com ([148.163.141.31]:15570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxQCR-0007v9-Sc for 59445@debbugs.gnu.org; Tue, 22 Nov 2022 05:08:21 -0500 Received: from pps.filterd (m0151360.ppops.net [127.0.0.1]) by mx0b-0016e101.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AMA8Jj6001818 for <59445@debbugs.gnu.org>; Tue, 22 Nov 2022 02:08:19 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; h=from : content-type : content-transfer-encoding : mime-version : subject : message-id : date : cc : to; s=campus; bh=b7Nx1ixWskPbxtsXJuNRV0VAco0rMb6McpbsAUVJvYc=; b=erjgJpkqJ8CEUM8qgFUIFGIQtMW+2EnP1JwHMOdabBBoK7KZMv4EZP1Fam0ZogY7qxAJ AbeirAAjvxT95hmPxeNh+/cHo2YrL8gk3fqfB0lVjDM0n7gxcM0SqMgnjbCP5Lpcjs3h MmtAlvV1mKNGdpZUSmTgv4c57vkhtTI2ncL8ezAQSixcxU/i1KgZXiIA8fp+g1sJhM+s HsKlcJQIVp+XrnUd0HZ0SDYgpCCsa30bFFFAxC1dnOeRmV+GCEnZ0wYGbBB9Quop/TlD pGkM3H/zXenpqp16xsAuozfXPQOn0wtUxfW+vL0g9Gg7Fcy1NFWe4Nh3K7qxDU3nnLU9 1w== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0b-0016e101.pphosted.com (PPS) with ESMTPS id 3kyganjfj6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <59445@debbugs.gnu.org>; Tue, 22 Nov 2022 02:08:19 -0800 Received: by mail-pg1-f198.google.com with SMTP id h185-20020a636cc2000000b0046fc6e0065dso8339804pgc.5 for <59445@debbugs.gnu.org>; Tue, 22 Nov 2022 02:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; s=google; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=b7Nx1ixWskPbxtsXJuNRV0VAco0rMb6McpbsAUVJvYc=; b=a7YB5VeP92aUHMvSlIT/tEeplWTzMTV+tW6jmPjE/ogXvLdezEJkuQNFRcJR3pULzJ SDvQnh1OATfg7tvB++t+KCux6ffSYAHY4yyJrpdpIgvgE1pbW3W/7cET1OHE3/D1/lBs RNRgQPUUd4C5pn2AiY8B0w5KXM03K19Oytglc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b7Nx1ixWskPbxtsXJuNRV0VAco0rMb6McpbsAUVJvYc=; b=jy91Z4/7IOJb5SPsGcOZiv45zSxIiqHt9T0h0GQly8gOmsBO5rHu7bcb8THgkPuYL4 WBHsfEccTU6kdLs5G6+evf22x2G2oBbw0jNsOT7ilfXO3jq50y15gcR63ESYYKuyJhtE hbdT/XWlGUMIlAL/jIht0640281XYtFlpUSlVeljMprsPAIufRogPuiB071foytQe5IW beVm6GDUujtKbCwJHAHKRvzZ+i3mYATu3KsgC+Fk6HOAhiA9qBCHbnYRj4XHCx55NFxM ydRSWYyQmo1eAmVtr3t+NGG8Yb6sEVF2Bj2T43/lppdXbmoFlLVNr0H3alAgMhEUBh+c 0Ikw== X-Gm-Message-State: ANoB5pmtKq3VMlW85nRw1meXb7DBeky3y5ETxMLxmoPKQbKWgkqfzXYt BaQdENFTraSaOc1ftdpbF2gnSnCMS1PkRECYsrFtTfgSOY2HtXiwBzpgT4V5UhwMsgnChWYtswm H1eTGn8KZ5gCZFA== X-Received: by 2002:a65:6118:0:b0:476:d2e9:778e with SMTP id z24-20020a656118000000b00476d2e9778emr5618908pgu.309.1669111697823; Tue, 22 Nov 2022 02:08:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6YNR8bblTaWdkLuCmXY4uz0TYhk7NxN8utmB30IsqJ3aDl/IxT327m5oGcUr7+y5wYlmnd4w== X-Received: by 2002:a65:6118:0:b0:476:d2e9:778e with SMTP id z24-20020a656118000000b00476d2e9778emr5618892pgu.309.1669111697506; Tue, 22 Nov 2022 02:08:17 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id y15-20020aa79aef000000b00565cbad9616sm10258994pfp.6.2022.11.22.02.08.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2022 02:08:17 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Message-Id: Date: Tue, 22 Nov 2022 02:08:16 -0800 X-Mailer: Apple Mail (2.3696.120.41.1.1) X-campus_gsuite: gsuite_33445511 X-Proofpoint-ORIG-GUID: ivJP5gEKVeU6Tcj6L8SfihPSqdqKwC8h X-Proofpoint-GUID: ivJP5gEKVeU6Tcj6L8SfihPSqdqKwC8h pp_allow_relay: proofpoint_allowed X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_04,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=738 priorityscore=1501 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 impostorscore=0 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211220074 X-Spam-Score: -0.0 (/) X-Mailman-Approved-At: Tue, 22 Nov 2022 06:37:29 -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: -1.0 (-) Randy Taylor writes: > On Monday, November 21st, 2022 at 07:13, Theodor Thornhill via "Bug > reports for GNU Emacs, the Swiss army knife of text editors" > wrote: > >>=20 >> Hi Yuan! >>=20 >> I tweaked Java and TypeScript a little. >>=20 >> Feel free to apply when you have the time :) >>=20 >> Theo Thanks, I just applied this patch. > > Looks good. > > For java-ts-mode.el can you show examples of what bracket and > delimiter highlight with your changes? I couldn't get them to > highlight anything when I tested and I had the exact same queries as > you, hence why I left them out of my patch. Similar thing occurred > with sh-script.el. Have you tried using treesit-query-capture to "manually" capture these nodes? I always use (treesit-query-capture (treesit-buffer-root-node) = (region-beginning) (region-end)) Yuan From unknown Tue Aug 19 23:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59445: 29.0.50; Tweak tree sitter faces in Java and TypeScript Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 22:32:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: 59445@debbugs.gnu.org, Theodor Thornhill Received: via spool by 59445-submit@debbugs.gnu.org id=B59445.16691563232783 (code B ref 59445); Tue, 22 Nov 2022 22:32:04 +0000 Received: (at 59445) by debbugs.gnu.org; 22 Nov 2022 22:32:03 +0000 Received: from localhost ([127.0.0.1]:52815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxboB-0000ij-BL for submit@debbugs.gnu.org; Tue, 22 Nov 2022 17:32:03 -0500 Received: from mail-4317.proton.ch ([185.70.43.17]:28905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxbo8-0000i0-MS for 59445@debbugs.gnu.org; Tue, 22 Nov 2022 17:32:02 -0500 Date: Tue, 22 Nov 2022 22:31:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1669156313; x=1669415513; bh=f0KqoOcm5vSst2HLTfM055ippU+WovJtk/vqhrDaMpU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=FZxs42/99rZJ/QP6dHuqZh33W7sOnaOxaxNJe9f4lywj8eYexUP0Y+mN1WXXxps2A 8INB807bpV+rCym6rTticu0b20XxHhhPtISnGg/VgepFcTJN/c2QTjndOr1n9SRjGe wew2hUdb4VKa7xWpnCgbVFPyk1LCIvgdo6Vw4pfw2ysYV1wTZseHwBx7vvmiTFB8HP IKjhhA2O9p2K8W7IMfZ0qVgwjTiv+ZbnMec583yDgu7Qr6HbgLSRhKVmzWtKPM0fU8 SBc8U7TlQ1IvJMVDvBSkJVeXYHpnrXmb3ysHU2WIC1srfJvXDQ2NHQChgMzoPs4SAA IXdWRpgl5Brgg== From: Randy Taylor Message-ID: <8jAFlf0dCG5QH3h6OnxdRHn-1Hn1n0MRxqOS7DZG5P9FvrZQyB58k5VuIzArBeOWtANYw44vWHXs_8VBbf-2a7Bo7GCjdwESAyMHT4uu9s4=@rjt.dev> In-Reply-To: References: <87a64k8pzu.fsf@thornhill.no> Feedback-ID: 44397038:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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: -1.0 (-) On Tuesday, November 22nd, 2022 at 05:08, Yuan Fu via "Bug reports for GNU = Emacs, the Swiss army knife of text editors" wrote: >=20 > Randy Taylor dev@rjt.dev writes: >=20 > > On Monday, November 21st, 2022 at 07:13, Theodor Thornhill via "Bug > > reports for GNU Emacs, the Swiss army knife of text editors" > > bug-gnu-emacs@gnu.org wrote: > >=20 > > > Hi Yuan! > > >=20 > > > I tweaked Java and TypeScript a little. > > >=20 > > > Feel free to apply when you have the time :) > > >=20 > > > Theo >=20 >=20 > Thanks, I just applied this patch. >=20 > > Looks good. > >=20 > > For java-ts-mode.el can you show examples of what bracket and > > delimiter highlight with your changes? I couldn't get them to > > highlight anything when I tested and I had the exact same queries as > > you, hence why I left them out of my patch. Similar thing occurred > > with sh-script.el. >=20 >=20 > Have you tried using treesit-query-capture to "manually" capture these > nodes? I always use >=20 > (treesit-query-capture (treesit-buffer-root-node) (region-beginni= ng) (region-end)) >=20 >=20 > Yuan >=20 No, I've never tried that before. But I found out what the problem was: '(["(" ")" "[" "]" "{" "}"] @font-lock-bracket-face) The above query works fine for javascript and typescript, but not for java.= Java needs it to be (note the parens surrounding the brackets): '((["(" ")" "[" "]" "{" "}"]) @font-lock-bracket-face) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 23 13:34:10 2022 Received: (at control) by debbugs.gnu.org; 23 Nov 2022 18:34:10 +0000 Received: from localhost ([127.0.0.1]:56194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxuZW-0001sJ-0T for submit@debbugs.gnu.org; Wed, 23 Nov 2022 13:34:10 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:35755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxuZU-0001rs-7z for control@debbugs.gnu.org; Wed, 23 Nov 2022 13:34:08 -0500 Received: by mail-pj1-f45.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso2923670pjt.0 for ; Wed, 23 Nov 2022 10:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=SPsiOmhzRXWg7xs5BjlS5Psit9vI+Y087rTmiXTu9YA=; b=YpriVZlgTpUdxbz4/Ru59NPTrsbM92wvaxah1vfJOeGaR+/UPvMyFvBjXi2ONtXVxc NY/UgT5pUVOz4zkudY7fZ6Rw1jHebM3C8URj1cjjciqaWwo3wJXzV07ZVatU7BZ8ZLBU cV0DXWiP9UavecV2tTbBIyLH56iAxi9SvtcQ7GNAF6T5FnqNr+H8PeOjbh9nfVvlopSy CrvIyjFIiacH71CgkrJQ7hIs9G8iOWVv32i/K7g4y0W3oVZCs3AYzNRl/EbHw6nmI73E yyXd/75f8P2BVCVAuz07deq6vNfH7ghK5gIcCHrGE5eDZHB4Gdo7IghJDPTr50c3JiW0 Nqrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SPsiOmhzRXWg7xs5BjlS5Psit9vI+Y087rTmiXTu9YA=; b=BrbVYOcg+CkYhIYBkYQx58MVI0M+s2HMNjaBu++gugZIqoKcvFr3J9wFniuLDZpqea RrxpEFaMjraY2TVQOnRhgEWk2qIXjobCg1UPbIZrQSxj4LhnNCHUwA2oKSpb4vG5Fzba T0Te0A9kZwaDgwhLy1y3XxJrlWqM0RLaKPtle+osGSFX8x1OfIytARJ+QvL0Ke0SknKg m1deITgYA0J7zmuoLE3USWlblIpVp1SCgPKIFvf3PzfApJkUyVIr7GnpmUCfFoU5gnCg vBnPkRasQp0C4WJNa6QlqBdu61GbOUaxEkUMjLkBDuHfARpS2JQrGg0TgPPgItR2hyZl uB7Q== X-Gm-Message-State: ANoB5pmdn0ZsngEtOXKDWgXfYSawHwfg/iACRpZrsuvTSyF2nveuTx11 DaroOpFRfNl3MQVjF9UjhU4iGrFHppCoWg== X-Google-Smtp-Source: AA0mqf5BipogmZ3amY3k53Ext9DifBMN5f6ZtIKp97Y4Fp9cj8GUKaHqZaRvIozRjrRudL7fTyEpGQ== X-Received: by 2002:a17:90a:610:b0:218:dd87:9cf8 with SMTP id j16-20020a17090a061000b00218dd879cf8mr5957949pjj.131.1669228442347; Wed, 23 Nov 2022 10:34:02 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id t5-20020a170902e1c500b00187197c499asm14562620pla.164.2022.11.23.10.34.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2022 10:34:02 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: control message for bug #59445 Message-Id: <308AA52E-5A00-4E4E-931E-96FB1B6CA765@gmail.com> Date: Wed, 23 Nov 2022 10:34:01 -0800 To: control@debbugs.gnu.org X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control 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: -1.0 (-) close 59445 29.1 quit