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.bugs Subject: bug#74525: 30.0.92; [PATCH]: php-ts-mode: Improved support for PHP 8.4 and more reliable indentation. Date: Mon, 25 Nov 2024 11:45:47 +0100 Message-ID: <2731581.vuYhMxLoTh@3-191.divsi.unimi.it> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart4924036.OV4Wx5bFTl" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36301"; mail-complaints-to="usenet@ciao.gmane.io" To: 74525@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 25 11:46:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tFWbr-0009IE-Om for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Nov 2024 11:46:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFWbU-0005zc-Fe; Mon, 25 Nov 2024 05:46:04 -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 1tFWbS-0005z8-Hd for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 05:46:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFWbS-0005LX-99 for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 05:46:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=vEdjEft9C0fnAe6xEkATju3utIEYGgD/6OmevSTHBRw=; b=CL+SZb9YB57/aQrAOz6vdbds/cN1jR9MFDGwMYYcAk4xKI1Hx75/xwXdgySgbD3AOuVli6L1WPQYJ+8aLgvzyFyq8t1v0VjtVMD0xP7hm2D3siTKWy+ldsJPPfNBWTFITsvnE7sBUxPCZuHGVHn0NIZEICG5viMYsJoHqqbrfP0N0XzmfEyCgvJPCYEcKkd+ctWDscpA5Kx4G+Es/gmGeGrY/kon5DQ5+Hd5j0vePICmT7nWsheMYpWcEjSG2+MqMmZD2dlNzojCJyUo34/NeO59GVJw0ZtcSceA/CD5DevHigbc+d9f8+/HaFimy/Vggjc4c4Ly5mdZnVXE7YYj+g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFWbR-0000Ro-Tq for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 05:46:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vincenzo Pupillo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2024 10:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74525 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17325315581709 (code B ref -1); Mon, 25 Nov 2024 10:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Nov 2024 10:45:58 +0000 Original-Received: from localhost ([127.0.0.1]:38075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFWbN-0000RU-UA for submit@debbugs.gnu.org; Mon, 25 Nov 2024 05:45:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFWbK-0000RI-MU for submit@debbugs.gnu.org; Mon, 25 Nov 2024 05:45:56 -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 1tFWbK-0005yg-5H for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 05:45:54 -0500 Original-Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFWbH-0005JR-Up for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 05:45:53 -0500 Original-Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434a10588f3so3556365e9.1 for ; Mon, 25 Nov 2024 02:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732531549; x=1733136349; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=vEdjEft9C0fnAe6xEkATju3utIEYGgD/6OmevSTHBRw=; b=Cqsuow/9cm0UHORNALFRwlEquz0Q6eQHXAN25obTRkQqps4XvRgq5yNOnjsUgn5pug xMcfGbx4g04ZMA8yBunpNJnDLZlnfCsuMdrrxmO5046XeaTsVjqDuABizhhXSZRZWIIn RAf8YvM2gpikELtImMCg4JosdFGSsRZ2uz1FMGbBuNRio/aRtmLEvZexGnvlRcgRrV8H 9AU/imAPl9HJHN7dpwT1sR1vpayc8YVn+g6VsbYebdEshe8AAdCz0Pjp08SQrlukwFS3 nhYzxOcSQhXTanBo5LMnLlnkUFTfeXo5uv6m4A4bfyW8mZ7XBnQEOxziQInw88FVW57i HaAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732531549; x=1733136349; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vEdjEft9C0fnAe6xEkATju3utIEYGgD/6OmevSTHBRw=; b=Jricjp3TXajqPmsBvumEQRGo+PAvAqGq9YF91N6DbcV+79hBHyfxGcUxeDdweACWGw UysJq5dLZZqb7xV3UGgxcTCLbpECQINRYr79C2BS5ouVdBiP1fbiJnQYW3VX3Ha492Qm GneczOyPkIHOoGlnsQjG4jVqsssDnH84SrivgrmPv9ksKBjtuCkYvaDpXoHAB/ZvMhO8 ASVa4WP/1kWALPb2uttrlUzQOxo9KDZtLTtqE6vRjuR8ISuT8gLATUIjsCs790tBQ4ps yuzJojnWCirGfqguMhjoOngNZ8hW/S8wJQrj8lIdJvh6yABt+jO+l4drfSo+TSzn3dKw Teaw== X-Gm-Message-State: AOJu0YyWWcTYwr8kCGgiahp/qrJSSqIlltHZhBkb/TZOIN+MKPw6YXtF yoQjUz3z0EbYcwWCNUEzFcJWbYjOVlERwqZ8gzEXAJhN1CHPVJPgb1P8tQ== X-Gm-Gg: ASbGncsWA8QpldsGbmcOoySjIZjH26cRBjnvqd23UQri+V/1OicnU07FrYuJunc14nV sIDVakxyC2qR07Qjb4jBuQfYgEqGyU5TYmCxo9gZab5aKCRfdyB2+D7DQGNAu+7yrW4M177mLvC ihfrNnUpdVngl/GRPtF1Pdqek6KddKCE0tlyzytugKQyOkAj6jfFWEqVLvzgdhnj9WSbcl5BkEc 7FQf7eT9COgORvpVv0mPWNorftTGcrzMQP4AdmevRI0O/hqQ0mo9ENyocRXXKSE8W41CQ6KjUao vh0= X-Google-Smtp-Source: AGHT+IFXAPtsJd5WIjqaS7pdgZqr4oKb3JOadnqZ9wL/8NGYVs2pKLi3Lk9+rI1Kygpr93ykYc2faA== X-Received: by 2002:a05:600c:1c95:b0:430:4db0:3fef with SMTP id 5b1f17b1804b1-433ce429de8mr113878745e9.15.1732531548465; Mon, 25 Nov 2024 02:45:48 -0800 (PST) Original-Received: from 3-191.divsi.unimi.it (3-191.divsi.unimi.it. [159.149.3.191]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433cde98b5bsm123657365e9.44.2024.11.25.02.45.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 02:45:48 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=v.pupillo@gmail.com; helo=mail-wm1-x333.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, 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295939 Archived-At: This is a multi-part message in MIME format. --nextPart4924036.OV4Wx5bFTl Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Ciao, PHP 8.4 has just been released. This patch supports a feature just introduced in tree-sitter-php, the 'property_hook'. It also improves both indentation and syntax highlighting of CSS and JavaScript blocks. Thank you. Vincenzo --nextPart4924036.OV4Wx5bFTl Content-Disposition: attachment; filename="0001-Improved-support-for-PHP-8.4-and-more-reliable-inden.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0001-Improved-support-for-PHP-8.4-and-more-reliable-inden.patch" >From ec8a2e49bae788a98147bbfaff460f12e29b5901 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Mon, 25 Nov 2024 11:06:02 +0100 Subject: [PATCH] Improved support for PHP 8.4 and more reliable indentation. Added support for PHP 8.4 property hook. More reliable CSS and Javascript syntax indentation and highlighting. * lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist): Switch to the latest php grammar. (php-ts-mode--js-css-tag-bol): CSS and Javascript indentation is now more more reliable in different formatting styles. (php-ts-mode--test-property-hook-clause-p): New function that tests property_hook support. (php-ts-mode--font-lock-settings): Use the new function. (php-ts-mode--colorize-css-value): The function now behaves exactly like the one in css-ts-mode. (php-ts-mode--feature-list): Changed the list to match css-ts-mode. --- lisp/progmodes/php-ts-mode.el | 48 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index f9fd03cbf72..d090c068d31 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -84,7 +84,7 @@ ;;; Install treesitter language parsers (defvar php-ts-mode--language-source-alist - '((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.23.5" "php/src")) + '((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.23.11" "php/src")) (phpdoc . ("https://github.com/claytonrcarter/tree-sitter-phpdoc")) (html . ("https://github.com/tree-sitter/tree-sitter-html" "v0.23.0")) (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "v0.23.0")) @@ -477,16 +477,20 @@ php-ts-mode--first-sibling (treesit-node-start parent) (line-end-position)))))) -(defun php-ts-mode--js-css-tag-bol (node _parent &rest _) +(defun php-ts-mode--js-css-tag-bol (_node parent &rest _) "Find the first non-space characters of html tags