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.devel Subject: Re: treesit indentation "blinking" Date: Sat, 8 Apr 2023 04:32:13 +0300 Message-ID: References: <83bkka5z7w.fsf@gnu.org> <871ql6a4d4.fsf@gmail.com> <83jzyy4776.fsf@gnu.org> <9F152CAA-6326-459F-84FF-87988B3A92B6@gmail.com> <6bf0322b-1151-129a-e26f-61cf4f232d17@yandex.ru> <6efb9f84-211d-560e-3196-95d7f0b8be19@yandex.ru> <1874921e1d0.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> 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="19954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Cc: Dmitry Gutov , Alan Mackenzie , =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Yuan Fu , Eli Zaretskii , theodor thornhill , geza.herman@gmail.com, emacs-devel@gnu.org To: =?UTF-8?Q?Daniel_Mart=c3=adn?= , Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 08 03:33:02 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pkxRt-000504-Ri for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Apr 2023 03:33:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkxRK-00030o-Bd; Fri, 07 Apr 2023 21:32:26 -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 1pkxRI-00030Y-Qr for emacs-devel@gnu.org; Fri, 07 Apr 2023 21:32:24 -0400 Original-Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkxRH-0005qe-4Y; Fri, 07 Apr 2023 21:32:24 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id AF5BD2B066D0; Fri, 7 Apr 2023 21:32:18 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 07 Apr 2023 21:32:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1680917538; x=1680921138; bh=kNlfZg4mjntjhr/iAMokelO89Z/unz+CD0H KGsKMs3o=; b=vAn4ayXBfW9fqO0MWKTBA1LKhWtw1AAAvO1p28ORhptKpkt3FU3 HHBe04bpovJ1XDaqEZAChJ2cwPywVaDbygNK+69KcZjzMAgiV9/aoThfGDi9SWwz g8TQ8TSOlGltAUC9EFRa+hc2U2iEbCGvSMmbkpCy6hqzGvuh8/g06dGhpleUaVrL fXlf1IMk4+x2yIF6Ubw/qSJJcZZMMjKkeEr6F6XM9YYJY70LMdIwSDjlFzbdk49P EWVWeTSRFAryeuE7KLCFW+5LZjEgxp0poL/g1rre80f0YO+Wr4AVHSB6YpnpNUHp 3fm+By0jFHb5nhJs27HDmHSJPa4Rfn81wdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1680917538; x=1680921138; bh=kNlfZg4mjntjhr/iAMokelO89Z/unz+CD0H KGsKMs3o=; b=n8f7Ej7kuCH9AIP87XYlulOgM2/5Pfa7Bq0auE4OFSVySDb6sp/ 80Rj8RCD6BzEH/R9+YWkEXlG+5nWB5tC8vxD98cA++lK5l3/kZjrrCdLjfKPr2FO wx4z0YAipbRjqyLydJ1EzGIUNU0cXdUkIkUVLs8YmO5osU/hsTbY5XW0hyACpOVT RgLUYKkD1oC3tkApxeXfNnIYRyT29KYhkK2V+g/3fYF3Sh02riJpmCGUSWYMPLNe 0vOwJM+Dzcu4ArVRLsynfdJ1lGAEAkIm/tRZKzDDk6qA61YNvl5+NpAdkxJ3bW0A nYef6OqpZKnPFxLkiaWmmMd9ilccgrRu0Fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejiedggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepueffveeiffeugffgveejvdegteeuhfdugfehleelfeejtdelteethfdtieeg vddunecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Apr 2023 21:32:14 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.27; envelope-from=dmitry@gutov.dev; helo=wnew2-smtp.messagingengine.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.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, FROM_FMBLA_NEWDOM28=0.728, NICE_REPLY_A=-2.03, 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305165 Archived-At: On 07/04/2023 17:20, Daniel Martín wrote: > In general, I'd suggest taking a look at Neovim's Tree-sitter > implementation and perhaps reuse (part of) their .scm Tree-sitter syntax > highlight or indentation queries: > https://github.com/nvim-treesitter/nvim-treesitter/tree/master/queries/c > Neovim's implementation doesn't "blink" in the scenarios presented here, > but I'm not sure about how it performs in other tricky cases. Looking at that file, it does contain queries that look for ERROR nodes, e.g. ( ERROR "for" "(" @indent.begin ";" ";" ")" @indent.end) So perhaps we should revisit that approach too. > Now that text editors have access to the same programming language > grammars, I'm surprised the Tree-sitter community hasn't started any > cross-team effort to work on canonical queries (or slighter richer > abstractions) per programming language. Text editor developers are > working and rediscovering complex language problems independently. We could do an indent implementation that just uses these indents.scm files. Not exactly sure why we didn't start out this way, but note that our Lisp based solution is a lot more flexible. E.g. there doesn't seem to be an obvious way to support "indentation styles" with these.