File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,9 @@ let hover ~file ~line ~col ~extra ~package =
7070 match uriLocOpt with
7171 | None -> false
7272 | Some (_ , loc ) ->
73+ let isInterface = file.uri |> Uri2. isInterface in
7374 let posIsZero {Lexing. pos_lnum; pos_bol; pos_cnum} =
74- pos_lnum = 1 && pos_cnum - pos_bol = 0
75+ ( not isInterface) && pos_lnum = 1 && pos_cnum - pos_bol = 0
7576 in
7677 (* Skip if range is all zero, unless it's a module *)
7778 (not locIsModule) && posIsZero loc.loc_start && posIsZero loc.loc_end
@@ -111,8 +112,9 @@ let definition ~file ~line ~col ~extra ~package =
111112 match uriLocOpt with
112113 | None -> Protocol. null
113114 | Some (uri2 , loc ) ->
115+ let isInterface = file.uri |> Uri2. isInterface in
114116 let posIsZero {Lexing. pos_lnum; pos_bol; pos_cnum} =
115- pos_lnum = 1 && pos_cnum - pos_bol = 0
117+ ( not isInterface) && pos_lnum = 1 && pos_cnum - pos_bol = 0
116118 in
117119 (* Skip if range is all zero, unless it's a module *)
118120 let skipZero =
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ module Uri : sig
55
66 val fromPath : string -> t
77
8+ val isInterface : t -> bool
9+
810 val stripPath : bool ref
911
1012 val toPath : t -> string
@@ -30,6 +32,8 @@ end = struct
3032 let path = Files. maybeConcat (Unix. getcwd () ) localPath in
3133 fromPath path
3234
35+ let isInterface {path} = Filename. check_suffix path " i"
36+
3337 let toPath {path} = path
3438
3539 let toString {uri} = if ! stripPath then Filename. basename uri else uri
Original file line number Diff line number Diff line change 11Hover tests/src/Jsx.resi 1:4
2- null
2+ {"contents": "```rescript\n(~first: string, ~?key: string, unit) => {\"first\": string}\n```"}
33
44Hover tests/src/Jsx.resi 4:4
55{"contents": "```rescript\nint\n```"}
You can’t perform that action at this time.
0 commit comments