this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor fixes

+55 -30
+39 -27
lib/impl.ml
··· 702 702 line1, src 703 703 704 704 let complete_prefix _id _deps is_toplevel source position = 705 + try begin 705 706 let line1, src = mangle_toplevel is_toplevel source [] in 706 707 let src= line1 ^ src in 707 708 let source = Merlin_kernel.Msource.make src in ··· 750 751 IdlM.ErrM.return { Toplevel_api_gen.from; to_; entries } 751 752 | None -> 752 753 IdlM.ErrM.return { Toplevel_api_gen.from = 0; to_ = 0; entries = [] } 754 + end 755 + with e -> 756 + Logs.info (fun m -> m "Error: %s" (Printexc.to_string e)); 757 + IdlM.ErrM.return_err 758 + (Toplevel_api_gen.InternalError (Printexc.to_string e)) 753 759 754 760 let add_cmi id deps source = 755 761 Logs.info (fun m -> m "add_cmi"); ··· 847 853 (Toplevel_api_gen.InternalError (Printexc.to_string e)) 848 854 849 855 let type_enclosing _id deps is_toplevel orig_source position = 850 - let line1, src = mangle_toplevel is_toplevel orig_source deps in 851 - let src = line1 ^ src in 852 - let position = 853 - match position with 854 - | Toplevel_api_gen.Start -> `Start 855 - | Offset x -> `Offset (x + String.length line1) 856 - | Logical (x, y) -> `Logical (x+1, y) 857 - | End -> `End 858 - in 859 - let source = Merlin_kernel.Msource.make src in 860 - let query = Query_protocol.Type_enclosing (None, position, None) in 861 - let enclosing = wdispatch source query in 862 - let map_index_or_string = function 863 - | `Index i -> Toplevel_api_gen.Index i 864 - | `String s -> String s 865 - in 866 - let map_tail_position = function 867 - | `No -> Toplevel_api_gen.No 868 - | `Tail_position -> Tail_position 869 - | `Tail_call -> Tail_call 870 - in 871 - let enclosing = 872 - List.map 873 - (fun (x, y, z) -> (x, map_index_or_string y, map_tail_position z)) 874 - enclosing 875 - in 876 - IdlM.ErrM.return enclosing 856 + try 857 + let line1, src = mangle_toplevel is_toplevel orig_source deps in 858 + let src = line1 ^ src in 859 + let position = 860 + match position with 861 + | Toplevel_api_gen.Start -> `Start 862 + | Offset x -> `Offset (x + String.length line1) 863 + | Logical (x, y) -> `Logical (x+1, y) 864 + | End -> `End 865 + in 866 + let source = Merlin_kernel.Msource.make src in 867 + let query = Query_protocol.Type_enclosing (None, position, None) in 868 + let enclosing = wdispatch source query in 869 + let map_index_or_string = function 870 + | `Index i -> Toplevel_api_gen.Index i 871 + | `String s -> String s 872 + in 873 + let map_tail_position = function 874 + | `No -> Toplevel_api_gen.No 875 + | `Tail_position -> Tail_position 876 + | `Tail_call -> Tail_call 877 + in 878 + let enclosing = 879 + List.map 880 + (fun (x, y, z) -> (x, map_index_or_string y, map_tail_position z)) 881 + enclosing 882 + in 883 + IdlM.ErrM.return enclosing 884 + with e -> 885 + Logs.info (fun m -> m "Error: %s" (Printexc.to_string e)); 886 + IdlM.ErrM.return_err 887 + (Toplevel_api_gen.InternalError (Printexc.to_string e)) 888 + 877 889 end
+16 -3
lib/ocamltop.ml
··· 10 10 len'' 11 11 12 12 let parse_toplevel s = 13 - Logs.warn (fun m -> m "Parsing toplevel phrases"); 13 + let legacy_warn = 14 + let b = ref false in 15 + fun () -> 16 + if !b 17 + then () 18 + else 19 + (Logs.warn (fun m -> m "Warning: Legacy toplevel output detected"); 20 + b := true) 21 + in 22 + 14 23 let lexbuf = Lexing.from_string s in 15 24 let rec loop pos = 16 25 let _phr = !Toploop.parse_toplevel_phrase lexbuf in 17 26 let new_pos = Lexing.lexeme_end lexbuf in 18 27 let phr = String.sub s pos (new_pos - pos) in 19 28 let (junk, (cont, is_legacy, output)) = Toplexer.entry lexbuf in 20 - if is_legacy then 21 - Logs.warn (fun m -> m "Warning: Legacy toplevel output detected"); 29 + let output = 30 + if is_legacy then begin 31 + legacy_warn (); 32 + List.map (fun x -> try String.sub x 2 (String.length x - 2) with _ -> "") output 33 + end else output 34 + in 22 35 let new_pos = Lexing.lexeme_end lexbuf in 23 36 if cont then (phr, junk, output) :: loop new_pos else [ (phr, junk, output) ] 24 37 in