File tree Expand file tree Collapse file tree 10 files changed +26
-22
lines changed Expand file tree Collapse file tree 10 files changed +26
-22
lines changed Original file line number Diff line number Diff line change @@ -392,9 +392,13 @@ let parse_check_args cmd ~from_default =
392392 " (mode) for each entry in input list get list of function dependencies [file:line:character list]"
393393 );
394394 ( " --gen-prefetch-dir" ,
395- Arg. String (fun x -> set_mode (MODE_GEN_PREFETCH_DIR x)),
396- " generate a directory of decls and typecheck dependencies to use for prefetching"
397- ^ " Usage: --gen-prefetch-dir ~/prefetched-dir" );
395+ Arg. String (fun _x -> set_mode MODE_POPULATE_REMOTE_DECLS ),
396+ " Compute all decls for the repo and upload them to the remote decl service."
397+ ^ " Usage: --gen-prefetch-dir unused" );
398+ ( " --populate-remote-decls" ,
399+ Arg. Unit (fun () -> set_mode MODE_POPULATE_REMOTE_DECLS ),
400+ " Compute all decls for the repo and upload them to the remote decl service."
401+ );
398402 ( " --gen-saved-ignore-type-errors" ,
399403 Arg. Set gen_saved_ignore_type_errors,
400404 " generate a saved state even if there are type errors (default: false)."
Original file line number Diff line number Diff line change @@ -276,8 +276,8 @@ let main_internal
276276 let % lwt results = rpc_with_retry args @@ Rpc. FIND_REFS action in
277277 ClientFindRefs. go results args.output_json;
278278 Lwt. return (Exit_status. No_error , Telemetry. create () )
279- | MODE_GEN_PREFETCH_DIR dirname ->
280- let % lwt (_, telemetry) = rpc args @@ Rpc. GEN_PREFETCH_DIR dirname in
279+ | MODE_POPULATE_REMOTE_DECLS ->
280+ let % lwt (_, telemetry) = rpc args Rpc. POPULATE_REMOTE_DECLS in
281281 Lwt. return (Exit_status. No_error , telemetry)
282282 | MODE_GO_TO_IMPL_CLASS class_name ->
283283 let % lwt results =
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ type client_mode =
3232 | MODE_FORMAT of int * int
3333 | MODE_FULL_FIDELITY_PARSE of string
3434 | MODE_FULL_FIDELITY_SCHEMA
35- | MODE_GEN_PREFETCH_DIR of string
35+ | MODE_POPULATE_REMOTE_DECLS
3636 | MODE_GO_TO_IMPL_CLASS of string
3737 | MODE_GO_TO_IMPL_CLASS_REMOTE of string
3838 | MODE_GO_TO_IMPL_METHOD of string
Original file line number Diff line number Diff line change 463463 serverFileDependents
464464 serverFileSync
465465 serverFormat
466- serverGenPrefetchDir
467466 serverIdle
468467 serverInferTypeBatch
469468 serverTastHolesBatch
472471 serverLint
473472 serverMethodJumps
474473 serverMethodJumpsBatch
474+ serverPopulateRemoteDecls
475475 serverRage
476476 serverRename
477477 serverRewriteLambdaParameters
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ let rpc_command_needs_full_check : type a. a t -> bool =
4646 | DELETE_CHECKPOINT _ -> true
4747 | IN_MEMORY_DEP_TABLE_SIZE -> true
4848 | NO_PRECHECKED_FILES -> true
49- | GEN_PREFETCH_DIR _ -> false
49+ | POPULATE_REMOTE_DECLS -> false
5050 | STATS -> false
5151 | DISCONNECT -> false
5252 | STATUS_SINGLE _ -> false
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ type _ t =
556556 | RAGE : ServerRageTypes .result t
557557 | CST_SEARCH : cst_search_input -> (Hh_json .json , string ) result t
558558 | NO_PRECHECKED_FILES : unit t
559- | GEN_PREFETCH_DIR : string -> unit t
559+ | POPULATE_REMOTE_DECLS : unit t
560560 | FUN_DEPS_BATCH : (string * int * int ) list -> string list t
561561 | LIST_FILES_WITH_ERRORS : string list t
562562 | FILE_DEPENDENTS : string list -> string list t
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ let debug_describe_t : type a. a t -> string = function
5959 | RAGE -> " RAGE"
6060 | CST_SEARCH _ -> " CST_SEARCH"
6161 | NO_PRECHECKED_FILES -> " NO_PRECHECKED_FILES"
62- | GEN_PREFETCH_DIR _ -> " GEN_PREFETCH_DIR "
62+ | POPULATE_REMOTE_DECLS -> " POPULATE_REMOTE_DECLS "
6363 | FUN_DEPS_BATCH _ -> " FUN_DEPS_BATCH"
6464 | LIST_FILES_WITH_ERRORS -> " LIST_FILES_WITH_ERRORS"
6565 | FILE_DEPENDENTS _ -> " FILE_DEPENDENTS"
Original file line number Diff line number Diff line change @@ -22,18 +22,10 @@ let ( >>= ) res f =
2222 | Ok r -> f r
2323 | Error e -> Future.Promise. return (Error e))
2424
25- let ( > |= ) = Future.Promise. bind
26-
2725let return_ok x = Future.Promise. return (Ok x)
2826
2927let return_err x = Future.Promise. return (Error x)
3028
31- let get_name_and_decl_hashes_from_decls decls : (string * Int64.t) list =
32- List. filter_map decls ~f: (fun (name , decl , decl_hash ) ->
33- match decl with
34- | Shallow_decl_defs. Class _ -> Some (name, decl_hash)
35- | _ -> None )
36-
3729let get_hhconfig_version ~(repo : Path.t ) :
3830 (string , string ) result Future.Promise. t =
3931 let hhconfig_path =
Original file line number Diff line number Diff line change 1+ (*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the "hack" directory of this source tree.
6+ *
7+ *)
8+
9+ val go :
10+ ServerEnv .env -> ServerEnv .genv -> MultiWorker .worker list option -> unit
Original file line number Diff line number Diff line change @@ -411,10 +411,8 @@ let handle : type a. genv -> env -> is_stale:bool -> a t -> env * a =
411411 (env, Error (Exception. to_string e))
412412 end
413413 | NO_PRECHECKED_FILES -> (ServerPrecheckedFiles. expand_all env, () )
414- | GEN_PREFETCH_DIR dir ->
415- (* TODO(bobren) remove dir entirely from saved state job invocation *)
416- let _ = dir in
417- (env, ServerGenPrefetchDir. go env genv genv.workers)
414+ | POPULATE_REMOTE_DECLS ->
415+ (env, ServerPopulateRemoteDecls. go env genv genv.workers)
418416 | FUN_DEPS_BATCH positions ->
419417 (env, ServerFunDepsBatch. go genv.workers positions env)
420418 | LIST_FILES_WITH_ERRORS -> (env, ServerEnv. list_files env)
You can’t perform that action at this time.
0 commit comments