Subject: bug#73500: closed (Re: bug#73500: eglot: diagnostic location not always shown)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 01 Oct 2024 20:40:02 +0000

Your bug report

#73500: eglot: diagnostic location not always shown

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
73500: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73500
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#73500: eglot: diagnostic location not always shown
From: Dmitry Gutov <[email-masked]>
To: Federico Beffa <[email-masked]>, [email-masked]
Date: Tue, 1 Oct 2024 23:39:24 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

On 01/10/2024 23:18, Federico Beffa wrote:
> On 01/10/2024 21:48, Dmitry Gutov wrote:
>> That one is using the face eglot-diagnostic-tag-unnecessary-face, 
>> which you can customize to add an underline or any other decorations.
>>
>> It was added in commit 0f44d338f17bd4, see the description here 
>> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0f44d338f17bd4
>>
>> The choice of using 'shadow' is explained with a reference to the 
>> protocol, which says:
>>
>> /**
>>  * Unused or unnecessary code.
>>  *
>>  * Clients are allowed to render diagnostics with this tag faded out
>>  * instead of having an error squiggle.
>>  */
>>
>> https://microsoft.github.io/language-server-protocol/specifications/ 
>> lsp/3.17/specification/#diagnosticTag
>>
> 
> OK, I see, the shadow is so similar the normal font that, before you 
> mentioned it, it was unnoticeable to me. But if it's customizable, 
> that's great.

Yep. I suggest customizing 'shadow' itself then, if it's not noticeable 
enough on your system/theme/etc.

>> > Here a screenshot
>>
>> Same look on my machine.
>>
>> Should we remove the exclamation point instead, to avoid the semantic 
>> conflict? I'm not sure, probably not.
> 
> Is the exclamation mark used with all warnings? If yes, I'd keep it. 
> Even if the warning has a tag equal to 1, it's still a warning.

It is. Sure.

> Thanks for your help!

No problem! Guess we're finished here, so I'm closing the report.

Subject: eglot: diagnostic location not always shown
From: Federico Beffa <[email-masked]>
To: [email-masked]
Date: Thu, 26 Sep 2024 15:49:41 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I'm using `emacs` 29.4 with the `haskell-language-server` 2.8.0.0 on 
NixOS 24.05.

The following code
```haskell
isAscending [x] =True
```
produces the following diagnostic from the lsp
```elisp
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
           (:diagnostics
            [(:code "-Wunused-matches" :message "Defined but not used: 
‘x’" :range
                    (:end
                     (:character 14 :line 17)
                     :start
                     (:character 13 :line 17))
                    :severity 2 :source "typecheck" :tags
                    [1])
             (:code "-Wmissing-signatures" :message "Top-level binding 
with no type signature:\n  fbeCircle :: 
svg-builder-0.1.1:Graphics.Svg.Core.Element" :range
                    (:end
                     (:character 9 :line 25)
                     :start
                     (:character 0 :line 25))
                    :severity 2 :source "typecheck")]
            :uri 
"file:///home/user/tmp/haskell/test-flake-utils/test/src/Main.hs" 
:version 0))
```
The first diagnostics (corresponding to the above code) is shown in the 
Emacs buffer only with an exclamation mark in the fringe. However, the 
diagnostic message is not shown anywhere unless the cursor is placed on 
the exact location in question (the 'x' in the square brakes). Without 
any visual aid, it's very difficult to pinpoint the exact location of 
the problem to see the message.

The other diagnostic in the same server message, on top of the 
exclamation mark, it's properly highlighted with a blue wiggled 
underline and easy to locate. I'd expect this to happen for all diagnostics.