-
Notifications
You must be signed in to change notification settings - Fork 32
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
Better Hover Experience - Feature Request #36
Comments
Doesn't this just work out of the box for you? |
Are you sure you are using treesitter and have the markdown inline parser? It should just work |
I confess that I didn't have :TSInstallInfo
|
What version og neovim do you have? |
NVIM v0.10.1 |
Someone else commented in that PR asking him to re-implement it here, so it's not only me. |
I know, but it should just work. So we need to figure out why it doesn't for you. It works for me at least in my config. I can test with a very minimal config when I have some time |
Content format is indeed already markdown and it should work as expected. This can be tested by attaching such a handler in the setup config handlers = {
["textDocument/hover"] = function(err, result, ctx, config)
vim.notify(vim.inspect(result.contents.kind), vim.log.levels.INFO)
vim.lsp.handlers["textDocument/hover"](err, result, ctx, config)
end,
}, That being said, something is definitely wrong with the \ characters that appear before some symbols (even in the first screenshot from last comment). This is the markdown value intercepted like this: ["textDocument/hover"] = function(err, result, ctx, config)
vim.notify(vim.inspect(result.contents.value), vim.log.levels.INFO)
vim.lsp.handlers["textDocument/hover"](err, result, ctx, config)
end,
It seems that the server probably sends escapes in code using four \ instead of two. I'm not entirely sure this should be fixed by this plugin as it is outside the scope and most likely a bug in roslyn, although it definitely is weird to leave it like this. Here is a temporary fix you can use in your configs: return {
"seblj/roslyn.nvim",
config = function()
require("roslyn").setup {
config = {
on_init = function(client)
client.offset_encoding = "utf-8"
end,
handlers = { -- this is what matters
["textDocument/hover"] = function(err, result, ctx, config)
if result and result.contents and result.contents.value then
result.contents.value = result.contents.value:gsub("\\([^%w])", "%1")
end
vim.lsp.handlers["textDocument/hover"](err, result, ctx, config)
end,
},
},
}
end,
lazy = false,
} |
Yeah, I will not be adding a hack for this, as this should be fixed either in the markdown parser queries or in roslyn |
I appreciate the time spent on this, I'll try to do some research and revisit all my plugins to see if anything could be getting in the middle of this, I tried @drzbida approach, and it's indeed printing "markdown" as the kind. |
Ok, the issue was the treesitter version, working as expected after updating from v0.9.1 to v0.9.2. Thanks again @seblj and @drzbida |
In the "original" repo EnochMtzR opened a PR (jmederosalvarado#30) to improve the hover experience by adding markdown support and replacing some characters. Before switching to this repo I used a fork with his commits and it was great.
Yesterday I tried to adapt it to this new code base, but I have no idea how. If someone could point me in the right direction I could try to do it myself.
The text was updated successfully, but these errors were encountered: