From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#60338: [PATCH] Add option to present server changes as diffs Date: Fri, 09 Jun 2023 07:55:49 +0000 Message-ID: <87ttvht6gq.fsf@posteo.net> References: <6829F6A2-C6FD-4807-B3D2-1E740ED496BC@gmail.com> <87zgb6gu71.fsf@posteo.net> <87v8lugtou.fsf@posteo.net> <87k0297wtp.fsf@posteo.net> <87lemi6mte.fsf@betli.tmit.bme.hu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33746"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 60338@debbugs.gnu.org, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: Felician Nemeth Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 09 09:56:32 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 1q7Wz2-0008Xt-7q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jun 2023 09:56:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7Wyd-0007yC-Pw; Fri, 09 Jun 2023 03:56:07 -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 1q7Wyb-0007xq-A3 for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 03:56:05 -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 1q7WyX-00019x-Ri for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 03:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q7WyX-0006mZ-Nb for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 03:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 07:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60338 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60338-submit@debbugs.gnu.org id=B60338.168629736026064 (code B ref 60338); Fri, 09 Jun 2023 07:56:01 +0000 Original-Received: (at 60338) by debbugs.gnu.org; 9 Jun 2023 07:56:00 +0000 Original-Received: from localhost ([127.0.0.1]:58255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7WyW-0006mJ-8C for submit@debbugs.gnu.org; Fri, 09 Jun 2023 03:56:00 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:55003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7WyS-0006m4-PF for 60338@debbugs.gnu.org; Fri, 09 Jun 2023 03:55:59 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CFBB2240027 for <60338@debbugs.gnu.org>; Fri, 9 Jun 2023 09:55:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686297350; bh=iGb9oIGgO2EV9HfoY9Z0qssghY2d8df8R8kGhF1c3ro=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=FZEkH1rHM5XHdXYvEiD45DRqe1it6BuXiSg1UDUQzTfPZSm14FuwBW9Lofd4V2V3y 7WbKl7oJVns4BemA46UbQXfKAMrC82FGTWQCaSWdSpiooPDOQSfiMC2F7NNoQWJweH OCZZxZB0S+qGId0LU2pTwl/crghFERqEiTHp6CHSlLbOZ3nKU/hujjtLXYVQKsDQb4 3HD3Ao8BmbdHPY9ZHZ604ayQQZZQckjbehMKbcdqh5bWbgG2zFoK5LiJnSG0ZYkjpq xrW3bRZJ5BD9eC6BYOO+O6D3/DRIGMmiyRGtCRge/1aBJ7syPPhPkmJoIJwLNEmGPZ hZInRhd3HKyRA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QctgB0xBFz6txP; Fri, 9 Jun 2023 09:55:50 +0200 (CEST) In-Reply-To: <87lemi6mte.fsf@betli.tmit.bme.hu> (Felician Nemeth's message of "Wed, 04 Jan 2023 21:56:29 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:263158 Archived-At: (Sorry for the delay in answering, I forgot about this thread) Felician Nemeth writes: > This is going to be a bit off-topic, but I'm guessing that users (after > a while) get used to what they can expect from a specific language > server when it comes to code-actions. And with a well written server, > users should never want to partially apply a server initiated text-edit. > > Therefore it might be a better UI to apply every text-edit without > questions, display a message when the changes are not visible ("Changed > 100 lines in 10 files"), provide a command to view the last text-edit as > a diff, and allow the users to undo the change with a single undo > command. > > This UI wouldn't slow down experienced users, and it would allow them to > quickly correct rare mistakes. Eglot could also teach inexperienced > users with messages like "Changed 2 lines in 1 file. `undo-view-last' > shows the change." > > WDT? In principle this should be ok, but there are users who for whatever reason do not want the language server to modify the files (e.g. because they don't like it in principle, or because the language is /not/ well written). I tend towards that camp, and which is why I wrote the patch in the first place. The other issue is that the patch would have to be generated before any changes are applied, so that the user can inspect it after the server made the changes, regardless of whether or not they will be interested or not. I am not sure how much waste this will generate, and if it is really worth it, compared to having a diff as a "prompt".