@@ -48,23 +48,19 @@ let findFunctionType ~currentFile ~debug ~path ~pos =
4848 | None -> []
4949 | Some (docstring , _ ) -> docstring
5050 in
51- if Debug. verbose () then
52- Printf. printf " [sig_help_fn] Found loc item: %s.\n "
53- (Shared. typeToString typeExpr);
51+ Debug. verbose " [sig_help_fn] Found loc item: %s."
52+ (Shared. typeToString typeExpr);
5453 match
5554 TypeUtils. extractFunctionType2 ~env ~package: full.package typeExpr
5655 with
5756 | args , _tRet , _ when args <> [] ->
5857 Some (args, docstring, typeExpr, package, env, file)
5958 | _ -> None )
6059 | None ->
61- if Debug. verbose () then
62- Printf. printf " [sig_help_fn] Found no loc item.\n " ;
60+ Debug. verbose " [sig_help_fn] Found no loc item." ;
6361 None
6462 | Some _ ->
65- if Debug. verbose () then
66- Printf. printf
67- " [sig_help_fn] Found loc item, but not what was expected.\n " ;
63+ Debug. verbose " [sig_help_fn] Found loc item, but not what was expected." ;
6864 None
6965 in
7066 match fnFromLocItem with
@@ -272,25 +268,22 @@ let signatureHelp ~path ~pos ~currentFile ~debug ~allowForConstructorPayloads =
272268 | _ -> (
273269 match ! result with
274270 | None ->
275- if Debug. verbose () then
276- Printf. printf " [sig_help_result] Setting because had none\n " ;
271+ Debug. verbose " [sig_help_result] Setting because had none" ;
277272 result := Some (loc, thing)
278273 | Some (currentLoc, currentThing)
279274 when Pos. ofLexing loc.Location. loc_start
280275 > Pos. ofLexing currentLoc.Location. loc_start ->
281276 result := Some (loc, thing);
282277
283- if Debug. verbose () then
284- Printf. printf
285- " [sig_help_result] Setting because loc of %s > then existing \
286- of %s\n "
287- (printThing thing) (printThing currentThing)
278+ Debug. verbose
279+ " [sig_help_result] Setting because loc of %s > then existing of \
280+ %s"
281+ (printThing thing) (printThing currentThing)
288282 | Some (_ , currentThing ) ->
289- if Debug. verbose () then
290- Printf. printf
291- " [sig_help_result] Doing nothing because loc of %s < then \
292- existing of %s\n "
293- (printThing thing) (printThing currentThing))
283+ Debug. verbose
284+ " [sig_help_result] Doing nothing because loc of %s < then \
285+ existing of %s"
286+ (printThing thing) (printThing currentThing))
294287 in
295288 let searchForArgWithCursor ~isPipeExpr ~args =
296289 let extractedArgs = extractExpApplyArgs ~args in
@@ -525,12 +518,10 @@ let signatureHelp ~path ~pos ~currentFile ~debug ~allowForConstructorPayloads =
525518 | _ -> None )
526519 | Some (_, ((`ConstructorExpr (lid, _) | `ConstructorPat (lid, _)) as cs))
527520 -> (
528- if Debug. verbose () then
529- Printf. printf " [signature_help] Found constructor!\n " ;
521+ Debug. verbose " [signature_help] Found constructor!" ;
530522 match Cmt. loadFullCmtFromPath ~path with
531523 | None ->
532- if Debug. verbose () then
533- Printf. printf " [signature_help] Could not load cmt\n " ;
524+ Debug. verbose " [signature_help] Could not load cmt" ;
534525 None
535526 | Some full -> (
536527 let {file} = full in
@@ -541,9 +532,8 @@ let signatureHelp ~path ~pos ~currentFile ~debug ~allowForConstructorPayloads =
541532 {lid.loc with loc_start = lid.loc.loc_end}
542533 with
543534 | None ->
544- if Debug. verbose () then
545- Printf. printf " [signature_help] Did not find constructor '%s'\n "
546- constructorName;
535+ Debug. verbose " [signature_help] Did not find constructor '%s'"
536+ constructorName;
547537 None
548538 | Some constructor ->
549539 let argParts =
0 commit comments