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: Adding refactoring capabilities to Emacs Date: Sun, 20 Aug 2023 04:19:46 +0300 Message-ID: References: <83fs4f36wi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7835"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 20 03:20:46 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 1qXX7U-0001uu-MS for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Aug 2023 03:20:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXX6h-00010k-RD; Sat, 19 Aug 2023 21:19:55 -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 1qXX6g-00010a-55 for emacs-devel@gnu.org; Sat, 19 Aug 2023 21:19:54 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXX6d-0000uh-MS; Sat, 19 Aug 2023 21:19:53 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 6DCFA32003AC; Sat, 19 Aug 2023 21:19:49 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 19 Aug 2023 21:19:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=fm2; t= 1692494388; x=1692580788; bh=qnGqbMmql0B657Updew93CHygfizA+KgtwE QybxJMvA=; b=QFaVVn/iWSrPZeTFNjaMVmqJt2nV8TdQ6TrpQ8/rkiUp0HAzBFg +WsWUxXmnzjh/2wHeiubETAM9n7zZbc9WZbWu66eDNKD3B0fMu7syK5c6MpSbjii toDwz0egj3PSh6rDCi2bZ+o8gnCq6KJF5xs5h+Y7HGVvoFRcWXQNx1uUkEthD9wg S9Sf8R4LP+kwnTjVbHUBoIM/EAoutJ0c6QtaAlXQysYWPmSkSqwZC9hsYFqcr+Kp gNHaDBM99dM3TfVbO+TSxu5OrRic9AS5WRJIrAOUxoAr82IOCwRQ22IOCmwdi2g5 vXkNiUB37KEcS5WIhDfI6xGF+zFgT8y2Gig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm1; t=1692494388; x= 1692580788; bh=qnGqbMmql0B657Updew93CHygfizA+KgtwEQybxJMvA=; b=t s48VVLBlsWJkfu1xyb4Ych8OxYT80zG/sTfnoQjJTJ/G1bk8VTWhRonGaBm74jGm mAU/VamGfannrC7OlO/uad5ySkVAECha7TniKhFz17aKCU7TrF3VYoRHbcHf7/E3 FDcF+nsAKWwjhUT8qjqVTG5+ZmTb0hwSjRotHyImVws7YbucXNGJFCN4z3zrNNMY TTkIzEanjyPZtlJEzd4ynTIVD7M+JUClsMp9B+6/eb5Uj7PO8JLDVKJtLOMPRRXn PVjgkOJhiP80hklgw+lFMbjMXipYxb7WKCu4Qk8/ydYXHCzRw0gm6Tglm5FUv2XP 5rtjotN3hIUMXMlq8Xnvg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduiedggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeghedthedujeeiteeutddtjeekheejteeukeehffdutdejuedvfeevueeviedu udenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Aug 2023 21:19:47 -0400 (EDT) Content-Language: en-US In-Reply-To: <83fs4f36wi.fsf@gnu.org> Received-SPF: pass client-ip=64.147.123.20; envelope-from=dmitry@gutov.dev; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -46 X-Spam_score: -4.7 X-Spam_bar: ---- X-Spam_report: (-4.7 / 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, NICE_REPLY_A=-1.862, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:308944 Archived-At: On 19/08/2023 09:03, Eli Zaretskii wrote: > But back-end is just one part of this. We should IMO begin by our own > research into the UI parts of this: how does the user specify the > requested refactoring? Several alternatives are possible, and we > should study them and decide what is best for Emacs. If we had a better UI for renaming than query-replace, we could plug it into project-find-regexp and xref-find-references' output buffers. Where you currently can hit 'r' to switch to renaming action, it could instead show the proposed operation (in some fashion) and how the text will look "after". That would cover the regexp-replace and the rename-symbol refactorings. Just the basics, but still. Those could also be combined into separate commands (such as xref-find-references-and-replace). LSP clients, with their more sophisticated operations, could use the UI as well, as long as it's possible to agree on the input instructions format. And there could be some language-specific refactorings implemented in Lisp as well.