vscode-solidity icon indicating copy to clipboard operation
vscode-solidity copied to clipboard

Weird formatting when hovering

Open ndavd opened this issue 1 year ago • 9 comments

I'm using nvim-lspconfig and I'm getting this weird behavior when hovering... This does not happen with any other LS I've tried.

image

ndavd avatar Oct 13 '24 00:10 ndavd

Hi.. vscode has support for markdown when providing hovering info. I guess nvim doesn't.. I guess a setting for nvim could be put in place to avoid this.

juanfranblanco avatar Oct 16 '24 04:10 juanfranblanco

Hi, from what I've read, nvim just takes what the lsp gives it as is. I haven't come across this issue with the other Solidity LSPs, which were also made to work with vscode primarily. Here's a list of all the supported LSPs, just search for solidity in that file, https://github.com/neovim/nvim-lspconfig/blob/master/doc%2Fconfigs.md. Perhaps you could take a look at how the others are implemented and see what differs. 🙏🏻

ndavd avatar Oct 16 '24 09:10 ndavd

nvim just takes what the lsp gives it as is

Yes. There is no "issue" here except that the hover window is too narrow (that depends on the "parent" window where hover was invoked). And then text wraps. You can set nowrap in the hover window to disable wrapping. Maybe Nvim should do that by default, create an issue?

justinmk avatar Oct 16 '24 09:10 justinmk

There is no "issue" here except that the hover window is too narrow

I noticed that in the other LSPs the window size adapts fairly well, and I'm able to scroll, while here I am not

ndavd avatar Oct 16 '24 09:10 ndavd

@ndavd I understand better the issue now (I was referring to the ###), I don't know what I can do about the wrapping.

juanfranblanco avatar Oct 18 '24 13:10 juanfranblanco

@ndavd I understand better the issue now (I was referring to the ###), I don't know what I can do about the wrapping.

Yeah for me the ### is okay, I think in other LSPs it's also shown like that. Hmm, perhaps let's leave this pending to see if it can be fixed on neovim's side or get some feedback from them.

ndavd avatar Oct 18 '24 14:10 ndavd

Yes, I was going to suggest that, there might be something I need to send from the LSP. I made a new release a few days ago, I don't know if you have seen it, I would appreciate your feedback as I don't use nvim.

juanfranblanco avatar Oct 18 '24 14:10 juanfranblanco

Just updated the LSP to the latest version, the same issues remain, unfortunately. But otherwise it's really the most complete LSP for solidity out there, I'm really enjoying it. Apart from the things already mentioned, the only feedback I can provide for now would be to add support for textDocument/documentSymbol. It would be super useful in solidity, don't know how hard it would be to support it but it seems like it wouldn't be too hard since it just lists all symbols hierarchically.

ndavd avatar Oct 18 '24 14:10 ndavd

Yes, that shouldn't be too hard as I already parse all the document, contracts, libraries, etc.. It won't be tomorrow, but in a few weeks.

juanfranblanco avatar Oct 18 '24 17:10 juanfranblanco

@ndavd I don't know if you saw it but it includes it now.

juanfranblanco avatar Feb 22 '25 07:02 juanfranblanco