lspsaga.nvim icon indicating copy to clipboard operation
lspsaga.nvim copied to clipboard

fix(hover) use lsp_markdown as syntax type

Open againxx opened this issue 2 years ago • 6 comments

Try to fix #90. Only manually tested for clangd, pyright, and rust-analyzer.

againxx avatar Mar 06 '22 10:03 againxx

Okay after a bit testing, it seems to not be a great idea after all. There code examples with swift that isn't rendered with lsp_markdown like my custom syntax. Not sure if this is the fault of swift server or not but I like

  vim.api.nvim_win_set_option(winid, 'conceallevel', 2)
   vim.api.nvim_win_set_option(winid, 'concealcursor', 'n')

kkharji avatar Mar 10 '22 03:03 kkharji

Okay our hover function is outdated a bit

builtin hover:

Screen Shot 2022-03-10 at 6 47 05 AM

LspSaga hover: Screen Shot 2022-03-10 at 6 47 28 AM

don't mind the code line number not showing because I'm working on removing it :D

kkharji avatar Mar 10 '22 03:03 kkharji

Here's for lua

builtin: Screen Shot 2022-03-10 at 6 51 44 AM

lspsaga: Screen Shot 2022-03-10 at 6 51 36 AM

kkharji avatar Mar 10 '22 03:03 kkharji

There code examples with swift that isn't rendered with lsp_markdown like my custom syntax.

Do we have any custom syntax for markdown filetype in lspsaga to change the highlight of the content, or in your personal configuration?

Sorry, I'm not familiar with swift. But when testing with lua, there exist some unnecessary horizontal lines between curly brackets. Here is lspsaga: image This is builtin: image

Maybe I should understand more code logic to figure out.

againxx avatar Mar 10 '22 05:03 againxx

Yah, I use some syntax I hacked together last year and haven't released yet .... 🤔 I thought the horizontal line looked cool. I end-up rewriting window.lua, or rather updating it. The problem early was because the logic of current implementation couldn't parse the swift hover docs and usually that's the case when trying to parse large content.

kkharji avatar Mar 10 '22 05:03 kkharji

Damn it, I fail to port vim.lsp.util.stylize_markdown, .... tired like 3 times, till completely moving builtin hover and still doesn't work. Uhhh 2 hours no result 😭

Though, It is definitely a better and more decoupled version than fancy_floating_markdown. nice catch @againxx

kkharji avatar Mar 10 '22 06:03 kkharji