unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Federico Beffa <federico.beffa@fbengineering.ch>
Cc: 73500@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#73500: eglot: diagnostic location not always shown
Date: Sat, 28 Sep 2024 22:18:00 +0100	[thread overview]
Message-ID: <87r093tr3r.fsf@gmail.com> (raw)
In-Reply-To: <6654a127-fb75-4b8b-86d6-267b92567429@fbengineering.ch> (Federico Beffa's message of "Sat, 28 Sep 2024 17:23:30 +0200")

On Sat, Sep 28, 2024 at 4:23 PM Federico Beffa <federico.beffa@fbengineering.ch> wrote:
>
> The attached archive includes everything mentioned at the indicated
> link.  See the included `README.md` file for instructions on how to
> reproduce the bug (minimally).

Thanks.

>  assume you have running test benches with everything.

You assume wrong.  Eglot supports hundreds of servers.  I only have the
servers I work or worked with in the past.  "Supports foo server " means
solely that someone knowledgeable with foo tried it and reported good
results at some point, so they requested to add a server invocation to
eglot-server-programs.

Anyway, I couldn't reproduce your problem simply because the Main.hs
program you provided does not seem to produce any diagnostics, according
the haskell-language-server I installed in my system, which identifies
itself as

haskell-language-server version: 1.9.1.0 (GHC: 9.2.8) (PATH: /usr/bin/haskell-language-server)

I'm not a Haskell programmer, so I don't know if this makes sense to
you.

In the events log, the publishDiagonstics message is the following:

[jsonrpc] e[22:01:33.466] <-- textDocument/publishDiagnostics {
  "jsonrpc": "2.0",
  "method": "textDocument/publishDiagnostics",
  "params": {
    "diagnostics": [],
    "uri": "file:///home/capitaomorte/Downloads/bug73500/src/Main.hs",
    "version": 2
  }
}

Notice the empty JSON array.  However, when I change your Main.hs to
what is likely a nonsensical Haskell program:

    module Main where
     
    isAscending :: [Int] -> Bool
    isAscending [] = True
    isAscending [x] = x
    --                ^ this second 'x' _is_ underlined
    isAscending (x : y : ys) = x < y && isAscending (y : ys)
     
    main :: IO ()
    main = putStrLn "Hello, bug 73500!"

Then I see the second x being underlined with a 1-char-long diagnostic,
the corresponding LSP event being:

[jsonrpc] e[22:05:21.403] <-- textDocument/publishDiagnostics {
  "jsonrpc": "2.0",
  "method": "textDocument/publishDiagnostics",
  "params": {
    "diagnostics": [
      {
        "code": "-Wdeferred-type-errors",
        "message": "• Couldn't match expected type ‘Bool’ with actual type ‘Int’\n• In the expression: x\n  In an equation for ‘isAscending’: isAscending [x] = x",
        "range": {
          "end": {
            "character": 19,
            "line": 4
          },
          "start": {
            "character": 18,
            "line": 4
          }
        },
        "severity": 1,
        "source": "typecheck"
      }
    ],
    "uri": "file:///home/capitaomorte/Downloads/bug73500/src/Main.hs",
    "version": 25
  }
}

I have now removed haskell-language-server from my machine.
João





  reply	other threads:[~2024-09-28 21:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 13:49 bug#73500: eglot: diagnostic location not always shown Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-28 11:16 ` Eli Zaretskii
2024-09-28 11:47   ` João Távora
2024-09-28 15:23     ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-28 21:18       ` João Távora [this message]
     [not found]         ` <452a24b1-14e8-40a6-b921-a26522278a82@fbengineering.ch>
2024-09-29 17:20           ` João Távora
2024-09-29 18:59             ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-29 21:18               ` João Távora
2024-09-30  9:19                 ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-30  9:41                   ` João Távora
     [not found]                     ` <bee5efd8-c015-43d1-b37d-392d4ffc08d7@fbengineering.ch>
     [not found]                       ` <CALDnm501CMXD8x_9s6Hm0fD5_+K4wmH58t7wXf5buKDuU+=vGg@mail.gmail.com>
2024-09-30 12:08                         ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-30 15:32                           ` João Távora
2024-09-30 15:45                       ` Federico Beffa
2024-10-01 16:08 ` Dmitry Gutov
2024-10-01 16:32   ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-01 19:48     ` Dmitry Gutov
2024-10-01 20:18       ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-01 20:39         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r093tr3r.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=73500@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=federico.beffa@fbengineering.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).