From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#50244: 28.0.50; Support project-wide diagnostics reports in flymake.el Date: Sat, 23 Oct 2021 21:22:20 +0100 Message-ID: References: <87bl5hm5qj.fsf@gmail.com> <87y283536t.fsf@gmail.com> <41cd4854-d162-bc6c-900e-96a4245e2c59@yandex.ru> <87o88w4al4.fsf@gmail.com> <87ilz444zy.fsf@gmail.com> <87k0jj35iz.fsf@gmail.com> <46AA4768-F628-49C5-A933-8ED43814CAC9@thornhill.no> <87ee9r2xwt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31313"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50244-done@debbugs.gnu.org, Philipp Stephani , Dmitry Gutov To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 23 22:23:11 2021 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 1meNXq-0007v4-NF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 22:23:10 +0200 Original-Received: from localhost ([::1]:49786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meNXp-0005wJ-1H for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 16:23:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meNXi-0005vk-Rn for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 16:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meNXi-0001B9-JO for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 16:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meNXi-0004zj-FX for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 16:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Oct 2021 20:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50244 X-GNU-PR-Package: emacs Original-Received: via spool by 50244-done@debbugs.gnu.org id=D50244.163502056119155 (code D ref 50244); Sat, 23 Oct 2021 20:23:02 +0000 Original-Received: (at 50244-done) by debbugs.gnu.org; 23 Oct 2021 20:22:41 +0000 Original-Received: from localhost ([127.0.0.1]:37416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meNXM-0004yr-Ew for submit@debbugs.gnu.org; Sat, 23 Oct 2021 16:22:41 -0400 Original-Received: from mail-pj1-f42.google.com ([209.85.216.42]:36531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meNXJ-0004yc-8X for 50244-done@debbugs.gnu.org; Sat, 23 Oct 2021 16:22:38 -0400 Original-Received: by mail-pj1-f42.google.com with SMTP id v1-20020a17090a088100b001a21156830bso1792726pjc.1 for <50244-done@debbugs.gnu.org>; Sat, 23 Oct 2021 13:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Oe9eE1C7b00tBRXk6YCPeHcfygaCT20oRUQZCpP48q8=; b=hMtcf4sZWxp8eFOTmslovD1gM5ijE+y6P73BE83ThxG8UeBl1KTXdJMY8WI++fZA0+ loxwNXaR7RODXBQeDiDjIE9MamXRuDvvBQLlwdKhuQw2yZXbJTkO6PIjZecgOLKnlYb5 rxPLaSvTN9MF2aqEoIne0/SETsR5s3IR3PTMNU0xgJN+5Z0JrLh3GdxejXy4anZjt3of rmE6M98mft+l0d24BdsVS1WcEFShnj4bjKSbetVt1UfnVLUrUBF3b/Zdu38tmHXxVp3h VMsoFUs4/vAW6Th7+jQMr+LIdgLXb0qrpVSb2PZZbVVuotUP79hNAVQBC/Y9ezQL8Vmo 8PFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Oe9eE1C7b00tBRXk6YCPeHcfygaCT20oRUQZCpP48q8=; b=G/uGBbBwEA3eo/NQWZMd4WWu8b6Wa8m4n97wekAimd4TEtLLsvLs/VoX5HUYSpBNjR flJpfvCgXyIEDgdApcMBcKVk4pvcctWWeS51/fl6Q3euiwsDVqsFTD+x7zKmqQadwehP Fjn++XJWhi1yPXF8Wsn2t7c7F3Vw5VBaYoduzsIp9TlEUkn0GkhLnNDBdjhVhJ9bwdsQ 8DAl5SglznmdxeM8OFvOwsG5L4s/HfTJsea0y/CmYZKc/Ox8gs48QM+rsv1dvnsd6Ymi PwED8fnA7ojLWItHHxmjG112QgWRBmYYieA3PfkGFNKW1FlyT2WS56dQIrvhn+7FodXB cFcA== X-Gm-Message-State: AOAM5334HE5CYKEFQLkdgEbm25WPMCtSFkLlGFwI1922NumIxsKpBLhU 0K8d1j+m9v4btFxNaoMEZ6UYKt2aB+DEMt/j1qc= X-Google-Smtp-Source: ABdhPJy+JEDi63DzRwVAi1xAh5eJX8yuQDhUVHW8OMCfmtmSAC9XspT4qh/hRBae81Ge8PRn9t1qJWnOa+4JHY3HKks= X-Received: by 2002:a17:90b:17c3:: with SMTP id me3mr23911216pjb.70.1635020551230; Sat, 23 Oct 2021 13:22:31 -0700 (PDT) In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:218046 Archived-At: On Sat, Oct 23, 2021 at 8:22 PM Theodor Thornhill wrote= : > (sent this mail some days ago, but the bug was archived, so not sure if > it worked. Trying again. If this is only noise, then I'm sorry, but > hopefully ok considering i found a typo in the old patch :)) No problem, and yes I got the other one. It's just I've been again ompletely utterly busy so it'll be a while. I took the Flymake thing out of my brain cache and it's going to take a while to get it back. > I finally did get to test this out a little, and I seem to have hit some > small snags I can't really understand. I'd love some pointers as to how > to continue! > (the patch I currently use is attached at the bottom) > Ok, so what happens is: > > - There is no backend set on the list-only-diagnostics as for now, and I > cannot for the life of me see how to set them, as it doesn't look like > eglot itself sets it. Is there some reflection going on here that I > have missed? No, I don't think so. Maybe I simply decided that no backend was necessary? Is it? If it is, we might to add some mechanism so that it is assigned. > - The function in question is riddled with fallbacks and failure > checking. Are we sure we need all that? I see most of the commits > relating to the range checking is from 2018, so they may not be > relevant anymore? I'm not sure I follow here. I wouldn't delete any checks until I'm sure they are doing nothing. 2018 or not, I do remember a lot of servers providing very strange diagnostics and invalid ranges. > - The diff as supplied appends the list-only-diagnostics just fine to > the flymake buffer, but I believe since the backend isn't set, eglot > doesn't report the proper diagnostics when I visit the file. I have > to make a bogus edit to trigger the eglot-flymake-backend function. > (This could just as well be some unrelated eglot/elmls issue...) Ah, this rings a bell. You're talking about visiting a file by clicking a "list-only diagnostic" in the list, right? And then you wnat Flymake to resume checking and replace them with "real" ones. Yes, might be eglot/elmls issue, but usually there's not much we can do: some servers are like that. To keep things consistent we could remove the relevant list-only diagnostics and re-report them via the normal mechanism if the server is taking too long. Do you understand this idea? The user wouldn't, in principle, be able to tell that the freshly annotated diagnostics weren't collected just now when he visited the buffer, but much much earlier. The project-wide listing should, in principle, also remain consistent. ...though probably unsorted. If I remember correctly consistent sorting is still a problem. > - What would be the best way to get the proper line and column? Now I > simply use the range, but considering there's a lot of error handling > there I guess that is a little risky? I did have a version earlier > using with-temp-buffer and finding the correct positions, but that > seemed more complicated than needed. Risky for what? I don't follow If you used with-temp-buffer, I guess you visited the file. That would go against the idea of list-only-diagnostics, which are supposed to be for unvisited files (if the file were visited you'd have Eglot/Flymak= e actually checking). So using the LSP range and converting it to flymake-make-diagnostic's protocol seems ok. > I'd love to get your thoughts on this :) Hope I could help and sorry if the thoughts were a little sparse. As I said, this is out of my cache and will be for some time. Do consider patches/changes to flymake.el as well. This new mechanism is very new, it's possible it needs some tweaks. Jo=C3=A3o