this repo has no description
0
fork

Configure Feed

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

Remove Worker's dependency on brr

+5 -12
+1 -1
src/worker/dune
··· 3 3 (public_name merlin-js.worker) 4 4 (js_of_ocaml 5 5 (javascript_files stubs.js)) 6 + (preprocess (pps js_of_ocaml-ppx)) 6 7 (libraries 7 8 static_files 8 9 protocol ··· 11 12 merlin-lib.query_protocol 12 13 merlin-lib.query_commands 13 14 merlin-lib.ocaml_parsing 14 - brr 15 15 js_of_ocaml))
+4 -11
src/worker/worker.ml
··· 1 1 open Merlin_utils 2 - open Brr 3 2 open Std 4 3 open Merlin_kernel 5 4 module Location = Ocaml_parsing.Location ··· 18 17 Mpipeline.with_pipeline pipeline @@ fun () -> ( 19 18 Query_commands.dispatch pipeline query 20 19 ) 21 - 22 20 23 21 module Completion = struct 24 22 (* Prefixing code from ocaml-lsp-server *) ··· 111 109 let from = 112 110 to_ - String.length (prefix_of_position ~short_path:true source position) 113 111 in 114 - 115 - Console.(log ["Prefix:";prefix]); 116 112 if prefix = "" then 117 113 None 118 114 else ··· 131 127 Mconfig.dump (Mpipeline.final_config pipeline) 132 128 |> Json.pretty_to_string *) 133 129 134 - let on_message e = 135 - let marshaled_message = Brr_io.Message.Ev.data e in 130 + let on_message marshaled_message = 136 131 let action : Protocol.action = 137 132 Marshal.from_bytes marshaled_message 0 138 133 in 139 - Console.(log ["w: Received message:"; action]); 140 134 let res = 141 135 match action with 142 136 | Complete_prefix (source, position) -> ··· 153 147 let query = Query_protocol.Type_enclosing (None, position, None) in 154 148 Protocol.Typed_enclosings (dispatch source query) 155 149 | Protocol.All_errors source -> 156 - Console.(log ["w: Query errors"]); 157 150 let source = Msource.make source in 158 151 let query = Query_protocol.Errors { 159 152 lexing = true; ··· 183 176 Protocol.Errors errors 184 177 in 185 178 let res = Marshal.to_bytes res [] in 186 - Brr_webworkers.Worker.G.post res 179 + Js_of_ocaml.Worker.post_message res 187 180 188 181 189 182 let run () = 190 183 (* Load the CMIs into the pseudo file-system *) 191 184 (* This add roughly 3mo to the final script. These could be loaded dynamically 192 185 after the worker *) 193 - List.iter Static_files.stdlib_cmis ~f:(fun (path, content) -> 186 + List.iter Static_files.stdlib_cmis ~f:(fun ( path, content) -> 194 187 let name = Filename.(concat "/static/stdlib" (basename path)) in 195 188 Js_of_ocaml.Sys_js.create_file ~name ~content); 196 - Jv.(set global "onmessage" @@ Jv.repr on_message) 189 + Js_of_ocaml.Worker.set_onmessage on_message