Closed bwkam closed 8 months ago
I assume it fails to fetch a proper response from the hoogle API? Tried running with curl
manually and works as expected.
Hey π
Thanks for reporting.
How to reproduce the issue
:lua require ("haskell-tools").hoogle_signature()
This isn't enough information to reproduce the bug. Could you please provide more detailed steps?
For example, the following would be useful:
Here is a file producing the same problem.
I just navigated my cursor to triple
and then ran :lua require ("haskell-tools").hoogle_signature()
, and I get the error I posted above.
logs
[START][2024-01-10 12:18:26] haskell-tools.nvim logging initiated
[START][2024-01-10 12:27:19] haskell-tools.nvim logging initiated
[START][2024-01-10 12:34:32] haskell-tools.nvim logging initiated
[START][2024-01-10 12:40:12] haskell-tools.nvim logging initiated
DEBUG | 2024-01-10 13:00:16 | ...kages/start/haskell-tools.nvim/lua/haskell-tools/lsp.lua:170 | LSP start options: lsp_start_opts
DEBUG | 2024-01-10 13:00:16 | ...kages/start/haskell-tools.nvim/lua/haskell-tools/lsp.lua:138 | LSP attach
DEBUG | 2024-01-10 13:00:55 | ...kages/start/haskell-tools.nvim/lua/haskell-tools/lsp.lua:170 | LSP start options: lsp_start_opts
DEBUG | 2024-01-10 13:00:55 | ...kages/start/haskell-tools.nvim/lua/haskell-tools/lsp.lua:138 | LSP attach
DEBUG | 2024-01-10 13:02:15 | ...es/start/haskell-tools.nvim/lua/haskell-tools/hoogle.lua:97 | { "Hoogle signature search options", {} }
DEBUG | 2024-01-10 13:02:15 | ...es/start/haskell-tools.nvim/lua/haskell-tools/hoogle.lua:22 | { "Hoogle LSP signature search", "[a] -> [a]" }
DEBUG | 2024-01-10 13:02:15 | ...tart/haskell-tools.nvim/lua/haskell-tools/hoogle/web.lua:51 | { "Hoogle web request", "https://hoogle.haskell.org/?hoogle=%5Ba%5D+%2D%3E+%5Ba%5D&mode=json" }
DEBUG | 2024-01-10 13:02:17 | ...tart/haskell-tools.nvim/lua/haskell-tools/hoogle/web.lua:84 | { "Hoogle web response", { code = 0, signal = 0, stdout = " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:--
-- response --
So I tried reproducing your issue, and couldn't.
My guess (based on the logs) is that your internet connection is slow or unstable and curl
is unable to fetch the JSON response from hoogle.
Unfortunately, all I can do here is catch the failure and notify with an appropriate error message.
To work around your problem, you have a few options:
browser
handler, which opens the URL in a browser (see advanced configuration).curl
.Yeah, it's quite weird, thanks for looking. My internet is fine, I've tried looking through the source a do some debugging myself, but no luck. I guess I'll go with the local hoogle approach. Should I close?
Should I close?
Let's leave this open, I want to add a more informative error notification. π
Seems like the nixpkgs version was using an old version (https://github.com/mrcjkb/haskell-tools.nvim/commit/29d7e4a366d961f8d756a3c3ed89b3e2908ac290), I've manually overridden it to use https://github.com/mrcjkb/haskell-tools.nvim/commit/29d7e4a366d961f8d756a3c3ed89b3e2908ac290 instead, and it's working!
Neovim version (nvim -v)
0.9.3
Operating system/version
NixOS 24.05
Output of :checkhealth haskell-tools
How to reproduce the issue
:lua require ("haskell-tools").hoogle_signature()
Expected behaviour
Expected telescope to pop up with the hoogle signatures
Actual behaviour
It errors instead.
Log files
The minimal config used to reproduce this issue.
Here is my neovim config