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.