From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes Date: Thu, 23 Mar 2023 03:03:00 +0200 Message-ID: <2fd8f2b8-d9c4-c825-a789-f2d42324859f@yandex.ru> References: <87fs9yur7r.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4235"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Cc: casouri@gmail.com To: Wilhelm Kirschbaum , 62333@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 23 02:04:14 2023 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 1pf9NF-0000w6-PY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Mar 2023 02:04:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pf9N6-00026u-5T; Wed, 22 Mar 2023 21:04:04 -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 1pf9N4-00026Z-EO for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 21:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pf9N4-0007mx-4a for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 21:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pf9N4-0002Ph-0F for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2023 21:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Mar 2023 01:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62333 X-GNU-PR-Package: emacs Original-Received: via spool by 62333-submit@debbugs.gnu.org id=B62333.16795333909208 (code B ref 62333); Thu, 23 Mar 2023 01:04:01 +0000 Original-Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 01:03:10 +0000 Original-Received: from localhost ([127.0.0.1]:36944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf9ME-0002OS-8D for submit@debbugs.gnu.org; Wed, 22 Mar 2023 21:03:10 -0400 Original-Received: from mail-ed1-f41.google.com ([209.85.208.41]:34528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf9MC-0002OC-A7 for 62333@debbugs.gnu.org; Wed, 22 Mar 2023 21:03:08 -0400 Original-Received: by mail-ed1-f41.google.com with SMTP id b20so47255006edd.1 for <62333@debbugs.gnu.org>; Wed, 22 Mar 2023 18:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679533382; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=/BpZ/NJDdRGAkkMUmss/Z2sccZx+ul/VFz3ut3vPSpM=; b=b/LeXdC5NF8cz2XGVXhg9nU9hXY/Eakp+qmmQjYK2V+M84R5nVKoN8ejGdumnaL85G UnTGp4ucHeugPHHOCm5deCGz80lF1mJLJ9cuRL/hP+o7taOeyLt7pf2167rUIzhh+Mg4 Cz/x7S71BYR8J+J9tZ6teSfQm3dll6r9VpohZbQYqs3QKe8x/FLCIC2cG5kZMGZ/ccIy 2zOYAwlTGdK6g4L7RgVZhftX2sSfEjUOHM7UyDeWHbG8g87E9hbHrfdj49igCG3Pyz4i 0af1vuf79nRuf09hUj9QNs5YWeDHNumSLJUSGi13jndVV68jPYuuJSCk18jvvfcKQ6eC eAdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679533382; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/BpZ/NJDdRGAkkMUmss/Z2sccZx+ul/VFz3ut3vPSpM=; b=FzNdYzFNaA5u9n9oR+qrD8hQmgt0wWTW+A0hpujjv/rO3ndH4F8ZoyTUFY1N99NJDG DEa7i5KYUJMhbDcwwEtazT/8lE/4U2GzxVUQ2bjgpynGMIvrLLb9rUFXyYIJyIl0ESiH z1lI1b3KiBlopGioO5GcavNcIpLCnrP5eR28bXSN6/U5Q4FAxgV8L2CnbR7doS52B5Od KxdH1Iq8LWarPt4p17gGk/qzwpJVxD9vCOztoK3Kvkh/QVe4xpOkp9U0sNpHzcAxX1XW g5twWMCCQyTcNQcHvVltqHevArXeJmh+VAWCz/3F/BfIawPvI/L/AIMsgERWd5818yYI yOTw== X-Gm-Message-State: AO0yUKU7pbAcwbAO8myLiVc26jVYlFiKswjx3npTTzWg1EkU5Q8mcnk7 +a+VTS6eMbz4PDNvGxqDykk= X-Google-Smtp-Source: AK7set8lPiCjfUpAU+ClNfEwWmCXvlmSu6McPWhBiI4pf3Imt5Vl1iayyc9B/CVudm2esfxeAliAXQ== X-Received: by 2002:aa7:da0a:0:b0:501:cced:9c6c with SMTP id r10-20020aa7da0a000000b00501cced9c6cmr7958727eds.7.1679533382100; Wed, 22 Mar 2023 18:03:02 -0700 (PDT) Original-Received: from [192.168.0.2] ([85.132.229.92]) by smtp.googlemail.com with ESMTPSA id u22-20020a50d516000000b004ad601533a3sm8545169edi.55.2023.03.22.18.03.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Mar 2023 18:03:01 -0700 (PDT) Content-Language: en-US In-Reply-To: <87fs9yur7r.fsf@gmail.com> 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:258422 Archived-At: On 21/03/2023 16:00, Wilhelm Kirschbaum wrote: > > With the following text in a buffer with elixir-ts-mode: > > def foo() do > end > > When I delete the `)` and re-insert it, the tree-sitter syntax tree does > not fully recover and the `do end` part is absent when observing using > treesit-explore-mode. > > Before removing the `)`: > > (source > (call target: (identifier) >  (arguments >   (call target: (identifier) >    (arguments ( )))) >  (do_block do end))) > > after re-inserting `)`: > > (source > (call target: (identifier) >  (arguments >   (call target: (identifier) >    (arguments ( )))))) > > I can see the same behaviour using ruby-ts-mode when I remove the > following expression: > > (setq-local syntax-propertize-function #'ruby-ts--syntax-propertize) > > The ruby syntax I tested with: > > def foo() > end > > When I add a local `syntax-propertize-function' function to elixir-ts-mode > it also solves the problem of not fully recovering the tree-sitter > syntax tree.  It does not seem to matter what the function achieves > thought, so am a bit confused. I can repro both scenarios. Except with ruby-ts-mode, the difference in printed AST is the added wrapping in (program ...). But the visible result is similar: "end" not being highlighted.