File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,16 @@ class Hover(Handler):
10
10
name = "hover"
11
11
method = "textDocument/hover"
12
12
13
- def process_request (self , position , show_style ) -> dict :
13
+ def process_request (self , start , end , show_style ) -> dict :
14
+ lsp_server_name = self .file_action .get_match_lsp_servers ("hover" )[0 ].server_info ['name' ]
14
15
self .show_style = show_style
15
- return dict (position = position )
16
+
17
+ # rust-analyzer support range hover (not in LSP standard)
18
+ if start == end or lsp_server_name != "rust-analyzer" :
19
+ return dict (position = start )
20
+ else :
21
+ range = {"start" : start , "end" : end }
22
+ return dict (position = range )
16
23
17
24
def parse_hover_contents (self , contents , render_strings ):
18
25
if isinstance (contents , str ):
Original file line number Diff line number Diff line change @@ -2071,11 +2071,15 @@ Off by default."
2071
2071
2072
2072
(defun lsp-bridge-show-documentation ()
2073
2073
(interactive )
2074
- (lsp-bridge-call-file-api " hover" (lsp-bridge--position) " buffer" ))
2074
+ (let* ((start (lsp-bridge--point-position (if (region-active-p ) (region-beginning ) (point ))))
2075
+ (end (lsp-bridge--point-position (if (region-active-p ) (region-end ) (point )))))
2076
+ (lsp-bridge-call-file-api " hover" start end " show" )))
2075
2077
2076
2078
(defun lsp-bridge-popup-documentation ()
2077
2079
(interactive )
2078
- (lsp-bridge-call-file-api " hover" (lsp-bridge--position) " popup" ))
2080
+ (let* ((start (lsp-bridge--point-position (if (region-active-p ) (region-beginning ) (point ))))
2081
+ (end (lsp-bridge--point-position (if (region-active-p ) (region-end ) (point )))))
2082
+ (lsp-bridge-call-file-api " hover" start end " popup" )))
2079
2083
2080
2084
(defun lsp-bridge-signature-help-fetch ()
2081
2085
(interactive )
You can’t perform that action at this time.
0 commit comments