Skip to content

Commit 03425fa

Browse files
committed
disable using completion powered hover when regular hover fails
1 parent 155ab6e commit 03425fa

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

analysis/bin/main.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ let main () =
143143
~pos:(int_of_string line, int_of_string col)
144144
~debug
145145
| [_; "documentSymbol"; path] -> DocumentSymbol.command ~path
146-
| [_; "hover"; path; line; col; currentFile; supportsMarkdownLinks] ->
146+
| [_; "hover"; path; line; col; _currentFile; supportsMarkdownLinks] ->
147147
Commands.hover ~path
148148
~pos:(int_of_string line, int_of_string col)
149-
~currentFile ~debug
149+
~debug
150150
~supportsMarkdownLinks:
151151
(match supportsMarkdownLinks with
152152
| "true" -> true

analysis/src/Commands.ml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,13 @@ let codeLens ~path ~debug =
5757
in
5858
print_endline result
5959

60-
let hover ~path ~pos ~currentFile ~debug ~supportsMarkdownLinks =
60+
let hover ~path ~pos ~debug ~supportsMarkdownLinks =
6161
let result =
6262
match Cmt.loadFullCmtFromPath ~path with
6363
| None -> Protocol.null
6464
| Some full -> (
6565
match References.getLocItem ~full ~pos ~debug with
66-
| None -> (
67-
if debug then
68-
Printf.printf
69-
"Nothing at that position. Now trying to use completion.\n";
70-
match
71-
Hover.getHoverViaCompletions ~debug ~path ~pos ~currentFile
72-
~forHover:true ~supportsMarkdownLinks
73-
with
74-
| None -> Protocol.null
75-
| Some hover -> hover)
66+
| None -> Protocol.null
7667
| Some locItem -> (
7768
let isModule =
7869
match locItem.locType with
@@ -393,8 +384,7 @@ let test ~path =
393384
("Hover " ^ path ^ " " ^ string_of_int line ^ ":"
394385
^ string_of_int col);
395386
let currentFile = createCurrentFile () in
396-
hover ~supportsMarkdownLinks:true ~path ~pos:(line, col)
397-
~currentFile ~debug:true;
387+
hover ~supportsMarkdownLinks:true ~path ~pos:(line, col) ~debug:true;
398388
Sys.remove currentFile
399389
| "she" ->
400390
print_endline

0 commit comments

Comments
 (0)