Skip to content

Commit 3ca98fe

Browse files
committedApr 30, 2021
Path coming from command-line does not need processing.
1 parent 6a643be commit 3ca98fe

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed
 

‎analysis/.depend

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ src/References.cmx : src/Utils.cmx src/Uri2.cmx src/SharedTypes.cmx \
3333
src/Shared.cmx : src/PrintType.cmx src/Files.cmx
3434
src/SharedTypes.cmx : src/Utils.cmx src/Uri2.cmx src/Shared.cmx \
3535
src/Infix.cmx
36-
src/Uri2.cmx : src/Files.cmx
36+
src/Uri2.cmx :
3737
src/Utils.cmx : src/Protocol.cmx
3838
src/vendor/Json.cmx :
3939
src/vendor/res_outcome_printer/res_comment.cmx : \

‎analysis/src/Commands.ml

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let dump files =
2121
Shared.cacheTypeToString := true;
2222
files
2323
|> List.iter (fun path ->
24-
let uri = Uri2.fromLocalPath path in
24+
let uri = Uri2.fromPath path in
2525
let result =
2626
match ProcessCmt.getFullFromCmt ~uri with
2727
| None -> "[]"
@@ -30,7 +30,7 @@ let dump files =
3030
print_endline result)
3131

3232
let completion ~path ~line ~col ~currentFile =
33-
let uri = Uri2.fromLocalPath path in
33+
let uri = Uri2.fromPath path in
3434
let result =
3535
match ProcessCmt.getFullFromCmt ~uri with
3636
| None -> "[]"
@@ -43,7 +43,7 @@ let completion ~path ~line ~col ~currentFile =
4343
print_endline result
4444

4545
let hover ~path ~line ~col =
46-
let uri = Uri2.fromLocalPath path in
46+
let uri = Uri2.fromPath path in
4747
let result =
4848
match ProcessCmt.getFullFromCmt ~uri with
4949
| None -> Protocol.null
@@ -79,7 +79,7 @@ let hover ~path ~line ~col =
7979
print_endline result
8080

8181
let definition ~path ~line ~col =
82-
let uri = Uri2.fromLocalPath path in
82+
let uri = Uri2.fromPath path in
8383
let result =
8484
match ProcessCmt.getFullFromCmt ~uri with
8585
| None -> Protocol.null
@@ -114,7 +114,7 @@ let definition ~path ~line ~col =
114114
print_endline result
115115

116116
let references ~path ~line ~col =
117-
let uri = Uri2.fromLocalPath path in
117+
let uri = Uri2.fromPath path in
118118
let result =
119119
match ProcessCmt.getFullFromCmt ~uri with
120120
| None -> Protocol.null
@@ -143,7 +143,7 @@ let references ~path ~line ~col =
143143
print_endline result
144144

145145
let documentSymbol ~path =
146-
let uri = Uri2.fromLocalPath path in
146+
let uri = Uri2.fromPath path in
147147
match ProcessCmt.getFullFromCmt ~uri with
148148
| None -> print_endline Protocol.null
149149
| Some {file} ->

‎analysis/src/Files.ml

-5
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,3 @@ let fileConcat a b =
106106
&& b.[1] = Filename.dir_sep.[0]
107107
then Filename.concat a (String.sub b 2 (String.length b - 2))
108108
else Filename.concat a b
109-
110-
let isFullPath b =
111-
b.[0] = '/' || (Sys.win32 && String.length b > 1 && b.[1] = ':')
112-
113-
let maybeConcat a b = if b <> "" && isFullPath b then b else fileConcat a b

‎analysis/src/Uri2.ml

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module Uri : sig
22
type t
33

4-
val fromLocalPath : string -> t
5-
64
val fromPath : string -> t
75

86
val isInterface : t -> bool
@@ -28,10 +26,6 @@ end = struct
2826

2927
let fromPath path = {path; uri = pathToUri path}
3028

31-
let fromLocalPath localPath =
32-
let path = Files.maybeConcat (Unix.getcwd ()) localPath in
33-
fromPath path
34-
3529
let isInterface {path} = Filename.check_suffix path "i"
3630

3731
let toPath {path} = path

0 commit comments

Comments
 (0)