From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71380: 30.0.50; Submitting php-ts-mode, new major mode for php Date: Fri, 07 Jun 2024 16:44:44 +0300 Message-ID: <8634pog94j.fsf@gnu.org> References: <3686989.dWV9SEqChM@3-191.divsi.unimi.it> <2137654.9o76ZdvQCi@3-191.divsi.unimi.it> <86ed99f1ly.fsf@gnu.org> <21747651.4csPzL39Zc@3-191.divsi.unimi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29426"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71380@debbugs.gnu.org To: Vincenzo Pupillo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 07 15:56:14 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 1sFa4h-0007Mo-Su for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jun 2024 15:56:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFa4L-0000RZ-Rt; Fri, 07 Jun 2024 09:55:49 -0400 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 1sFa4K-0000CO-07 for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 09:55:48 -0400 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 1sFa4J-0000BB-Fg for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 09:55:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFa4Y-0008Kn-AJ for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 09:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jun 2024 13:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71380 X-GNU-PR-Package: emacs Original-Received: via spool by 71380-submit@debbugs.gnu.org id=B71380.171776851730691 (code B ref 71380); Fri, 07 Jun 2024 13:56:02 +0000 Original-Received: (at 71380) by debbugs.gnu.org; 7 Jun 2024 13:55:17 +0000 Original-Received: from localhost ([127.0.0.1]:58964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFa3o-0007yp-Ea for submit@debbugs.gnu.org; Fri, 07 Jun 2024 09:55:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFZu2-0007VR-Ab for 71380@debbugs.gnu.org; Fri, 07 Jun 2024 09:45:10 -0400 Original-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 1sFZth-0006X0-Q5; Fri, 07 Jun 2024 09:44:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Ij5EEkZ6uEA0T99EDOIkcRgpMqSxZoJkM0zrUK0yYwY=; b=RCuJ3Wbi7F9Fze4pHtSp xJokW+g56fnr2EjWUKQiPRgxEqzBBVZvtQNAu3E/VLMatODPAtZRQm+32ODRkWJyKfsH2/+xMt2jB xPeW87wxFUJyzKcn5QCVirAyJBoeet+zsdP4cw+MsEzCWopf92NoBm6ZfAyuMCSIrwrheRckM86MC hk/dohYz/J2c5wKfu6TGiaEcYjugN8gYuFtCypgAQQYWMdet75+HrJb70nLVIJyAOvQL0iIqhB2vE y6uCmi/7K4RtOVG+8lLU/13DlgPtgSxuHs+LapD13H1pp1oIj4OLaz3SpxmIubQY852UoNUabutzy SPS4voUjbgVo5g==; In-Reply-To: <21747651.4csPzL39Zc@3-191.divsi.unimi.it> (message from Vincenzo Pupillo on Fri, 07 Jun 2024 14:50:24 +0200) 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:286772 Archived-At: > From: Vincenzo Pupillo > Cc: 71380@debbugs.gnu.org > Date: Fri, 07 Jun 2024 14:50:24 +0200 > > In data venerdì 7 giugno 2024 13:12:25 CEST, Eli Zaretskii ha scritto: > > > > > > +(defun php-ts-mode--array-element-heuristic (node parent bol &rest _) > > > > > + "Return of the position of the first element of the array. > > > > > > > > The "of" part should be deleted here, I think. > > > > > > > I'm not sure how to explain it. Different indentation styles indent the > > > elements of an array differently when written on multiple rows. For example. > > > in PSR2 it is like this: > > > $a = array("a" => 1, > > > "b" => 2, > > > "c" => 3); > > > while with Zend it is like this: > > > $a = array("a" => 1, > > > "b" => 2, > > > "c" => 3); > > > What do you suggest? > > > > What does the function return in each of these two cases? > > > If '$a = array(' is on the same line as '“a” => 1,' it returns the initial position of '“a”, > otherwise the starting position of 'array(', like PSR2. > In terms of tree-sitter-php the first case is: > (treesit-node-start (treesit-node-child parent 2)) > while the second is: parent indentation + offset. Does it return a buffer position or a column? You seem to say that sometimes it returns the former and sometimes the latter.