diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 0b5bb00acb..96dab722d1 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -1173,8 +1173,15 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact ~full ~rawOpens typ else [] in + (* Add completions from the current module. *) + let currentModuleCompletions = + completionsForPipeFromCompletionPath ~envCompletionIsMadeFrom + ~opens:[] ~pos ~scope ~debug ~prefix ~env ~rawOpens ~full [] + |> TypeUtils.filterPipeableFunctions ~synthetic:true ~env ~full + ~targetTypeId:mainTypeId + in jsxCompletions @ pipeCompletions @ extraCompletions - @ globallyConfiguredCompletions)) + @ currentModuleCompletions @ globallyConfiguredCompletions)) | CTuple ctxPaths -> if Debug.verbose () then print_endline "[ctx_path]--> CTuple"; (* Turn a list of context paths into a list of type expressions. *) diff --git a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt index 52d87f41f8..eb40ec0ba9 100644 --- a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt +++ b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt @@ -63,6 +63,7 @@ ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString Path Stdlib.String.st +Path st [{ "label": "GenericJsx.string", "kind": 12, @@ -104,6 +105,7 @@ ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString Path Stdlib.String.st +Path st [{ "label": "string", "kind": 12, diff --git a/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res b/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res new file mode 100644 index 0000000000..819086e35a --- /dev/null +++ b/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res @@ -0,0 +1,17 @@ +module X = { + type t +} + +module Y = { + open X + + let z = (x: t) => "" + + let a = (x:t) => { + // x. + // ^com + () + } + + let b = (x:t) => 4 +} \ No newline at end of file diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt index e983edc102..76eb966f01 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt @@ -8,6 +8,7 @@ ContextPath Value[a] Path a CPPipe pathFromEnv:Test found:true Path Test. +Path [{ "label": "Test.name", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt index 7d49d20ef3..8c196abdd5 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt @@ -8,6 +8,7 @@ ContextPath Value[ax] Path ax CPPipe pathFromEnv:Test found:true Path Test. +Path [{ "label": "Test.add", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index 4533af7ed0..094b23fbee 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -634,6 +634,7 @@ ContextPath array->m ContextPath array Path Stdlib.Array.m Path ArrayUtils.m +Path m [{ "label": "Array.map", "kind": 12, @@ -656,6 +657,7 @@ Resolved opens 1 Stdlib ContextPath string->toU ContextPath string Path Stdlib.String.toU +Path toU [{ "label": "String.toUpperCase", "kind": 12, @@ -673,6 +675,7 @@ ContextPath Value[op]->e ContextPath Value[op] Path op Path Stdlib.Option.e +Path e [{ "label": "Option.equal", "kind": 12, @@ -693,6 +696,7 @@ ContextPath Value[fa] Path fa CPPipe pathFromEnv:ForAuto found:true Path ForAuto. +Path [{ "label": "ForAuto.abc", "kind": 12, @@ -932,6 +936,7 @@ ContextPath Value[r] Path r CPPipe pathFromEnv: found:true Path Completion. +Path [{ "label": "x", "kind": 5, @@ -960,6 +965,7 @@ ContextPath Value[Objects, Rec, recordVal] Path Objects.Rec.recordVal CPPipe pathFromEnv:Rec found:true Path Objects.Rec. +Path [{ "label": "xx", "kind": 5, @@ -1046,6 +1052,7 @@ ContextPath Value[q] Path q CPPipe pathFromEnv: found:true Path Completion.aa +Path aa ContextPath Value[q].aa-> ContextPath Value[q].aa ContextPath Value[q] @@ -1055,8 +1062,10 @@ ContextPath Value[q] Path q CPPipe pathFromEnv: found:true Path Completion.aa +Path aa CPPipe pathFromEnv: found:true Path Completion. +Path [{ "label": "x", "kind": 5, @@ -1086,6 +1095,7 @@ ContextPath Value[q] Path q CPPipe pathFromEnv: found:true Path Completion.aa +Path aa ContextPath Value[q].aa->n ContextPath Value[q].aa ContextPath Value[q] @@ -1095,8 +1105,10 @@ ContextPath Value[q] Path q CPPipe pathFromEnv: found:true Path Completion.aa +Path aa CPPipe pathFromEnv: found:true Path Completion.n +Path n [{ "label": "name", "kind": 5, @@ -1307,6 +1319,7 @@ ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject CPPipe pathFromEnv:FAR found:true Path FAR. +Path [{ "label": "forAuto", "kind": 5, @@ -1338,8 +1351,10 @@ ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject CPPipe pathFromEnv:FAR found:true Path FAR.forAuto +Path forAuto CPPipe pathFromEnv:ForAuto found:false Path ForAuto. +Path [{ "label": "ForAuto.abc", "kind": 12, @@ -1352,6 +1367,12 @@ Path ForAuto. "tags": [], "detail": "(t, int) => t", "documentation": null + }, { + "label": "myAmazingFunction", + "kind": 12, + "tags": [], + "detail": "(int, int) => int", + "documentation": null }] Complete src/Completion.res 230:55 @@ -1424,6 +1445,7 @@ ContextPath Value[_z] Path _z CPPipe pathFromEnv: found:true Path Completion. +Path [{ "label": "x", "kind": 5, @@ -1586,6 +1608,7 @@ ContextPath Value[funRecord] Path funRecord CPPipe pathFromEnv: found:true Path Completion.someFun +Path someFun Found type for function (~name: string) => unit [{ "label": "name", @@ -1612,6 +1635,7 @@ ContextPath Value[retAA] Path retAA CPPipe pathFromEnv: found:true Path Completion. +Path [{ "label": "x", "kind": 5, @@ -2191,6 +2215,7 @@ ContextPath Value[funRecord] Path funRecord CPPipe pathFromEnv: found:true Path Completion. +Path [{ "label": "someFun", "kind": 5, @@ -2217,6 +2242,7 @@ ContextPath array->ma ContextPath array Path Stdlib.Array.ma Path ArrayUtils.ma +Path ma [{ "label": "Array.map", "kind": 12, @@ -2369,6 +2395,7 @@ Resolved opens 3 Stdlib Completion Completion ContextPath int->t ContextPath int Path Stdlib.Int.t +Path t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -2440,6 +2467,7 @@ Resolved opens 3 Stdlib Completion Completion ContextPath float->t ContextPath float Path Stdlib.Float.t +Path t [{ "label": "Float.toStringWithRadix", "kind": 12, @@ -2512,6 +2540,7 @@ ContextPath Value[ok]->g ContextPath Value[ok] Path ok Path Stdlib.Result.g +Path g [{ "label": "Result.getExn", "kind": 12, @@ -2547,6 +2576,7 @@ ContextPath Value[rWithDepr] Path rWithDepr CPPipe pathFromEnv: found:true Path Completion.so +Path so [{ "label": "someInt", "kind": 5, @@ -2606,6 +2636,7 @@ ContextPath Value[uncurried](Nolabel) ContextPath Value[uncurried] Path uncurried Path Stdlib.Int.toS +Path toS [{ "label": "Int.toStringWithRadix", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt index 5d3b5e8f6a..bb2bf05e4e 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt @@ -8,6 +8,7 @@ ContextPath Value[x] Path x Path Stdlib.Array.em Path ArrayUtils.em +Path em [{ "label": "ArrayUtils.empty", "kind": 12, @@ -27,6 +28,7 @@ Path fastify CPPipe pathFromEnv:Fastify found:false Path Fastify.doSt Path FastifyExt.doSt +Path doSt [{ "label": "FastifyExt.doStuff", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt index cefc48617b..bfea51f5fc 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt @@ -1012,6 +1012,7 @@ ContextPath Value[fff] Path fff CPPipe pathFromEnv: found:true Path CompletionExpressions.someOpt +Path someOpt [{ "label": "someOptField", "kind": 5, @@ -1486,6 +1487,7 @@ ContextPath Value[someTyp] Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. +Path [{ "label": "test", "kind": 5, @@ -1546,6 +1548,7 @@ ContextPath Value[someTyp] Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. +Path [{ "label": "test", "kind": 5, diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt index 06394e526d..8cfb06f7ea 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt @@ -12,6 +12,7 @@ ContextPath Value[n] Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. +Path [{ "label": "name", "kind": 5, @@ -47,6 +48,7 @@ Path nn CPPipe pathFromEnv:SomeOtherModule found:true Path SomeOtherModule. Path CompletionFromModule.SomeOtherModule. +Path [{ "label": "nname", "kind": 5, @@ -129,6 +131,7 @@ Path nnn CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. +Path [{ "label": "SomeOtherModule.getNName", "kind": 12, @@ -155,6 +158,7 @@ Path nnn CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. +Path [{ "label": "getNName", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt index 547b54f130..eb647d43c5 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt @@ -12,6 +12,7 @@ ContextPath Value[CompletionFromModule, n] Path CompletionFromModule.n CPPipe pathFromEnv:SomeModule found:true Path CompletionFromModule.SomeModule. +Path [{ "label": "name", "kind": 5, @@ -47,6 +48,7 @@ Path CompletionFromModule.nn CPPipe pathFromEnv:SomeOtherModule found:true Path CompletionFromModule.SomeOtherModule. Path CompletionFromModule.SomeOtherModule. +Path [{ "label": "nname", "kind": 5, @@ -114,6 +116,7 @@ Path CompletionFromModule.nnn CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. +Path [{ "label": "CompletionFromModule.SomeOtherModule.getNName", "kind": 12, @@ -140,6 +143,7 @@ Path CompletionFromModule.nnn CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. +Path [{ "label": "getNName", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt index 6c2529f079..3beb757a82 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt @@ -438,6 +438,7 @@ ContextPath Value[thisGetsBrokenLoc] Path thisGetsBrokenLoc CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a +Path a [{ "label": "JsxEvent.Mouse.altKey", "kind": 12, @@ -461,6 +462,7 @@ ContextPath Value[reassignedWorks] Path reassignedWorks CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a +Path a [{ "label": "JsxEvent.Mouse.altKey", "kind": 12, @@ -482,6 +484,7 @@ ContextPath Value[fineModuleVal] Path fineModuleVal CPPipe pathFromEnv:FineModule found:true Path FineModule. +Path [{ "label": "FineModule.setToFalse", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index 196e89f3c7..d9fe7877f9 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -10,6 +10,7 @@ ContextPath Value[x] Path x ContextPath int Path Stdlib.Int.t +Path t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -92,6 +93,7 @@ ContextPath Value[getSomeRecord] Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "name", "kind": 5, @@ -130,6 +132,7 @@ ContextPath Value[getSomeRecord] Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "name", "kind": 5, @@ -171,6 +174,7 @@ ContextPath Value[someFnWithCallback] Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "name", "kind": 5, @@ -216,6 +220,7 @@ ContextPath Value[someFnWithCallback] Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "name", "kind": 5, @@ -247,6 +252,7 @@ ContextPath Value[reactEventFn] Path reactEventFn CPPipe pathFromEnv:ReactEvent.Mouse found:false Path ReactEvent.Mouse.pr +Path pr [{ "label": "ReactEvent.Mouse.preventDefault", "kind": 12, @@ -272,6 +278,7 @@ Path ReactDOM.domProps Path JsxDOM.domProps CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr +Path pr [{ "label": "JsxEvent.Mouse.preventDefault", "kind": 12, @@ -296,6 +303,7 @@ ContextPath CJsxPropValue [Div] onMouseEnter Path Div.make CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr +Path pr [{ "label": "JsxEvent.Mouse.preventDefault", "kind": 12, @@ -320,6 +328,7 @@ ContextPath Value[JsxEvent, Mouse, button](Nolabel) ContextPath Value[JsxEvent, Mouse, button] Path JsxEvent.Mouse.button Path Stdlib.Int.t +Path t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -416,6 +425,7 @@ ContextPath Value[String, split] Path String.split Path Stdlib.Array.ma Path ArrayUtils.ma +Path ma [{ "label": "Array.map", "kind": 12, @@ -454,6 +464,7 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "name", "kind": 5, @@ -492,6 +503,7 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "someRecord", "kind": 5, @@ -524,6 +536,7 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. +Path [{ "label": "name", "kind": 5, @@ -552,6 +565,7 @@ Path x ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.String.slic +Path slic [{ "label": "String.slice", "kind": 12, @@ -580,6 +594,7 @@ Path x ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.Int.toS +Path toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -611,6 +626,7 @@ Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS +Path toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -643,6 +659,7 @@ Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS +Path toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -671,6 +688,7 @@ Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic +Path slic [{ "label": "String.slice", "kind": 12, @@ -699,6 +717,7 @@ Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic +Path slic [{ "label": "String.slice", "kind": 12, @@ -727,6 +746,7 @@ Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic +Path slic [{ "label": "String.slice", "kind": 12, @@ -753,6 +773,7 @@ ContextPath Value[x] Path x ContextPath int Path Stdlib.Int.toSt +Path toSt [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -813,6 +834,7 @@ ContextPath Value[fn2] Path fn2 CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. +Path [{ "label": "ReactDOM.Client.Root.unmount", "kind": 12, @@ -846,6 +868,7 @@ ContextPath Value[fn3] Path fn3 CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. +Path [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -925,6 +948,7 @@ ContextPath Value[CompletionSupport2, makeRenderer] Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:CompletionSupport.Nested found:false Path CompletionSupport.Nested. +Path [{ "label": "root", "kind": 5, @@ -952,6 +976,7 @@ ContextPath Value[CompletionSupport2, makeRenderer] Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. +Path [{ "label": "ReactDOM.Client.Root.unmount", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt index 16a384c25d..ed71ec31d9 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -7,6 +7,7 @@ ContextPath Value[someString]->st ContextPath Value[someString] Path someString Path Stdlib.String.st +Path st [{ "label": "String.startsWith", "kind": 12, @@ -36,6 +37,7 @@ ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString Path Stdlib.String.st +Path st [{ "label": "React.string", "kind": 12, @@ -74,6 +76,7 @@ ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString Path Stdlib.String.st +Path st [{ "label": "React.string", "kind": 12, @@ -111,6 +114,7 @@ Resolved opens 1 Stdlib ContextPath string->st <> ContextPath string Path Stdlib.String.st +Path st [{ "label": "React.string", "kind": 12, @@ -150,6 +154,7 @@ ContextPath Value[String, trim](Nolabel) ContextPath Value[String, trim] Path String.trim Path Stdlib.String.st +Path st [{ "label": "React.string", "kind": 12, @@ -188,6 +193,7 @@ ContextPath Value[someInt]-> <> ContextPath Value[someInt] Path someInt Path Stdlib.Int. +Path [{ "label": "React.int", "kind": 12, @@ -357,6 +363,7 @@ Resolved opens 1 Stdlib ContextPath int-> <> ContextPath int Path Stdlib.Int. +Path [{ "label": "React.int", "kind": 12, @@ -528,6 +535,7 @@ ContextPath Value[someArr] Path someArr Path Stdlib.Array.a Path ArrayUtils.a +Path a [{ "label": "React.array", "kind": 12, @@ -763,6 +771,7 @@ ContextPath string ContextPath string->s <> ContextPath string Path Stdlib.String.s +Path s [{ "label": "->React.string", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt index ee1a269705..cc9888647e 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt @@ -14,6 +14,7 @@ CPPipe pathFromEnv:A found:true Path A. Path B. Path C. +Path [{ "label": "->B.b", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index d35eb940f1..30c0ce9668 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -8,6 +8,7 @@ ContextPath Value[int] Path int CPPipe pathFromEnv:Integer found:true Path Integer. +Path [{ "label": "Integer.toInt", "kind": 12, @@ -26,6 +27,12 @@ Path Integer. "tags": [], "detail": "(t, int => int) => t", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 30:23 @@ -39,6 +46,7 @@ ContextPath Value[toFlt] Path toFlt CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. +Path [{ "label": "SuperFloat.toInteger", "kind": 12, @@ -58,6 +66,7 @@ ContextPath Value[Integer, increment] Path Integer.increment CPPipe pathFromEnv:Integer found:true Path Integer. +Path [{ "label": "Integer.toInt", "kind": 12, @@ -76,6 +85,12 @@ Path Integer. "tags": [], "detail": "(t, int => int) => t", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 36:38 @@ -89,6 +104,7 @@ ContextPath Value[Integer, increment] Path Integer.increment CPPipe pathFromEnv:Integer found:true Path Integer. +Path [{ "label": "Integer.toInt", "kind": 12, @@ -107,6 +123,12 @@ Path Integer. "tags": [], "detail": "(t, int => int) => t", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 39:47 @@ -120,6 +142,7 @@ ContextPath Value[Integer, decrement] Path Integer.decrement CPPipe pathFromEnv:Integer found:true Path Integer. +Path [{ "label": "Integer.toInt", "kind": 12, @@ -138,6 +161,12 @@ Path Integer. "tags": [], "detail": "(t, int => int) => t", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 42:69 @@ -151,6 +180,7 @@ ContextPath Value[Integer, decrement] Path Integer.decrement CPPipe pathFromEnv:Integer found:true Path Integer. +Path [{ "label": "Integer.toInt", "kind": 12, @@ -169,6 +199,12 @@ Path Integer. "tags": [], "detail": "(t, int => int) => t", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 45:62 @@ -182,6 +218,7 @@ ContextPath Value[SuperFloat, fromInteger] Path SuperFloat.fromInteger CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. +Path [{ "label": "SuperFloat.toInteger", "kind": 12, @@ -201,6 +238,7 @@ ContextPath Value[SuperFloat, fromInteger] Path SuperFloat.fromInteger CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat.t +Path t [{ "label": "SuperFloat.toInteger", "kind": 12, @@ -220,6 +258,7 @@ ContextPath Value[CompletionSupport, Test, make] Path CompletionSupport.Test.make CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. +Path [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -245,6 +284,7 @@ ContextPath Value[CompletionSupport, Test, addSelf] Path CompletionSupport.Test.addSelf CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. +Path [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -270,6 +310,7 @@ ContextPath Value[Array, forEach] Path Array.forEach CPPipe pathFromEnv: found:true Path Stdlib_Array. +Path [] Complete src/CompletionPipeChain.res 62:6 @@ -282,6 +323,7 @@ ContextPath Value[Belt, Array, reduce](Nolabel, Nolabel, Nolabel) ContextPath Value[Belt, Array, reduce] Path Belt.Array.reduce Path Stdlib.Int.t +Path t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -354,6 +396,7 @@ ContextPath Value[aliased] Path aliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. +Path [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -378,6 +421,7 @@ ContextPath Value[notAliased] Path notAliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. +Path [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -412,6 +456,7 @@ ContextPath Value[props] Path props CPPipe pathFromEnv:CompletionSupport2.Internal found:false Path CompletionSupport2.Internal.support +Path support ContextPath Value[props].support->root ContextPath Value[props].support ContextPath Value[props] @@ -421,10 +466,13 @@ ContextPath Value[props] Path props CPPipe pathFromEnv:CompletionSupport2.Internal found:false Path CompletionSupport2.Internal.support +Path support CPPipe pathFromEnv:CompletionSupport.Nested found:false Path CompletionSupport.Nested.root +Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren +Path ren [{ "label": "ReactDOM.Client.Root.render", "kind": 12, @@ -450,6 +498,7 @@ ContextPath Value[root] Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren +Path ren [{ "label": "ReactDOM.Client.Root.render", "kind": 12, @@ -471,6 +520,7 @@ ContextPath Value[int] Path int CPPipe pathFromEnv:Integer found:true Path Integer. +Path [{ "label": "Integer.toInt", "kind": 12, @@ -489,6 +539,12 @@ Path Integer. "tags": [], "detail": "(t, int => int) => t", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 98:21 @@ -503,12 +559,19 @@ ContextPath Value[int] Path int CPPipe pathFromEnv:Integer found:true Path Integer.t +Path t [{ "label": "Integer.toInt", "kind": 12, "tags": [], "detail": "t => int", "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null }] Complete src/CompletionPipeChain.res 103:8 @@ -521,6 +584,7 @@ ContextPath Value[r] Path r CPPipe pathFromEnv:Js.Re found:false Path Js.Re.la +Path la [{ "label": "Js.Re.lastIndex", "kind": 12, @@ -539,6 +603,7 @@ ContextPath Value[xx] Path xx CPPipe pathFromEnv:Xyz found:true Path Xyz. +Path [{ "label": "Xyz.do", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt index 2252b0554b..29d9652878 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt @@ -13,6 +13,7 @@ ContextPath Value[sprite] Path sprite CPPipe pathFromEnv:Sprite found:true Path Sprite.anchor +Path anchor ContextPath Value[sprite].anchor-> ContextPath Value[sprite].anchor ContextPath Value[sprite] @@ -22,8 +23,10 @@ ContextPath Value[sprite] Path sprite CPPipe pathFromEnv:Sprite found:true Path Sprite.anchor +Path anchor CPPipe pathFromEnv:ObservablePoint found:true Path ObservablePoint. +Path [{ "label": "x", "kind": 5, diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt index 8e5d5b8de4..6669a1e770 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt @@ -8,6 +8,7 @@ ContextPath Value[A, B1, xx] Path A.B1.xx CPPipe pathFromEnv:A.B1 found:true Path A.B1. +Path [{ "label": "A.B1.d", "kind": 12, @@ -30,8 +31,10 @@ ContextPath Value[A, x] Path A.x CPPipe pathFromEnv:A found:true Path A.v +Path v CPPipe pathFromEnv:A.B1 found:true Path A.B1. +Path [{ "label": "A.B1.d", "kind": 12, @@ -55,6 +58,7 @@ ContextPath Value[E, e] Path E.e CPPipe pathFromEnv:E found:true Path E.v +Path v ContextPath Value[E, e].v->v ContextPath Value[E, e].v ContextPath Value[E, e] @@ -64,10 +68,13 @@ ContextPath Value[E, e] Path E.e CPPipe pathFromEnv:E found:true Path E.v +Path v CPPipe pathFromEnv:D found:true Path D.v +Path v CPPipe pathFromEnv:C found:false Path C. +Path [{ "label": "C.do", "kind": 12, @@ -91,6 +98,7 @@ ContextPath Value[E, e] Path E.e CPPipe pathFromEnv:E found:true Path E.v +Path v ContextPath Value[E, e].v->v2 ContextPath Value[E, e].v ContextPath Value[E, e] @@ -100,10 +108,13 @@ ContextPath Value[E, e] Path E.e CPPipe pathFromEnv:E found:true Path E.v +Path v CPPipe pathFromEnv:D found:true Path D.v2 +Path v2 CPPipe pathFromEnv:D.C2 found:true Path D.C2. +Path [{ "label": "D.C2.do", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt index 1cbc945f83..2cfc84238d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt @@ -12,6 +12,7 @@ ContextPath Value[w] Path w CPPipe pathFromEnv:M found:true Path M. +Path [{ "label": "->M.xyz", "kind": 12, @@ -65,6 +66,7 @@ ContextPath Value[meh] Path meh CPPipe pathFromEnv:M found:true Path M. +Path [{ "label": "->M.xyz", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt new file mode 100644 index 0000000000..70f6773fec --- /dev/null +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt @@ -0,0 +1,32 @@ +Complete src/DotPipeCompleteFromCurrentModule.res 10:13 +posCursor:[10:13] posNoWhite:[10:12] Found expr:[9:12->13:5] +posCursor:[10:13] posNoWhite:[10:12] Found expr:[10:11->12:10] +posCursor:[10:13] posNoWhite:[10:12] Found expr:[10:11->10:13] +Pexp_field [10:11->10:12] _:[12:8->10:13] +Completable: Cpath Value[x]."" +Raw opens: 1 X.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib DotPipeCompleteFromCurrentModule +ContextPath Value[x]."" +ContextPath Value[x] +Path x +ContextPath Value[x]-> +ContextPath Value[x] +Path x +CPPipe pathFromEnv:X found:true +Path X. +Path +[{ + "label": "->z", + "kind": 12, + "tags": [], + "detail": "X.t => string", + "documentation": null, + "sortText": "z", + "insertText": "->z", + "additionalTextEdits": [{ + "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, + "newText": "" + }] + }] + diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index ea3337aa8d..8db5129032 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -12,6 +12,7 @@ ContextPath Value[n] Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. +Path [{ "label": "name", "kind": 5, @@ -60,6 +61,7 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path SomeOtherModule. Path DotPipeCompletionSpec.CompleteFromThisToo. Path DotPipeCompletionSpec.SomeOtherModule. +Path [{ "label": "nname", "kind": 5, @@ -126,6 +128,18 @@ Path DotPipeCompletionSpec.SomeOtherModule. "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, "newText": "" }] + }, { + "label": "->doWithTypeOutsideModule", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => string", + "documentation": null, + "sortText": "doWithTypeOutsideModule", + "insertText": "->doWithTypeOutsideModule", + "additionalTextEdits": [{ + "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, + "newText": "" + }] }] Complete src/DotPipeCompletionSpec.res 62:5 @@ -143,6 +157,7 @@ Path a CPPipe pathFromEnv:A found:true Path A. Path B. +Path [{ "label": "->A.withA", "kind": 12, @@ -183,6 +198,7 @@ ContextPath Value[xx] Path xx CPPipe pathFromEnv:CompletionFromModule.SomeModule found:false Path CompletionFromModule.SomeModule. +Path [{ "label": "name", "kind": 5, @@ -217,6 +233,7 @@ ContextPath Value[ffff] Path ffff Path Stdlib.Array.u Path ArrayUtils.u +Path u [{ "label": "->Array.unshiftMany", "kind": 12, @@ -270,6 +287,7 @@ Path nnn CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. +Path [{ "label": "nname", "kind": 5, @@ -312,6 +330,18 @@ Path DotPipeCompletionSpec.SomeOtherModule. "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, "newText": "" }] + }, { + "label": "->doWithTypeOutsideModule", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => string", + "documentation": null, + "sortText": "doWithTypeOutsideModule", + "insertText": "->doWithTypeOutsideModule", + "additionalTextEdits": [{ + "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, + "newText": "" + }] }] Complete src/DotPipeCompletionSpec.res 86:39 @@ -331,6 +361,7 @@ ContextPath Value[Array, filter] Path Array.filter Path Stdlib.Array.filt Path ArrayUtils.filt +Path filt [{ "label": "->Array.filterMap", "kind": 12, @@ -385,6 +416,7 @@ ContextPath Value[Array, joinWith](Nolabel, Nolabel) ContextPath Value[Array, joinWith] Path Array.joinWith Path Stdlib.String.includ +Path includ [{ "label": "->String.includes", "kind": 12, @@ -426,6 +458,7 @@ ContextPath Value[String, toLowerCase](Nolabel) ContextPath Value[String, toLowerCase] Path String.toLowerCase Path Stdlib.String.toUpperCa +Path toUpperCa [{ "label": "->String.toUpperCase", "kind": 12, @@ -455,6 +488,7 @@ ContextPath Value[String, toUpperCase](Nolabel) ContextPath Value[String, toUpperCase] Path String.toUpperCase Path Stdlib.String.toLowerC +Path toLowerC [{ "label": "->String.toLowerCase", "kind": 12, @@ -485,6 +519,7 @@ Path t CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. +Path [{ "label": "nname", "kind": 5, @@ -527,6 +562,18 @@ Path DotPipeCompletionSpec.SomeOtherModule. "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, "newText": "" }] + }, { + "label": "->doWithTypeOutsideModule", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => string", + "documentation": null, + "sortText": "doWithTypeOutsideModule", + "insertText": "->doWithTypeOutsideModule", + "additionalTextEdits": [{ + "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, + "newText": "" + }] }] Complete src/DotPipeCompletionSpec.res 108:27 @@ -537,6 +584,16 @@ Resolved opens 1 Stdlib ContextPath Module[Dot] Path Dot [{ + "label": "DotPipeCompleteFromCurrentModule", + "kind": 9, + "tags": [], + "detail": "module DotPipeCompleteFromCurrentModule", + "documentation": null, + "data": { + "modulePath": "DotPipeCompleteFromCurrentModule", + "filePath": "src/DotPipeCompletionSpec.res" + } + }, { "label": "DotPipeCompletionSpec", "kind": 9, "tags": [], @@ -599,6 +656,16 @@ Resolved opens 1 Stdlib ContextPath Value[Dot] Path Dot [{ + "label": "DotPipeCompleteFromCurrentModule", + "kind": 9, + "tags": [], + "detail": "module DotPipeCompleteFromCurrentModule", + "documentation": null, + "data": { + "modulePath": "DotPipeCompleteFromCurrentModule", + "filePath": "src/DotPipeCompletionSpec.res" + } + }, { "label": "DotPipeCompletionSpec", "kind": 9, "tags": [], @@ -686,6 +753,7 @@ Path button CPPipe pathFromEnv:DOMAPI found:true Path DOMAPI. Path DotPipeCompletionSpec.HTMLButtonElement. +Path [{ "label": "disabled", "kind": 5, diff --git a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt index e9e8d298ef..2d5586d1f2 100644 --- a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt +++ b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt @@ -105,6 +105,7 @@ ContextPath Value[x] Path x CPPipe pathFromEnv: found:true Path ExhaustiveSwitch. +Path Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib diff --git a/tests/analysis_tests/tests/src/expected/Firebase.res.txt b/tests/analysis_tests/tests/src/expected/Firebase.res.txt index 6071f086bd..17105d12f4 100644 --- a/tests/analysis_tests/tests/src/expected/Firebase.res.txt +++ b/tests/analysis_tests/tests/src/expected/Firebase.res.txt @@ -13,6 +13,7 @@ ContextPath Value[ref] Path ref CPPipe pathFromEnv:Firebase.Firestore found:true Path Firebase.Firestore. +Path [{ "label": "id", "kind": 5, diff --git a/tests/analysis_tests/tests/src/expected/Hover.res.txt b/tests/analysis_tests/tests/src/expected/Hover.res.txt index 31a6fa21a6..bf4f292975 100644 --- a/tests/analysis_tests/tests/src/expected/Hover.res.txt +++ b/tests/analysis_tests/tests/src/expected/Hover.res.txt @@ -119,6 +119,7 @@ ContextPath Value[x1] Path x1 CPPipe pathFromEnv: found:true Path Hover.content +Path content ContextPath Value[x1].content-> ContextPath Value[x1].content ContextPath Value[x1] @@ -128,8 +129,10 @@ ContextPath Value[x1] Path x1 CPPipe pathFromEnv: found:true Path Hover.content +Path content CPPipe pathFromEnv: found:true Path Hover. +Path [{ "label": "age", "kind": 5, @@ -153,6 +156,7 @@ ContextPath Value[x2] Path x2 CPPipe pathFromEnv: found:true Path Hover.content +Path content ContextPath Value[x2].content-> ContextPath Value[x2].content ContextPath Value[x2] @@ -162,8 +166,10 @@ ContextPath Value[x2] Path x2 CPPipe pathFromEnv: found:true Path Hover.content +Path content CPPipe pathFromEnv: found:true Path Hover. +Path [{ "label": "age", "kind": 5, @@ -187,6 +193,7 @@ ContextPath Value[y1] Path y1 CPPipe pathFromEnv: found:true Path Hover.content +Path content ContextPath Value[y1].content-> ContextPath Value[y1].content ContextPath Value[y1] @@ -196,8 +203,10 @@ ContextPath Value[y1] Path y1 CPPipe pathFromEnv: found:true Path Hover.content +Path content CPPipe pathFromEnv: found:true Path Hover. +Path [{ "label": "age", "kind": 5, @@ -221,6 +230,7 @@ ContextPath Value[y2] Path y2 CPPipe pathFromEnv: found:true Path Hover.content +Path content ContextPath Value[y2].content-> ContextPath Value[y2].content ContextPath Value[y2] @@ -230,8 +240,10 @@ ContextPath Value[y2] Path y2 CPPipe pathFromEnv: found:true Path Hover.content +Path content CPPipe pathFromEnv: found:true Path Hover. +Path [{ "label": "age", "kind": 5, @@ -280,6 +292,7 @@ ContextPath Value[x] Path x CPPipe pathFromEnv: found:true Path Hover.someField +Path someField Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib {"contents": {"kind": "markdown", "value": " Mighty fine field here. \n\n```rescript\nbool\n```"}} diff --git a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt index db012ca3c9..c417c15932 100644 --- a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt +++ b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt @@ -26,6 +26,7 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib {"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```"}} @@ -46,6 +47,7 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra ContextPath Value[options].extra->superExtra ContextPath Value[options].extra ContextPath Value[options] @@ -55,8 +57,10 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra CPPipe pathFromEnv: found:true Path NestedRecords.superExtra +Path superExtra Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib {"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```"}} @@ -78,6 +82,7 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra ContextPath Value[options].extra->superExtra ContextPath Value[options].extra ContextPath Value[options] @@ -87,8 +92,10 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra CPPipe pathFromEnv: found:true Path NestedRecords.superExtra +Path superExtra ContextPath Value[options].extra.superExtra->age ContextPath Value[options].extra.superExtra ContextPath Value[options].extra @@ -99,6 +106,7 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra ContextPath Value[options].extra->superExtra ContextPath Value[options].extra ContextPath Value[options] @@ -108,10 +116,13 @@ ContextPath Value[options] Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra +Path extra CPPipe pathFromEnv: found:true Path NestedRecords.superExtra +Path superExtra CPPipe pathFromEnv: found:true Path NestedRecords.age +Path age Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib {"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} diff --git a/tests/analysis_tests/tests/src/expected/Nojaf.res.txt b/tests/analysis_tests/tests/src/expected/Nojaf.res.txt new file mode 100644 index 0000000000..e9d56bb0da --- /dev/null +++ b/tests/analysis_tests/tests/src/expected/Nojaf.res.txt @@ -0,0 +1,32 @@ +Complete src/Nojaf.res 10:13 +posCursor:[10:13] posNoWhite:[10:12] Found expr:[9:12->13:5] +posCursor:[10:13] posNoWhite:[10:12] Found expr:[10:11->12:10] +posCursor:[10:13] posNoWhite:[10:12] Found expr:[10:11->10:13] +Pexp_field [10:11->10:12] _:[12:8->10:13] +Completable: Cpath Value[x]."" +Raw opens: 1 X.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib Nojaf +ContextPath Value[x]."" +ContextPath Value[x] +Path x +ContextPath Value[x]-> +ContextPath Value[x] +Path x +CPPipe pathFromEnv:X found:true +Path X. +Path +[{ + "label": "->z", + "kind": 12, + "tags": [], + "detail": "X.t => string", + "documentation": null, + "sortText": "z", + "insertText": "->z", + "additionalTextEdits": [{ + "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, + "newText": "" + }] + }] + diff --git a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt index bb2b7c10a7..bef7e1df39 100644 --- a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt @@ -12,8 +12,10 @@ ContextPath Value[t] Path t CPPipe pathFromEnv: found:true Path RecordCompletion.n +Path n Path Stdlib.Array.m Path ArrayUtils.m +Path m [{ "label": "Array.map", "kind": 12, @@ -43,6 +45,7 @@ ContextPath Value[t2] Path t2 CPPipe pathFromEnv: found:true Path RecordCompletion.n2 +Path n2 ContextPath Value[t2].n2->n ContextPath Value[t2].n2 ContextPath Value[t2] @@ -52,10 +55,13 @@ ContextPath Value[t2] Path t2 CPPipe pathFromEnv: found:true Path RecordCompletion.n2 +Path n2 CPPipe pathFromEnv: found:true Path RecordCompletion.n +Path n Path Stdlib.Array.m Path ArrayUtils.m +Path m [{ "label": "Array.map", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt index 5c6f8fb4be..9ab09fb999 100644 --- a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt @@ -21,6 +21,7 @@ Path merge CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. +Path [{ "label": "->Observable.subscribe", "kind": 12, @@ -103,6 +104,7 @@ Path Rxjs.combineLatest CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. +Path [{ "label": "->Rxjs.Observable.subscribe", "kind": 12, diff --git a/tests/analysis_tests/tests/test.sh b/tests/analysis_tests/tests/test.sh index 0d57d897aa..47c431875c 100755 --- a/tests/analysis_tests/tests/test.sh +++ b/tests/analysis_tests/tests/test.sh @@ -24,7 +24,7 @@ diff=$(git ls-files --modified src/expected) if [[ $diff = "" ]]; then printf "${successGreen}✅ No analysis_tests snapshot changes detected.${reset}\n" else - printf "${warningYellow}⚠️ The analysis_tests snapshot doesn't match. Double check that the output is correct, run 'make analysis_tests' and stage the diff.\n${diff}\n${reset}" + printf "${warningYellow}⚠️ The analysis_tests snapshot doesn't match. Double check that the output is correct, run 'make test-analysis' and stage the diff.\n${diff}\n${reset}" git --no-pager diff src/expected exit 1 fi