forked from facebook/pyre-check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchPath.mli
37 lines (28 loc) · 1.16 KB
/
searchPath.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(* Copyright (c) 2019-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. *)
module Path = PyrePath
type t =
| Root of Path.t
| Subdirectory of {
root: Path.t;
subdirectory: string;
}
[@@deriving sexp, compare, hash, show, eq]
type search_result = {
relative_path: Path.RelativePath.t; (** The searched path relative to one of the search root *)
priority: int; (** Smaller int means higher priority *)
}
val get_root : t -> Path.t
val to_path : t -> Path.t
(* Create search path from its string representation. This operation does NOT have filesystem
side-effect. *)
val create : string -> t
(* Create a normalized search path from its string representation. Normalizing a path means to
expand its relativized root and follow symlinks. This operation DOES have filesystem side-effect. *)
val create_normalized : string -> t
(* Turn a potentially un-normalized search path into a normalized one. This operation DOES have
filesystem side-effect.*)
val normalize : t -> t
val search_for_path : search_paths:t list -> Path.t -> search_result option