Tab complete mod_use directives.

This commit is contained in:
Leonid Rozenberg 2016-10-07 12:14:58 -04:00
parent d890533675
commit 7dcdfaa6a9
1 changed files with 3 additions and 2 deletions

View File

@ -947,8 +947,9 @@ let complete ~syntax ~phrase_terminator ~input =
List.map (function (w, Directory) -> (w, "") | (w, File) -> (w, "\"" ^ phrase_terminator)) result)
#endif
(* Completion on #use. *)
| [(Symbol "#", _); (Lident "use", _); (String (tlen, false), loc)] ->
(* Completion on #use and #mod_use *)
| [(Symbol "#", _); (Lident "use", _); (String (tlen, false), loc)]
| [(Symbol "#", _); (Lident "mod_use", _); (String (tlen, false), loc)] ->
let file = String.sub input (loc.ofs1 + tlen) (String.length input - loc.ofs1 - tlen) in
let filter name =
match try Some (String.rindex name '.') with Not_found -> None with