File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 28
28
(require 'ht )
29
29
(require 'dash )
30
30
(require 'lsp-semantic-tokens )
31
+ (require 's )
31
32
32
33
(defgroup lsp-rust nil
33
34
" LSP support for Rust, using Rust Language Server or rust-analyzer."
@@ -1764,6 +1765,16 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
1764
1765
:download-server-fn (lambda (_client callback error-callback _update? )
1765
1766
(lsp-package-ensure 'rust-analyzer callback error-callback))))
1766
1767
1768
+ (cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql rust-analyzer)))
1769
+ " Extract first non-comment line from rust-analyzer's hover CONTENTS.
1770
+ The first line of the hover contents is usally about memory layout or notable
1771
+ traits starting with //, with the actual signature follows."
1772
+ (let* ((lines (s-lines (s-trim (lsp--render-element contents))))
1773
+ (non-comment-lines (--filter (not (s-prefix? " //" it)) lines)))
1774
+ (if non-comment-lines
1775
+ (car non-comment-lines)
1776
+ (car lines))))
1777
+
1767
1778
(lsp-consistency-check lsp-rust)
1768
1779
1769
1780
(provide 'lsp-rust )
You can’t perform that action at this time.
0 commit comments