|
@@ -242,7 +242,7 @@ let parse_hxml file =
|
|
IO.close_in ch;
|
|
IO.close_in ch;
|
|
parse_hxml_data data
|
|
parse_hxml_data data
|
|
|
|
|
|
-let lookup_classes com spath =
|
|
|
|
|
|
+let lookup_classes com spath =
|
|
let rec loop = function
|
|
let rec loop = function
|
|
| [] -> []
|
|
| [] -> []
|
|
| cp :: l ->
|
|
| cp :: l ->
|
|
@@ -251,9 +251,12 @@ let lookup_classes com spath =
|
|
let clen = String.length c in
|
|
let clen = String.length c in
|
|
if clen < String.length spath && String.sub spath 0 clen = c then begin
|
|
if clen < String.length spath && String.sub spath 0 clen = c then begin
|
|
let path = String.sub spath clen (String.length spath - clen) in
|
|
let path = String.sub spath clen (String.length spath - clen) in
|
|
- (* make sure the completion filename is capitalized - needed for Windows *)
|
|
|
|
- let path = String.concat "/" (match List.rev (ExtString.String.nsplit path "/") with name :: l -> List.rev (String.capitalize name :: l) | [] -> []) in
|
|
|
|
- (try [make_path path] with _ -> loop l)
|
|
|
|
|
|
+ (try
|
|
|
|
+ let path = make_path path in
|
|
|
|
+ (match loop l with
|
|
|
|
+ | [x] when String.length (Ast.s_type_path x) < String.length (Ast.s_type_path path) -> [x]
|
|
|
|
+ | _ -> [path])
|
|
|
|
+ with _ -> loop l)
|
|
end else
|
|
end else
|
|
loop l
|
|
loop l
|
|
in
|
|
in
|
|
@@ -870,6 +873,8 @@ try
|
|
com.error <- error ctx;
|
|
com.error <- error ctx;
|
|
com.main_class <- None;
|
|
com.main_class <- None;
|
|
classes := lookup_classes com (!Parser.resume_display).Ast.pfile;
|
|
classes := lookup_classes com (!Parser.resume_display).Ast.pfile;
|
|
|
|
+ Common.log com ("Display file : " ^ (!Parser.resume_display).Ast.pfile);
|
|
|
|
+ Common.log com ("Classes found : [" ^ (String.concat "," (List.map Ast.s_type_path !classes)) ^ "]");
|
|
end;
|
|
end;
|
|
let add_std dir =
|
|
let add_std dir =
|
|
com.class_path <- List.filter (fun s -> not (List.mem s com.std_path)) com.class_path @ List.map (fun p -> p ^ dir ^ "/_std/") com.std_path @ com.std_path
|
|
com.class_path <- List.filter (fun s -> not (List.mem s com.std_path)) com.class_path @ List.map (fun p -> p ^ dir ^ "/_std/") com.std_path @ com.std_path
|
|
@@ -1063,11 +1068,11 @@ with
|
|
| Some (c,cur_package) ->
|
|
| Some (c,cur_package) ->
|
|
try
|
|
try
|
|
let ctx = Typer.create com in
|
|
let ctx = Typer.create com in
|
|
- let rec lookup p =
|
|
|
|
|
|
+ let rec lookup p =
|
|
try
|
|
try
|
|
Typeload.load_module ctx (p,c) Ast.null_pos
|
|
Typeload.load_module ctx (p,c) Ast.null_pos
|
|
with e ->
|
|
with e ->
|
|
- if cur_package then
|
|
|
|
|
|
+ if cur_package then
|
|
match List.rev p with
|
|
match List.rev p with
|
|
| [] -> raise e
|
|
| [] -> raise e
|
|
| _ :: p -> lookup (List.rev p)
|
|
| _ :: p -> lookup (List.rev p)
|