From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for Flymake diagnostics Date: Sun, 07 Jul 2024 13:50:35 +0200 Message-ID: References: <865xtu7seh.fsf@gnu.org> <868qyf5587.fsf@gnu.org> <868qyd32ih.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6856"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@janestreet.com, 71504@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 07 13:51:12 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 1sQQQC-0001Zb-CD for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jul 2024 13:51:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQQQ0-0000IO-DI; Sun, 07 Jul 2024 07:51:00 -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 1sQQPy-0000IA-Of for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2024 07:50:58 -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 1sQQPy-0002aK-AT for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2024 07:50:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQQQ2-0004qN-AK for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2024 07:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jul 2024 11:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71504 X-GNU-PR-Package: emacs Original-Received: via spool by 71504-submit@debbugs.gnu.org id=B71504.172035304618594 (code B ref 71504); Sun, 07 Jul 2024 11:51:02 +0000 Original-Received: (at 71504) by debbugs.gnu.org; 7 Jul 2024 11:50:46 +0000 Original-Received: from localhost ([127.0.0.1]:47507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQQPl-0004pq-Pn for submit@debbugs.gnu.org; Sun, 07 Jul 2024 07:50:46 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:36484 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQQPj-0004pg-7D for 71504@debbugs.gnu.org; Sun, 07 Jul 2024 07:50:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1720353038; bh=ooRbIWOKpBgGCH7pDGPRy+9fAbhqh7VfIFiLxTDid9I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ZzHOqNxlObM5gsL6NLHQLn5dnABcZJxtjodFbyMkMcw24JXqxEpH9DkhWjTBnHupE T+z7tlcM/VmjwlXQqPT4VedpzCbM2CZ2rIeZnfC9FlvN1Jv4JdiRGHexkfmH3BE8gz hnO6MgaVkr5og1YQLvz9UUXHkkwZJe8z4dLwPqzhGW8ISgBhSogbRLpC6fPcNYUOLy B+I4LR1S4toDfzFxn/7qC5BQWCuBBN04EZjHEj4dNqWmEPyWvn54AU0ErNizREa4eK rtCMuZ8HdShKNC+yaZQ3o+Yk5YdIHWLiVkx2uAfP5ir2YwqiQRwhTPzr0sQ8UuxWfk 89WvdM+/L08GA== In-Reply-To: <868qyd32ih.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 Jul 2024 13:44:22 +0300") 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:288556 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: sbaugh@janestreet.com, 71504@debbugs.gnu.org >> Date: Sun, 07 Jul 2024 10:53:12 +0200 >> >> >> From: Eshel Yaron >> >> Cc: Eli Zaretskii , 71504@debbugs.gnu.org >> >> Date: Thu, 27 Jun 2024 20:15:37 +0200 >> >> >> >> Spencer Baugh writes: >> >> >> >> > For example, maybe we want to have a command which can accept fixes >> >> > output by a process running in M-x compile. Baking the UI into flymake >> >> > would make that impossible, wouldn't it? >> >> >> >> I don't think adding a command for fixing the diagnostic at point should >> >> preclude any other developments or explorations. It's a useful thing to >> >> have, and many Flymake backends have the needed data readily available. >> >> >> >> > So before any change in flymake I would like to see much more >> >> > exploration of "fix" UIs which are genuinely flymake-independent. >> >> >> >> Flymake shows diagnostics, and "fixing" is what we do to diagnostics. >> >> What would be the benefit of a Flymake-independent UI for fixing the >> >> diagnostics that Flymake already shows? >> > >> > The benefit would be that we will be able to use that UI when "fixes" >> > are shown in, for example, the *compilation* buffer. >> >> It'd be good to enhance compilation buffers as well, but this feature >> request is about interaction with Flymake diagnostics, that are shown in >> the diagnosed buffer: I'd like to have a standard way to act on (fix) >> the diagnostic at point. > > I frankly don't understand what you are saying here. Several people > opined that we should take a broader view on the fixes and how to > handle them, but you insist that Flymake should have its own solution? No. I only insist that there should be a command for fixing the Flymake diagnostic at point. If it's part of a "broader solution", that's swell. > IOW, the "fixes" diagnostic shown by Flymake is not just diagnostic, > it's a suggestion to make some change in the source code. I think there is a misunderstanding here: it's not about specific diagnostics which represent fixes, this is about enriching (potentially) all diagnostics with backend-provided fix suggestions, and adding a command that applies such fixes. For example, with my implementation I use the same command for fixing checkdoc, shellcheck and LSP diagnostics. > So supporting that cannot be separated from the more general concept > of making changes proposed by some external tool. Or what am I > missing? IIUC, I think I agree. In my implementation, Flymake delegates the application of the code changes to another library, that includes a general purpose function for applying code changes. > Or maybe this is a simple misunderstanding: what do you mean by > "acting on diagnostic at point" Applying a suggested code change that resolves the diagnostic. > , and how could such an act be indifferent to what and how is fixed? A single command should let you fix diagnostics from different sources (backends). It doesn't need to be indifferent, just consistent. Does that make sense?