-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSP: Unable to "hover" when a local definition or type definition's file path contains url encoded characters #238
Comments
Hey. Thanks for reporting. This looks like a bug in the plugin. |
Only if you're not on vacation!! 😆 |
My vacation ended a while ago :( So I've just had a look, and cannot reproduce the issue with this file. The error message says the following call is failing: table.insert(actions, 1, string.format('%d. Go to definition at ' .. location_suffix, #actions + 1)) I can reproduce the error message if I replace that line with table.insert(actions, 1, string.format('%20R. Go to definition at ' .. location_suffix, #actions + 1)) My guess is that somehow the encoding of the file got messed up in your checkout. Which OS are you using? |
I'm on a Mac (Ventura 13.1). I've tried uninstalling and installing but the issue persists, though I think it may because I'm pinned to release |
I doubt it has anything to do with the version you're pinned to, but it might be worth a try. It definitely looks like an encoding issue though. What does it look like when you open the file I've uploaded a It should output:
|
I just remembered lazy.nvim (the plugin manager AstroNvim uses) byte-compiles all Lua files used before If you update to the 2.x.x branch, the affected module should not be loaded before |
Hey @mrcjkb , will follow your suggestions later today and get back to you! In the meantime, here's the (visual) result of running ![]() This is what L212 from ...
table.insert(actions, 1, string.format('%d. Go to type definition at ' .. type_def_suffix, #actions + 1))
... |
Hmm, it looks like it's encoded properly - which makes me think it's probably a bug in the bytecode caching. |
@Per48edjes I've created this plugin that uses the same format string that is causing the error for you. If you get a chance, could you please install it and see if the error occurs (see the readme for steps to reproduce)? I've created a workflow that runs a test on macos with a minimal config, but it seems to run just fine. If you can still reproduce the error with the test plugin, then it's most likely either a bug in AstroNVim or lazy.nvim. |
Ok! Will attempt to install and follow the README steps to reproduce now...stay tuned. |
Ok, so the only notification I see on reload (after installing the test plugin you provided) is this one:
Not sure if this is related, but
(Both of the above notifications occur are consistent on multiple (close + open)s of Neovim.) |
🤔 so the issue doesn't seem reproducible on MacOS with my debug plugin. Now I'm really confused... I don't think the notify warning is related. |
Have you migrated to the 2.x.x branch and does the issue still persist? |
Update on my end:
![]() |
Thanks for the update. I've added some debug logging. Could you please follow the instructions in the readme to set the log level to |
Tests.QuickCheck
imports?Tests.QuickCheck
imports
Buy the way (I forgot about this): There is an option to disable the haskell-tools hover. vim.g.haskell_tools = {
tools = {
hover = {
enable = false,
},
},
} If you disable it, neovim will use the built-in LSP hover handler. |
Hmmmm...I'm getting this error:
Here's what the {
"mrcjkb/haskell-tools.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", -- Optional
},
branch = "2.x.x", -- Recommended
init = function() -- Optional, see Advanced configuration
astronvim.lsp.skip_setup = utils.list_insert_unique(astronvim.lsp.skip_setup, "hls")
vim.g.haskell_tools = {
-- TODO: Remove this!
tools = { -- haskell-tools options
log = {
level = vim.log.levels.DEBUG,
},
},
hls = {
on_attach = function(client, bufnr) require("astronvim.utils.lsp").on_attach(client, bufnr) end,
},
}
end,
-- load the plugin when opening one of the following file types
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
} FWIW, I'm also trying to update AstroNvim/astrocommunity#553 such that the new config (using |
Oops, I forgot to update the 2.x.x branch. Just updated it. Sure, I'll have a look at the PR 😄 |
This is a bit overkill (since it looks like the history goes awhile back), but including the whole enchilada for completeness. All logs
...if this has something to do with the space in the directory name |
Ahh, thanks for the log. I'll see if I can push a fix today. |
Tests.QuickCheck
imports
Should be fixed now 😄 Thanks for the help debugging! |
@all-contributors please add @Per48edjes for userTesting |
I've put up a pull request to add @Per48edjes! 🎉 |
Adds @Per48edjes as a contributor for userTesting. This was requested by mrcjkb [in this comment](#238 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Marc Jakobi <marc@jakobi.dev>
Question
I was just practicing Haskell with Exercism and exploring property testing (here is the source code if that's helpful), and I'm noticing whenever I try to "hover" on some of the imports from
Tests.QuickCheck
(e.g.,Gen
,elements
,forAll
,value
), I get the following error:Is this to be expected for any particular reason (vs. other packages)? Any pointers are well received -- looking to understand why this issue might arise!
The text was updated successfully, but these errors were encountered: