From 60a5b4f750287338d824c55de0e226ecf07178a8 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 21 Jan 2023 12:34:54 +0100 Subject: [PATCH 1/3] example of loc being broken --- analysis/src/CompletionBackEnd.ml | 7 ++- analysis/src/LocalTables.ml | 6 +++ analysis/src/ProcessExtra.ml | 5 ++ .../tests/src/CompletionFunctionArguments.res | 25 +++++++++ .../CompletionFunctionArguments.res.txt | 54 +++++++++++++++++++ 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index d63e74420..170a5eb3e 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -252,7 +252,10 @@ let findAllCompletions ~(env : QueryEnv.t) ~prefix ~exact ~namesUsed let processLocalValue name loc ~prefix ~exact ~env ~(localTables : LocalTables.t) = - if Utils.checkName name ~prefix ~exact then + if Utils.checkName name ~prefix ~exact then ( + if name = "thisGetsBrokenLoc" then + Printf.printf "looking for %s startPos %s\n" name + (loc |> Loc.start |> Pos.toString); match Hashtbl.find_opt localTables.valueTable (name, Loc.start loc) with | Some declared -> if not (Hashtbl.mem localTables.namesUsed name) then ( @@ -276,7 +279,7 @@ let processLocalValue name loc ~prefix ~exact ~env (Ctype.newconstr (Path.Pident (Ident.create "Type Not Known")) [])) - :: localTables.resultRev + :: localTables.resultRev) let processLocalConstructor name loc ~prefix ~exact ~env ~(localTables : LocalTables.t) = diff --git a/analysis/src/LocalTables.ml b/analysis/src/LocalTables.ml index 772d5c815..fd66dad23 100644 --- a/analysis/src/LocalTables.ml +++ b/analysis/src/LocalTables.ml @@ -25,6 +25,12 @@ let create () = let populateValues ~env localTables = env.QueryEnv.file.stamps |> Stamps.iterValues (fun _ declared -> + if declared.name.txt = "thisGetsBrokenLoc" then + Printf.printf "populaing %s %s startPos %s full pos %s\n" + declared.name.txt + (Shared.typeToString declared.item) + (declared.extentLoc |> Loc.start |> Pos.toString) + (declared.extentLoc |> Loc.toString); Hashtbl.replace localTables.valueTable (declared.name.txt, declared.extentLoc |> Loc.start) declared) diff --git a/analysis/src/ProcessExtra.ml b/analysis/src/ProcessExtra.ml index e0a90d656..674cf2e35 100644 --- a/analysis/src/ProcessExtra.ml +++ b/analysis/src/ProcessExtra.ml @@ -360,6 +360,11 @@ let pat ~(file : File.t) ~env ~extra (iter : Tast_iterator.iterator) (pattern : Typedtree.pattern) = let addForPattern stamp name = if Stamps.findValue file.stamps stamp = None then ( + (* This is where the broken loc is found/added *) + if false && name.Location.txt = "thisGetsBrokenLoc" then + Printf.printf "this loc is broken and would need to work %s %s\n" + name.Location.txt + (pattern.pat_loc |> Loc.toString); let declared = ProcessAttributes.newDeclared ~name ~stamp ~modulePath:NotVisible ~extent:pattern.pat_loc ~item:pattern.pat_type false diff --git a/analysis/tests/src/CompletionFunctionArguments.res b/analysis/tests/src/CompletionFunctionArguments.res index 39e9079ba..69eae9111 100644 --- a/analysis/tests/src/CompletionFunctionArguments.res +++ b/analysis/tests/src/CompletionFunctionArguments.res @@ -89,3 +89,28 @@ let fnTakingRecord = (r: someRecord) => { // let _ = fnTakingRecord({}) // ^com + +module FineModule = { + type t = { + online: bool, + somethingElse: string, + } + + let setToFalse = (t: t) => { + ...t, + online: false, + } +} + +let _ = +
{ + // ^com + let reassignedWorks = thisGetsBrokenLoc + ignore(reassignedWorks) + // thisGetsBrokenLoc->a + // ^com + // reassignedWorks->a + // ^com + }} + /> diff --git a/analysis/tests/src/expected/CompletionFunctionArguments.res.txt b/analysis/tests/src/expected/CompletionFunctionArguments.res.txt index a52989fa8..1b0ce3ffb 100644 --- a/analysis/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/analysis/tests/src/expected/CompletionFunctionArguments.res.txt @@ -2,6 +2,7 @@ Complete src/CompletionFunctionArguments.res 10:24 posCursor:[10:24] posNoWhite:[10:23] Found expr:[10:11->10:25] Pexp_apply ...[10:11->10:17] (~isOn10:19->10:23=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOn) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -20,6 +21,8 @@ Complete src/CompletionFunctionArguments.res 13:25 posCursor:[13:25] posNoWhite:[13:24] Found expr:[13:11->13:26] Pexp_apply ...[13:11->13:17] (~isOn13:19->13:23=...[13:24->13:25]) Completable: Cexpression CArgument Value[someFn](~isOn)=t +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -39,6 +42,7 @@ Complete src/CompletionFunctionArguments.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found expr:[16:11->16:26] Pexp_apply ...[16:11->16:17] (~isOff16:19->16:24=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOff) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -61,6 +65,7 @@ posCursor:[21:27] posNoWhite:[21:26] Found expr:[21:7->21:28] posCursor:[21:27] posNoWhite:[21:26] Found expr:[21:14->21:28] Pexp_apply ...[21:14->21:20] (~isOn21:22->21:26=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOn) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -79,6 +84,8 @@ Complete src/CompletionFunctionArguments.res 34:24 posCursor:[34:24] posNoWhite:[34:23] Found expr:[34:11->34:25] Pexp_apply ...[34:11->34:22] (...[34:23->34:24]) Completable: Cexpression CArgument Value[someOtherFn]($0)=f +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "false", "kind": 4, @@ -91,6 +98,7 @@ Complete src/CompletionFunctionArguments.res 51:39 posCursor:[51:39] posNoWhite:[51:38] Found expr:[51:11->51:40] Pexp_apply ...[51:11->51:30] (~config51:32->51:38=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFnTakingVariant](~config) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "One", "kind": 4, @@ -121,6 +129,8 @@ Complete src/CompletionFunctionArguments.res 54:40 posCursor:[54:40] posNoWhite:[54:39] Found expr:[54:11->54:41] Pexp_apply ...[54:11->54:30] (~config54:32->54:38=...[54:39->54:40]) Completable: Cexpression CArgument Value[someFnTakingVariant](~config)=O +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "One", "kind": 4, @@ -154,6 +164,8 @@ Complete src/CompletionFunctionArguments.res 57:33 posCursor:[57:33] posNoWhite:[57:32] Found expr:[57:11->57:34] Pexp_apply ...[57:11->57:30] (...[57:31->57:33]) Completable: Cexpression CArgument Value[someFnTakingVariant]($0)=So +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "Some(_)", "kind": 4, @@ -175,6 +187,8 @@ Complete src/CompletionFunctionArguments.res 60:44 posCursor:[60:44] posNoWhite:[60:43] Found expr:[60:11->60:45] Pexp_apply ...[60:11->60:30] (~configOpt260:32->60:42=...[60:43->60:44]) Completable: Cexpression CArgument Value[someFnTakingVariant](~configOpt2)=O +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "One", "kind": 4, @@ -208,6 +222,7 @@ Complete src/CompletionFunctionArguments.res 63:23 posCursor:[63:23] posNoWhite:[63:22] Found expr:[63:11->63:24] Pexp_apply ...[63:11->63:22] (...[63:23->63:24]) Completable: Cexpression CArgument Value[someOtherFn]($0) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -226,6 +241,7 @@ Complete src/CompletionFunctionArguments.res 66:28 posCursor:[66:28] posNoWhite:[66:27] Found expr:[66:11->66:30] Pexp_apply ...[66:11->66:22] (...[66:23->66:24], ...[66:26->66:27]) Completable: Cexpression CArgument Value[someOtherFn]($2) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -243,6 +259,8 @@ Completable: Cexpression CArgument Value[someOtherFn]($2) Complete src/CompletionFunctionArguments.res 69:30 posCursor:[69:30] posNoWhite:[69:29] Found expr:[69:11->69:31] Completable: Cexpression CArgument Value[someOtherFn]($2)=t +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -262,6 +280,7 @@ Complete src/CompletionFunctionArguments.res 76:25 posCursor:[76:25] posNoWhite:[76:24] Found expr:[76:11->76:26] Pexp_apply ...[76:11->76:24] (...[76:25->76:26]) Completable: Cexpression CArgument Value[fnTakingTuple]($0) +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "(_, _, _)", "kind": 12, @@ -276,6 +295,7 @@ Complete src/CompletionFunctionArguments.res 89:27 posCursor:[89:27] posNoWhite:[89:26] Found expr:[89:11->89:29] Pexp_apply ...[89:11->89:25] (...[89:26->89:28]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "age", "kind": 5, @@ -296,3 +316,37 @@ Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody "documentation": null }] +Complete src/CompletionFunctionArguments.res 106:33 +posCursor:[106:33] posNoWhite:[106:32] Found expr:[105:3->115:4] +JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->114:5]> _children:115:2 +[] + +Complete src/CompletionFunctionArguments.res 110:29 +posCursor:[110:29] posNoWhite:[110:28] Found expr:[105:3->115:4] +JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->114:5]> _children:115:2 +posCursor:[110:29] posNoWhite:[110:28] Found expr:[106:35->114:5] +posCursor:[110:29] posNoWhite:[110:28] Found expr:[108:6->110:29] +posCursor:[110:29] posNoWhite:[110:28] Found expr:[109:6->110:29] +posCursor:[110:29] posNoWhite:[110:28] Found expr:[110:9->110:29] +Completable: Cpath Value[thisGetsBrokenLoc]->a <> +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +looking for thisGetsBrokenLoc startPos 106:16 +[] + +Complete src/CompletionFunctionArguments.res 112:27 +posCursor:[112:27] posNoWhite:[112:26] Found expr:[105:3->115:4] +JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->114:5]> _children:115:2 +posCursor:[112:27] posNoWhite:[112:26] Found expr:[106:35->114:5] +posCursor:[112:27] posNoWhite:[112:26] Found expr:[108:6->112:27] +posCursor:[112:27] posNoWhite:[112:26] Found expr:[109:6->112:27] +posCursor:[112:27] posNoWhite:[112:26] Found expr:[112:9->112:27] +Completable: Cpath Value[reassignedWorks]->a <> +populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] +[{ + "label": "ReactEvent.Mouse.altKey", + "kind": 12, + "tags": [], + "detail": "t => bool", + "documentation": null + }] + From 7bb5ac33f48500d17a2063862b136e21d9f1b2c9 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 21 Jan 2023 13:40:33 +0100 Subject: [PATCH 2/3] fix issue with function arg missing type information by using the loc from the name instead of the declared when adding values to local tables --- analysis/src/CompletionBackEnd.ml | 7 +- analysis/src/LocalTables.ml | 8 +-- analysis/src/ProcessExtra.ml | 5 -- .../tests/src/CompletionFunctionArguments.res | 1 - .../CompletionFunctionArguments.res.txt | 64 ++++++------------- 5 files changed, 24 insertions(+), 61 deletions(-) diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 170a5eb3e..d63e74420 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -252,10 +252,7 @@ let findAllCompletions ~(env : QueryEnv.t) ~prefix ~exact ~namesUsed let processLocalValue name loc ~prefix ~exact ~env ~(localTables : LocalTables.t) = - if Utils.checkName name ~prefix ~exact then ( - if name = "thisGetsBrokenLoc" then - Printf.printf "looking for %s startPos %s\n" name - (loc |> Loc.start |> Pos.toString); + if Utils.checkName name ~prefix ~exact then match Hashtbl.find_opt localTables.valueTable (name, Loc.start loc) with | Some declared -> if not (Hashtbl.mem localTables.namesUsed name) then ( @@ -279,7 +276,7 @@ let processLocalValue name loc ~prefix ~exact ~env (Ctype.newconstr (Path.Pident (Ident.create "Type Not Known")) [])) - :: localTables.resultRev) + :: localTables.resultRev let processLocalConstructor name loc ~prefix ~exact ~env ~(localTables : LocalTables.t) = diff --git a/analysis/src/LocalTables.ml b/analysis/src/LocalTables.ml index fd66dad23..5a5bdb0c2 100644 --- a/analysis/src/LocalTables.ml +++ b/analysis/src/LocalTables.ml @@ -25,14 +25,8 @@ let create () = let populateValues ~env localTables = env.QueryEnv.file.stamps |> Stamps.iterValues (fun _ declared -> - if declared.name.txt = "thisGetsBrokenLoc" then - Printf.printf "populaing %s %s startPos %s full pos %s\n" - declared.name.txt - (Shared.typeToString declared.item) - (declared.extentLoc |> Loc.start |> Pos.toString) - (declared.extentLoc |> Loc.toString); Hashtbl.replace localTables.valueTable - (declared.name.txt, declared.extentLoc |> Loc.start) + (declared.name.txt, declared.name.loc |> Loc.start) declared) let populateConstructors ~env localTables = diff --git a/analysis/src/ProcessExtra.ml b/analysis/src/ProcessExtra.ml index 674cf2e35..e0a90d656 100644 --- a/analysis/src/ProcessExtra.ml +++ b/analysis/src/ProcessExtra.ml @@ -360,11 +360,6 @@ let pat ~(file : File.t) ~env ~extra (iter : Tast_iterator.iterator) (pattern : Typedtree.pattern) = let addForPattern stamp name = if Stamps.findValue file.stamps stamp = None then ( - (* This is where the broken loc is found/added *) - if false && name.Location.txt = "thisGetsBrokenLoc" then - Printf.printf "this loc is broken and would need to work %s %s\n" - name.Location.txt - (pattern.pat_loc |> Loc.toString); let declared = ProcessAttributes.newDeclared ~name ~stamp ~modulePath:NotVisible ~extent:pattern.pat_loc ~item:pattern.pat_type false diff --git a/analysis/tests/src/CompletionFunctionArguments.res b/analysis/tests/src/CompletionFunctionArguments.res index 69eae9111..2b8754881 100644 --- a/analysis/tests/src/CompletionFunctionArguments.res +++ b/analysis/tests/src/CompletionFunctionArguments.res @@ -105,7 +105,6 @@ module FineModule = { let _ =
{ - // ^com let reassignedWorks = thisGetsBrokenLoc ignore(reassignedWorks) // thisGetsBrokenLoc->a diff --git a/analysis/tests/src/expected/CompletionFunctionArguments.res.txt b/analysis/tests/src/expected/CompletionFunctionArguments.res.txt index 1b0ce3ffb..2f25a539a 100644 --- a/analysis/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/analysis/tests/src/expected/CompletionFunctionArguments.res.txt @@ -2,7 +2,6 @@ Complete src/CompletionFunctionArguments.res 10:24 posCursor:[10:24] posNoWhite:[10:23] Found expr:[10:11->10:25] Pexp_apply ...[10:11->10:17] (~isOn10:19->10:23=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOn) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -21,8 +20,6 @@ Complete src/CompletionFunctionArguments.res 13:25 posCursor:[13:25] posNoWhite:[13:24] Found expr:[13:11->13:26] Pexp_apply ...[13:11->13:17] (~isOn13:19->13:23=...[13:24->13:25]) Completable: Cexpression CArgument Value[someFn](~isOn)=t -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -42,7 +39,6 @@ Complete src/CompletionFunctionArguments.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found expr:[16:11->16:26] Pexp_apply ...[16:11->16:17] (~isOff16:19->16:24=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOff) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -65,7 +61,6 @@ posCursor:[21:27] posNoWhite:[21:26] Found expr:[21:7->21:28] posCursor:[21:27] posNoWhite:[21:26] Found expr:[21:14->21:28] Pexp_apply ...[21:14->21:20] (~isOn21:22->21:26=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOn) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -84,8 +79,6 @@ Complete src/CompletionFunctionArguments.res 34:24 posCursor:[34:24] posNoWhite:[34:23] Found expr:[34:11->34:25] Pexp_apply ...[34:11->34:22] (...[34:23->34:24]) Completable: Cexpression CArgument Value[someOtherFn]($0)=f -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "false", "kind": 4, @@ -98,7 +91,6 @@ Complete src/CompletionFunctionArguments.res 51:39 posCursor:[51:39] posNoWhite:[51:38] Found expr:[51:11->51:40] Pexp_apply ...[51:11->51:30] (~config51:32->51:38=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFnTakingVariant](~config) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "One", "kind": 4, @@ -129,8 +121,6 @@ Complete src/CompletionFunctionArguments.res 54:40 posCursor:[54:40] posNoWhite:[54:39] Found expr:[54:11->54:41] Pexp_apply ...[54:11->54:30] (~config54:32->54:38=...[54:39->54:40]) Completable: Cexpression CArgument Value[someFnTakingVariant](~config)=O -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "One", "kind": 4, @@ -164,8 +154,6 @@ Complete src/CompletionFunctionArguments.res 57:33 posCursor:[57:33] posNoWhite:[57:32] Found expr:[57:11->57:34] Pexp_apply ...[57:11->57:30] (...[57:31->57:33]) Completable: Cexpression CArgument Value[someFnTakingVariant]($0)=So -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "Some(_)", "kind": 4, @@ -187,8 +175,6 @@ Complete src/CompletionFunctionArguments.res 60:44 posCursor:[60:44] posNoWhite:[60:43] Found expr:[60:11->60:45] Pexp_apply ...[60:11->60:30] (~configOpt260:32->60:42=...[60:43->60:44]) Completable: Cexpression CArgument Value[someFnTakingVariant](~configOpt2)=O -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "One", "kind": 4, @@ -222,7 +208,6 @@ Complete src/CompletionFunctionArguments.res 63:23 posCursor:[63:23] posNoWhite:[63:22] Found expr:[63:11->63:24] Pexp_apply ...[63:11->63:22] (...[63:23->63:24]) Completable: Cexpression CArgument Value[someOtherFn]($0) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -241,7 +226,6 @@ Complete src/CompletionFunctionArguments.res 66:28 posCursor:[66:28] posNoWhite:[66:27] Found expr:[66:11->66:30] Pexp_apply ...[66:11->66:22] (...[66:23->66:24], ...[66:26->66:27]) Completable: Cexpression CArgument Value[someOtherFn]($2) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -259,8 +243,6 @@ populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[ Complete src/CompletionFunctionArguments.res 69:30 posCursor:[69:30] posNoWhite:[69:29] Found expr:[69:11->69:31] Completable: Cexpression CArgument Value[someOtherFn]($2)=t -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "true", "kind": 4, @@ -280,7 +262,6 @@ Complete src/CompletionFunctionArguments.res 76:25 posCursor:[76:25] posNoWhite:[76:24] Found expr:[76:11->76:26] Pexp_apply ...[76:11->76:24] (...[76:25->76:26]) Completable: Cexpression CArgument Value[fnTakingTuple]($0) -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "(_, _, _)", "kind": 12, @@ -295,7 +276,6 @@ Complete src/CompletionFunctionArguments.res 89:27 posCursor:[89:27] posNoWhite:[89:26] Found expr:[89:11->89:29] Pexp_apply ...[89:11->89:25] (...[89:26->89:28]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "age", "kind": 5, @@ -316,32 +296,30 @@ populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[ "documentation": null }] -Complete src/CompletionFunctionArguments.res 106:33 -posCursor:[106:33] posNoWhite:[106:32] Found expr:[105:3->115:4] -JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->114:5]> _children:115:2 -[] - -Complete src/CompletionFunctionArguments.res 110:29 -posCursor:[110:29] posNoWhite:[110:28] Found expr:[105:3->115:4] -JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->114:5]> _children:115:2 -posCursor:[110:29] posNoWhite:[110:28] Found expr:[106:35->114:5] -posCursor:[110:29] posNoWhite:[110:28] Found expr:[108:6->110:29] -posCursor:[110:29] posNoWhite:[110:28] Found expr:[109:6->110:29] -posCursor:[110:29] posNoWhite:[110:28] Found expr:[110:9->110:29] +Complete src/CompletionFunctionArguments.res 109:29 +posCursor:[109:29] posNoWhite:[109:28] Found expr:[105:3->114:4] +JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->113:5]> _children:114:2 +posCursor:[109:29] posNoWhite:[109:28] Found expr:[106:35->113:5] +posCursor:[109:29] posNoWhite:[109:28] Found expr:[107:6->109:29] +posCursor:[109:29] posNoWhite:[109:28] Found expr:[108:6->109:29] +posCursor:[109:29] posNoWhite:[109:28] Found expr:[109:9->109:29] Completable: Cpath Value[thisGetsBrokenLoc]->a <> -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] -looking for thisGetsBrokenLoc startPos 106:16 -[] +[{ + "label": "ReactEvent.Mouse.altKey", + "kind": 12, + "tags": [], + "detail": "t => bool", + "documentation": null + }] -Complete src/CompletionFunctionArguments.res 112:27 -posCursor:[112:27] posNoWhite:[112:26] Found expr:[105:3->115:4] -JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->114:5]> _children:115:2 -posCursor:[112:27] posNoWhite:[112:26] Found expr:[106:35->114:5] -posCursor:[112:27] posNoWhite:[112:26] Found expr:[108:6->112:27] -posCursor:[112:27] posNoWhite:[112:26] Found expr:[109:6->112:27] -posCursor:[112:27] posNoWhite:[112:26] Found expr:[112:9->112:27] +Complete src/CompletionFunctionArguments.res 111:27 +posCursor:[111:27] posNoWhite:[111:26] Found expr:[105:3->114:4] +JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->113:5]> _children:114:2 +posCursor:[111:27] posNoWhite:[111:26] Found expr:[106:35->113:5] +posCursor:[111:27] posNoWhite:[111:26] Found expr:[107:6->111:27] +posCursor:[111:27] posNoWhite:[111:26] Found expr:[108:6->111:27] +posCursor:[111:27] posNoWhite:[111:26] Found expr:[111:9->111:27] Completable: Cpath Value[reassignedWorks]->a <> -populaing thisGetsBrokenLoc ReactEvent.Mouse.t startPos 0:-1 full pos __ghost__[0:-1->0:-1] [{ "label": "ReactEvent.Mouse.altKey", "kind": 12, From 72e577993e47dc8b40558d43caceacd89ad4b7fd Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 21 Jan 2023 13:42:00 +0100 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16f798216..812bacb45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Highlight `catch` like a keyword https://github.com/rescript-lang/rescript-vscode/pull/677 - Make signature help work in calls nested inside of other calls. https://github.com/rescript-lang/rescript-vscode/pull/687 - Fix pipe completion to work on aliased types. https://github.com/rescript-lang/rescript-vscode/pull/700 +- Fix issue with not finding type for function arguments. https://github.com/rescript-lang/rescript-vscode/pull/706 ## v1.10.0