Merge pull request #181 from rleonid/complete_mod_use_too

Tab complete mod_use directives.
This commit is contained in:
Jérémie Dimino 2016-10-07 17:17:50 +01:00 committed by GitHub
commit 3ff8459513
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