aboutsummaryrefslogtreecommitdiff
path: root/library/nametab.mli
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-10-18 19:06:20 +0200
committerEmilio Jesus Gallego Arias2018-10-18 19:36:00 +0200
commitbc1ea6aaa7dd18b1aa3591a4caf8152d66e02e52 (patch)
treeee54e39b215ed9cc685cc605f91ffba6957f6798 /library/nametab.mli
parent8303c9cab6bc403dfc209f65287b67e883a35711 (diff)
[nametab] [api] Provide basic support for efficient completion.
We provide a function `completion_candidates id` that will return a list of candidates global references that have id as prefix. This should be reasonably efficient, however UI still need to call `shortest_qualid_of_global` which is a bit heavy. How to improve this in the future is an open question. cc: #7164
Diffstat (limited to 'library/nametab.mli')
-rw-r--r--library/nametab.mli7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/nametab.mli b/library/nametab.mli
index 1c3322bfb1..1e479b200b 100644
--- a/library/nametab.mli
+++ b/library/nametab.mli
@@ -118,6 +118,12 @@ val locate_extended_all : qualid -> extended_global_reference list
val locate_extended_all_dir : qualid -> global_dir_reference list
val locate_extended_all_modtype : qualid -> ModPath.t list
+(** Experimental completion support, API is _unstable_ *)
+val completion_canditates : qualid -> extended_global_reference list
+(** [completion_canditates qualid] will return the list of global
+ references that have [qualid] as a prefix. UI usually will want to
+ compose this with [shortest_qualid_of_global] *)
+
(** Mapping a full path to a global reference *)
val global_of_path : full_path -> GlobRef.t
@@ -211,6 +217,7 @@ module type NAMETREE = sig
val user_name : qualid -> t -> user_name
val shortest_qualid : ?loc:Loc.t -> Id.Set.t -> user_name -> t -> qualid
val find_prefixes : qualid -> t -> elt list
+ val match_prefixes : qualid -> t -> elt list
end
module Make (U : UserName) (E : EqualityType) :