Merge pull request #181 from rleonid/complete_mod_use_too
Tab complete mod_use directives.
This commit is contained in:
commit
3ff8459513
|
@ -947,8 +947,9 @@ let complete ~syntax ~phrase_terminator ~input =
|
||||||
List.map (function (w, Directory) -> (w, "") | (w, File) -> (w, "\"" ^ phrase_terminator)) result)
|
List.map (function (w, Directory) -> (w, "") | (w, File) -> (w, "\"" ^ phrase_terminator)) result)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(* Completion on #use. *)
|
(* Completion on #use and #mod_use *)
|
||||||
| [(Symbol "#", _); (Lident "use", _); (String (tlen, false), loc)] ->
|
| [(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 file = String.sub input (loc.ofs1 + tlen) (String.length input - loc.ofs1 - tlen) in
|
||||||
let filter name =
|
let filter name =
|
||||||
match try Some (String.rindex name '.') with Not_found -> None with
|
match try Some (String.rindex name '.') with Not_found -> None with
|
||||||
|
|
Loading…
Reference in New Issue