nvim-cmp
nvim-cmp copied to clipboard
Add special highlights for markdown docs (underline/strike/bold etc)
when the signature help appears, the colors of the first line are not visible
in theory it should look like this:
It's not only the first line.
To me it seems the signature help is rendered as plain Markdown.
I think it is not the bug of this plugin.
And also I don't think nvim-cmp's bug because nvim-cmp uses vim.lsp.util.stylize_markdown
as render.
So, it may be the LSP server sending different docstrings depending on completion or not?
Sorry. It's maybe an improvements point at the nvim-cmp side, I think.
But it's difficult. I can't think of a solution for it at the moment. So take a long time to improve this.
I'm trying to add <cmp-annotate>...</ cmp-annotate>
to a native lsp syntax rule.
However, I cannot manage nested syn-region
rules at the moment. If someone has a solution. I want help.
The following code is not work correctly...
-- lua/view/docs_view.lua
...
vim.api.nvim_buf_call(self.window:get_buffer(), function()
vim.cmd([[syntax clear]])
end)
vim.lsp.util.stylize_markdown(self.window:get_buffer(), documents, {
max_width = maxwidth,
max_height = documentation.maxheight,
})
vim.api.nvim_buf_call(self.window:get_buffer(), function()
vim.cmd(([[syntax region %s matchgroup=Conceal start=+<cmp-annotate>+ end=+</cmp-annotate>+ contained containedin=ALL concealends keepend oneline]]):format('CmpMarkdownAnnotate'))
end)
...
should MDN Reference display as a link here?