Closed blahgeek closed 4 months ago
Thank you!
Another solution is in https://github.com/emacs-lsp/lsp-mode/pull/1740 and it's included in doom emacs now.
Thanks for the link. I did not know that exists.
Based on my reading, these two PRs are not exactly the same though. https://github.com/emacs-lsp/lsp-mode/pull/1740 aims to extract a meaningful section for a type (for hovering on a type definition), the solution is rather heuristic and more format-specific, and arguably more opinionated. This PR merely strip comments from the result (usually for hovering on a variable).
So personally I can see why this PR is more suitable and accepted, or at least as a first step (I'm surely biased :) ) But of course I'm happy to see more improvement on this function by anyone
The full hover content from rust-analyzer usually looks like this:
By default, when
lsp-eldoc-render-all
is nil, only the first line (the comment) is show.This PR implements the extraction method (like clangd) to return the first non-comment line.