From fdfc485979b8f16d359e2e1d6e2e07511991692c Mon Sep 17 00:00:00 2001 From: nojaf Date: Fri, 23 May 2025 17:52:04 +0200 Subject: [PATCH 1/2] WIP, capture current module path via AST --- analysis/src/Commands.ml | 2 +- analysis/src/CompletionBackEnd.ml | 81 ++-- analysis/src/CompletionFrontEnd.ml | 9 +- analysis/src/Completions.ml | 7 +- analysis/src/Hover.ml | 6 +- analysis/src/SignatureHelp.ml | 4 +- analysis/src/Xform.ml | 6 +- .../src/DotPipeCompleteFromCurrentModule.res | 60 +++ .../src/expected/CompletePrioritize1.res.txt | 9 +- .../src/expected/CompletePrioritize2.res.txt | 9 +- .../tests/src/expected/Completion.res.txt | 367 +++--------------- .../CompletionConfiguredBuiltins.res.txt | 2 + .../expected/CompletionExpressions.res.txt | 3 + .../src/expected/CompletionFromModule.res.txt | 48 +-- .../expected/CompletionFromModule2.res.txt | 4 + .../CompletionFunctionArguments.res.txt | 23 +- .../expected/CompletionInferValues.res.txt | 35 +- .../tests/src/expected/CompletionJsx.res.txt | 110 +----- .../src/expected/CompletionJsxProps.res.txt | 18 +- ...mpletionMultipleEditorCompleteFrom.res.txt | 27 +- .../src/expected/CompletionPipeChain.res.txt | 207 ++-------- .../expected/CompletionPipeProperty.res.txt | 27 +- .../expected/CompletionPipeSubmodules.res.txt | 88 +---- .../src/expected/CompletionRegexp.res.txt | 1 + .../expected/CompletionTaggedTemplate.res.txt | 78 +--- .../DotPipeCompleteFromCurrentModule.res.txt | 113 ++++++ .../expected/DotPipeCompletionSpec.res.txt | 174 ++++++--- .../src/expected/ExhaustiveSwitch.res.txt | 1 + .../tests/src/expected/Firebase.res.txt | 13 +- .../tests/src/expected/Hover.res.txt | 13 + .../tests/src/expected/Jsx2.res.txt | 210 ++-------- .../tests/src/expected/JsxV4.res.txt | 8 +- .../tests/src/expected/NestedRecords.res.txt | 11 + .../src/expected/RecordCompletion.res.txt | 22 +- .../tests/src/expected/Reprod.res.txt | 11 +- .../tests/src/expected/RxjsCompletion.res.txt | 2 + 36 files changed, 577 insertions(+), 1232 deletions(-) diff --git a/analysis/src/Commands.ml b/analysis/src/Commands.ml index 464b3fa53d..87bb896fbb 100644 --- a/analysis/src/Commands.ml +++ b/analysis/src/Commands.ml @@ -4,7 +4,7 @@ let completion ~debug ~path ~pos ~currentFile = Completions.getCompletions ~debug ~path ~pos ~currentFile ~forHover:false with | None -> [] - | Some (completions, full, _) -> + | Some (completions, full, _, _) -> completions |> List.map (CompletionBackEnd.completionToItem ~full) |> List.map Protocol.stringifyCompletionItem diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 96dab722d1..3c56e5f5f9 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -774,7 +774,7 @@ let completionsGetCompletionType ~full completions = | _ -> None let rec completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos - completions = + ~cursorPath completions = let firstNonSyntheticCompletion = List.find_opt (fun c -> not c.Completion.synthetic) completions in @@ -787,8 +787,9 @@ let rec completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos | Some {Completion.kind = FollowContextPath (ctxPath, scope); env} -> ctxPath |> getCompletionsForContextPath ~debug ~full ~env ~exact:true ~opens - ~rawOpens ~pos ~scope + ~rawOpens ~pos ~scope ~cursorPath |> completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos + ~cursorPath | Some {Completion.kind = Type typ; env} -> ( match TypeUtils.extractTypeFromResolvedType typ ~env ~full with | None -> None @@ -798,7 +799,7 @@ let rec completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos | _ -> None and completionsGetTypeEnv2 ~debug (completions : Completion.t list) ~full ~opens - ~rawOpens ~pos = + ~rawOpens ~pos ~cursorPath = let firstNonSyntheticCompletion = List.find_opt (fun c -> not c.Completion.synthetic) completions in @@ -809,12 +810,12 @@ and completionsGetTypeEnv2 ~debug (completions : Completion.t list) ~full ~opens | Some {Completion.kind = FollowContextPath (ctxPath, scope); env} -> ctxPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + ~exact:true ~scope ~cursorPath + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath | _ -> None and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact - ~scope ?(mode = Regular) contextPath = + ~scope ?(mode = Regular) ~cursorPath contextPath = let envCompletionIsMadeFrom = env in if debug then Printf.printf "ContextPath %s\n" @@ -847,7 +848,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType ~full with | None -> [] @@ -869,7 +870,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType ~full with | None -> [] @@ -884,7 +885,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType ~full with | Some (Tpromise (env, typ), _env) -> @@ -934,8 +935,9 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos + ~cursorPath with | Some ((TypeExpr typ | ExtractedType (Tfunction {typ})), env) -> ( let rec reconstructFunctionType args tRet = @@ -985,11 +987,11 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact let completionsFromCtxPath = cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath in let mainTypeCompletionEnv = completionsFromCtxPath - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath in match mainTypeCompletionEnv with | None -> @@ -1021,7 +1023,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact let pipeCompletions = cpAsPipeCompletion |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos - ~env:envCompletionIsMadeFrom ~exact ~scope + ~env:envCompletionIsMadeFrom ~exact ~scope ~cursorPath |> List.filter_map (fun c -> TypeUtils.transformCompletionToPipeCompletion ~synthetic:true ~env ?posOfDot c) @@ -1033,8 +1035,8 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + ~exact:true ~scope ~cursorPath + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath with | Some (typ, env) -> ( match typ |> TypeUtils.extractObjectType ~env ~package with @@ -1052,8 +1054,8 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope ~mode:Pipe - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + ~exact:true ~scope ~mode:Pipe ~cursorPath + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath with | None -> if Debug.verbose () then @@ -1180,8 +1182,18 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact |> TypeUtils.filterPipeableFunctions ~synthetic:true ~env ~full ~targetTypeId:mainTypeId in + (* Add completions from current fully qualified path module *) + let currentFullyQualifiedPathModuleCompletions = + [] + (* completionsForPipeFromCompletionPath ~envCompletionIsMadeFrom + ~opens:[] ~pos ~scope ~debug ~prefix ~env ~rawOpens ~full cursorPath + + |> TypeUtils.filterPipeableFunctions ~synthetic:true ~env ~full + ~targetTypeId:mainTypeId *) + in jsxCompletions @ pipeCompletions @ extraCompletions - @ currentModuleCompletions @ globallyConfiguredCompletions)) + @ currentModuleCompletions @ globallyConfiguredCompletions + @ currentFullyQualifiedPathModuleCompletions)) | CTuple ctxPaths -> if Debug.verbose () then print_endline "[ctx_path]--> CTuple"; (* Turn a list of context paths into a list of type expressions. *) @@ -1190,7 +1202,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact |> List.map (fun contextPath -> contextPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos - ~env ~exact:true ~scope) + ~env ~exact:true ~scope ~cursorPath) |> List.filter_map (fun completionItems -> match completionItems with | {Completion.kind = Value typ} :: _ -> Some typ @@ -1208,7 +1220,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact path |> getCompletionsForPath ~debug ~completionContext:Value ~exact:true ~opens ~full ~pos ~env ~scope - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath in let lowercaseComponent = match pathToComponent with @@ -1283,8 +1295,9 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match functionContextPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos + ~cursorPath with | Some ((TypeExpr typ | ExtractedType (Tfunction {typ})), env) -> if Debug.verbose () then print_endline "--> found function type"; @@ -1330,8 +1343,9 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact match rootCtxPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos + ~cursorPath with | Some (typ, env) -> ( match typ |> TypeUtils.resolveNestedPatternPath ~env ~full ~nested with @@ -1846,7 +1860,8 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens module StringSet = Set.Make (String) -let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = +let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover ~cursorPath + completable = if debug then Printf.printf "Completable: %s\n" (Completable.toString completable); let package = full.package in @@ -1857,14 +1872,14 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = path |> getCompletionsForPath ~debug ~completionContext:Value ~exact:true ~opens ~full ~pos ~env ~scope - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath in match completable with | Cnone -> [] | Cpath contextPath -> contextPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:forHover ~scope + ~exact:forHover ~scope ~cursorPath | Cjsx ([id], prefix, identsSeen) when String.uncapitalize_ascii id = id -> ( (* Lowercase JSX tag means builtin *) let mkLabel (name, typString) = @@ -2115,8 +2130,8 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = match cp |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + ~exact:true ~scope ~cursorPath + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath with | Some (typ, _env) -> if debug then @@ -2144,15 +2159,17 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = let fallbackOrEmpty ?items () = match (fallback, items) with | Some fallback, (None | Some []) -> - fallback |> processCompletable ~debug ~full ~scope ~env ~pos ~forHover + fallback + |> processCompletable ~debug ~full ~scope ~env ~pos ~forHover + ~cursorPath | _, Some items -> items | None, None -> [] in match contextPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope - |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos + ~exact:true ~scope ~cursorPath + |> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos ~cursorPath with | Some (typ, env) -> ( match @@ -2200,7 +2217,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = match contextPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:true ~scope + ~exact:true ~scope ~cursorPath |> completionsGetCompletionType ~full with | None -> @@ -2301,7 +2318,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = let completionsForContextPath = contextPath |> getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env - ~exact:forHover ~scope + ~exact:forHover ~scope ~cursorPath in completionsForContextPath |> List.map (fun (c : Completion.t) -> diff --git a/analysis/src/CompletionFrontEnd.ml b/analysis/src/CompletionFrontEnd.ml index 2c2b49380e..5b60c133f9 100644 --- a/analysis/src/CompletionFrontEnd.ml +++ b/analysis/src/CompletionFrontEnd.ml @@ -357,6 +357,7 @@ let completePipeChain ~(inJsxContext : bool) (exp : Parsetree.expression) = let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ?findThisExprLoc text = + let cursorPath = Stack.create () in let offsetNoWhite = Utils.skipWhite text (offset - 1) in let posNoWhite = let line, col = posCursor in @@ -737,8 +738,10 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor if recFlag = Nonrecursive then decls |> List.iter scopeTypeDeclaration; processed := true | Pstr_module mb -> + if Loc.hasPos mb.pmb_loc ~pos:posCursor then Stack.push mb.pmb_name.txt cursorPath; iterator.module_binding iterator mb; scopeModuleBinding mb; + (* if Loc.hasPos mb.pmb_loc ~pos:posCursor then Stack.pop cursorPath |> ignore; *) processed := true | Pstr_recmodule mbs -> mbs |> List.iter scopeModuleBinding; @@ -1737,7 +1740,8 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor (Cpath (CPId {loc = Location.none; path = [""]; completionContext = Value}))); if !found = false then if debug then Printf.printf "XXX Not found!\n"; - !result) + let cursorPath = Stack.to_seq cursorPath |> List.of_seq |> List.rev in + !result |> Option.map (fun (c, s) -> (c, s, cursorPath))) else if Filename.check_suffix path ".resi" then ( let parser = Res_driver.parsing_engine.parse_interface ~for_printer:false in let {Res_driver.parsetree = signature} = parser ~filename:currentFile in @@ -1748,7 +1752,8 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor (Cpath (CPId {loc = Location.none; path = [""]; completionContext = Type}))); if !found = false then if debug then Printf.printf "XXX Not found!\n"; - !result) + let cursorPath = Stack.to_seq cursorPath |> List.of_seq |> List.rev in + !result |> Option.map (fun (c, s) -> (c, s, cursorPath))) else None let completionWithParser ~debug ~path ~posCursor ~currentFile ~text = diff --git a/analysis/src/Completions.ml b/analysis/src/Completions.ml index 42176bb3b0..439f42694e 100644 --- a/analysis/src/Completions.ml +++ b/analysis/src/Completions.ml @@ -8,15 +8,16 @@ let getCompletions ~debug ~path ~pos ~currentFile ~forHover = ~currentFile ~text with | None -> None - | Some (completable, scope) -> ( + | Some (completable, scope, cursorPath) -> ( (* Only perform expensive ast operations if there are completables *) match Cmt.loadFullCmtFromPath ~path with | None -> None | Some full -> let env = SharedTypes.QueryEnv.fromFile full.file in + let cursorPath = full.file.moduleName :: cursorPath in let completables = completable |> CompletionBackEnd.processCompletable ~debug ~full ~pos ~scope ~env - ~forHover + ~forHover ~cursorPath in - Some (completables, full, scope))) + Some (completables, full, scope, cursorPath))) diff --git a/analysis/src/Hover.ml b/analysis/src/Hover.ml index f0979d695c..a12b7360af 100644 --- a/analysis/src/Hover.ml +++ b/analysis/src/Hover.ml @@ -152,7 +152,7 @@ let getHoverViaCompletions ~debug ~path ~pos ~currentFile ~forHover ~supportsMarkdownLinks = match Completions.getCompletions ~debug ~path ~pos ~currentFile ~forHover with | None -> None - | Some (completions, ({file; package} as full), scope) -> ( + | Some (completions, ({file; package} as full), scope, cursorPath) -> ( let rawOpens = Scope.getRawOpens scope in match completions with | {kind = Label typString; docstring} :: _ -> @@ -166,7 +166,7 @@ let getHoverViaCompletions ~debug ~path ~pos ~currentFile ~forHover let opens = CompletionBackEnd.getOpens ~debug ~rawOpens ~package ~env in match CompletionBackEnd.completionsGetTypeEnv2 ~debug ~full ~rawOpens ~opens - ~pos completions + ~pos completions ~cursorPath with | Some (typ, _env) -> let typeString = @@ -179,7 +179,7 @@ let getHoverViaCompletions ~debug ~path ~pos ~currentFile ~forHover let opens = CompletionBackEnd.getOpens ~debug ~rawOpens ~package ~env in match CompletionBackEnd.completionsGetTypeEnv2 ~debug ~full ~rawOpens ~opens - ~pos completions + ~pos completions ~cursorPath with | Some (typ, _env) -> let typeString = diff --git a/analysis/src/SignatureHelp.ml b/analysis/src/SignatureHelp.ml index 481aa7e043..e8c41ae97f 100644 --- a/analysis/src/SignatureHelp.ml +++ b/analysis/src/SignatureHelp.ml @@ -84,11 +84,11 @@ let findFunctionType ~currentFile ~debug ~path ~pos = ~currentFile ~text with | None -> None - | Some (completable, scope) -> + | Some (completable, scope, cursorPath) -> Some ( completable |> CompletionBackEnd.processCompletable ~debug ~full ~pos ~scope - ~env ~forHover:true, + ~env ~forHover:true ~cursorPath, env, package, file )) diff --git a/analysis/src/Xform.ml b/analysis/src/Xform.ml index 837f7df744..8a3472f0cd 100644 --- a/analysis/src/Xform.ml +++ b/analysis/src/Xform.ml @@ -8,12 +8,12 @@ let extractTypeFromExpr expr ~debug ~path ~currentFile ~full ~pos = |> CompletionFrontEnd.findTypeOfExpressionAtLoc ~debug ~path ~currentFile ~posCursor:(Pos.ofLexing expr.Parsetree.pexp_loc.loc_start) with - | Some (completable, scope) -> ( + | Some (completable, scope, cursorPath) -> ( let env = SharedTypes.QueryEnv.fromFile full.SharedTypes.file in let completions = completable |> CompletionBackEnd.processCompletable ~debug ~full ~pos ~scope ~env - ~forHover:true + ~forHover:true ~cursorPath in let rawOpens = Scope.getRawOpens scope in match completions with @@ -23,7 +23,7 @@ let extractTypeFromExpr expr ~debug ~path ~currentFile ~full ~pos = in match CompletionBackEnd.completionsGetCompletionType2 ~debug ~full ~rawOpens - ~opens ~pos completions + ~opens ~pos completions ~cursorPath with | Some (typ, _env) -> let extractedType = diff --git a/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res b/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res index 819086e35a..c2d6ba0d07 100644 --- a/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res +++ b/tests/analysis_tests/tests/src/DotPipeCompleteFromCurrentModule.res @@ -14,4 +14,64 @@ module Y = { } let b = (x:t) => 4 +} + +module Types = { + type comp + type context + type vec2 +} + +module PosComp = ( + T: { + type t + }, +) => { + open Types + + @send + external addPos: (context, float, float) => comp = "pos" + + @send + external addPosFromVec2: (context, vec2) => comp = "pos" +} + +module SpriteComp = ( + T: { + type t + } +) + => { + open Types + + @send + external addSprite: (context, string) => comp = "sprite" + } + +external k: Types.context = "k" + +module Wall = { + type t + + include PosComp({ type t = t }) + + let make = () => { + [ + // k. + // ^com + ] + } + + module Poster = { + type t + + include SpriteComp({ type t = t }) + + let make = () => { + [ + // k. + // ^com + ] + } + } } \ 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 76eb966f01..12219e3ab4 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt @@ -9,11 +9,6 @@ Path a CPPipe pathFromEnv:Test found:true Path Test. Path -[{ - "label": "Test.name", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }] +Path CompletePrioritize1. +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt index 8c196abdd5..4ccbd43869 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt @@ -9,13 +9,8 @@ Path ax CPPipe pathFromEnv:Test found:true Path Test. Path -[{ - "label": "Test.add", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }] +Path CompletePrioritize2. +[] Complete src/CompletePrioritize2.res 12:5 posCursor:[12:5] posNoWhite:[12:4] Found expr:[12:3->12:5] diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index f56854cd77..f4f52e4ba5 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -6,37 +6,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[MyList, m] Path MyList.m -[{ - "label": "mapReverse", - "kind": 12, - "tags": [], - "detail": "(list<'a>, 'a => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n"} - }, { - "label": "mapReverse2", - "kind": 12, - "tags": [], - "detail": "(list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>", - "documentation": {"kind": "markdown", "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nassertEqual(List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b), list{4, 2})\n```\n"} - }, { - "label": "make", - "kind": 12, - "tags": [], - "detail": "(~length: int, 'a) => list<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nassertEqual(List.make(~length=3, 1), list{1, 1, 1})\n```\n"} - }, { - "label": "mapWithIndex", - "kind": 12, - "tags": [], - "detail": "(list<'a>, ('a, int) => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->List.mapWithIndex((x, index) => index + x), list{1, 3, 5})\n```\n"} - }, { - "label": "map", - "kind": 12, - "tags": [], - "detail": "(list<'a>, 'a => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2}->List.map(x => x + 1), list{2, 3})\n```\n"} - }] +[] Complete src/Completion.res 3:9 posCursor:[3:9] posNoWhite:[3:8] Found expr:[3:3->3:9] @@ -624,13 +594,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Dep, c] Path Dep.c -[{ - "label": "customDouble", - "kind": 12, - "tags": [1], - "detail": "int => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use customDouble instead\n\nSome doc comment"} - }] +[] Complete src/Completion.res 23:20 posCursor:[23:20] posNoWhite:[23:19] Found expr:[23:11->23:20] @@ -640,20 +604,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -Found type for function (~age: int, ~name: string) => string -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Completion.res 26:13 posCursor:[26:13] posNoWhite:[26:12] Found expr:[26:3->26:13] @@ -665,6 +616,7 @@ ContextPath array Path Stdlib.Array.m Path ArrayUtils.m Path m +Path Completion.m [{ "label": "Array.map", "kind": 12, @@ -688,6 +640,7 @@ ContextPath string->toU ContextPath string Path Stdlib.String.toU Path toU +Path Completion.toU [{ "label": "String.toUpperCase", "kind": 12, @@ -706,6 +659,7 @@ ContextPath Value[op] Path op Path Stdlib.Option.e Path e +Path Completion.e [{ "label": "Option.equal", "kind": 12, @@ -727,17 +681,18 @@ Path fa CPPipe pathFromEnv:ForAuto found:true Path ForAuto. Path +Path Completion. [{ - "label": "ForAuto.abc", + "label": "myAmazingFunction", "kind": 12, "tags": [], - "detail": "(t, int) => t", + "detail": "(int, int) => int", "documentation": null }, { - "label": "ForAuto.abd", + "label": "uncurried", "kind": 12, "tags": [], - "detail": "(t, int) => t", + "detail": "int => int", "documentation": null }] @@ -768,13 +723,7 @@ Completable: Cjsx([O, Comp], z, [z]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path O.Comp.make -[{ - "label": "zoo", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[] Complete src/Completion.res 65:8 Attribute id:reac:[65:3->65:8] label:reac @@ -814,14 +763,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -Found type for function (~age: int, ~name: string) => string -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Completion.res 74:26 posCursor:[74:26] posNoWhite:[74:25] Found expr:[74:11->74:26] @@ -831,14 +773,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -Found type for function (~age: int, ~name: string) => string -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Completion.res 77:32 posCursor:[77:32] posNoWhite:[77:31] Found expr:[77:11->77:32] @@ -848,14 +783,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -Found type for function (~age: int, ~name: string) => string -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Completion.res 82:5 posCursor:[82:5] posNoWhite:[82:4] Found expr:[80:8->86:1] @@ -865,7 +793,6 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -Found type for function (~age: int, ~name: string) => string [] Complete src/Completion.res 90:13 @@ -967,6 +894,7 @@ Path r CPPipe pathFromEnv: found:true Path Completion. Path +Path Completion. [{ "label": "x", "kind": 5, @@ -996,6 +924,7 @@ Path Objects.Rec.recordVal CPPipe pathFromEnv:Rec found:true Path Objects.Rec. Path +Path Completion. [{ "label": "xx", "kind": 5, @@ -1059,13 +988,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[O, ""] Path O. -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[] Complete src/Completion.res 157:8 posCursor:[157:8] posNoWhite:[157:7] Found expr:[157:3->157:8] @@ -1083,6 +1006,7 @@ Path q CPPipe pathFromEnv: found:true Path Completion.aa Path aa +Path Completion.aa ContextPath Value[q].aa-> ContextPath Value[q].aa ContextPath Value[q] @@ -1093,9 +1017,11 @@ Path q CPPipe pathFromEnv: found:true Path Completion.aa Path aa +Path Completion.aa CPPipe pathFromEnv: found:true Path Completion. Path +Path Completion. [{ "label": "x", "kind": 5, @@ -1126,6 +1052,7 @@ Path q CPPipe pathFromEnv: found:true Path Completion.aa Path aa +Path Completion.aa ContextPath Value[q].aa->n ContextPath Value[q].aa ContextPath Value[q] @@ -1136,9 +1063,11 @@ Path q CPPipe pathFromEnv: found:true Path Completion.aa Path aa +Path Completion.aa CPPipe pathFromEnv: found:true Path Completion.n Path n +Path Completion.n [{ "label": "name", "kind": 5, @@ -1171,13 +1100,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[{ - "label": "WithChildren", - "kind": 9, - "tags": [], - "detail": "module WithChildren", - "documentation": null - }] +[] Complete src/Completion.res 172:17 posCursor:[172:17] posNoWhite:[172:16] Found type:[172:12->172:17] @@ -1203,13 +1126,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[ForAuto, ""] Path ForAuto. -[{ - "label": "t", - "kind": 22, - "tags": [], - "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = int\n```"} - }] +[] Complete src/Completion.res 179:13 posCursor:[179:13] posNoWhite:[179:12] Found expr:[179:11->179:13] @@ -1240,13 +1157,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[For] Path For -[{ - "label": "ForAuto", - "kind": 9, - "tags": [], - "detail": "module ForAuto", - "documentation": null - }] +[] Complete src/Completion.res 190:11 posCursor:[190:11] posNoWhite:[190:10] Found expr:[190:3->190:11] @@ -1256,13 +1167,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Private, ""] Path Private. -[{ - "label": "b", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Completion.res 202:6 posCursor:[202:6] posNoWhite:[202:5] Found expr:[202:3->202:6] @@ -1318,19 +1223,7 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "forAutoLabel", - "kind": 4, - "tags": [], - "detail": "FAR.forAutoRecord", - "documentation": null - }] +[] Complete src/Completion.res 224:37 posCursor:[224:37] posNoWhite:[224:36] Found expr:[224:3->224:37] @@ -1343,26 +1236,7 @@ ContextPath Value[FAO, forAutoObject]["forAutoLabel"]."" ContextPath Value[FAO, forAutoObject]["forAutoLabel"] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -ContextPath Value[FAO, forAutoObject]["forAutoLabel"]-> -ContextPath Value[FAO, forAutoObject]["forAutoLabel"] -ContextPath Value[FAO, forAutoObject] -Path FAO.forAutoObject -CPPipe pathFromEnv:FAR found:true -Path FAR. -Path -[{ - "label": "forAuto", - "kind": 5, - "tags": [], - "detail": "ForAuto.t", - "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "something", - "kind": 5, - "tags": [], - "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }] +[] Complete src/Completion.res 227:46 posCursor:[227:46] posNoWhite:[227:45] Found expr:[227:3->0:-1] @@ -1375,35 +1249,7 @@ ContextPath Value[FAO, forAutoObject]["forAutoLabel"].forAuto ContextPath Value[FAO, forAutoObject]["forAutoLabel"] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -ContextPath Value[FAO, forAutoObject]["forAutoLabel"]->forAuto -ContextPath Value[FAO, forAutoObject]["forAutoLabel"] -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, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "ForAuto.abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "myAmazingFunction", - "kind": 12, - "tags": [], - "detail": "(int, int) => int", - "documentation": null - }] +[] Complete src/Completion.res 230:55 posCursor:[230:55] posNoWhite:[230:54] Found expr:[230:3->230:55] @@ -1415,19 +1261,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, a] Path ForAuto.a -[{ - "label": "abc", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }] +[] Complete src/Completion.res 234:34 posCursor:[234:34] posNoWhite:[234:33] Found expr:[234:18->234:36] @@ -1476,6 +1310,7 @@ Path _z CPPipe pathFromEnv: found:true Path Completion. Path +Path Completion. [{ "label": "x", "kind": 5, @@ -1499,13 +1334,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLo] Path SomeLo -[{ - "label": "SomeLocalModule", - "kind": 9, - "tags": [], - "detail": "module SomeLocalModule", - "documentation": null - }] +[] Complete src/Completion.res 256:29 posCursor:[256:29] posNoWhite:[256:28] Found type:[256:13->256:29] @@ -1516,13 +1345,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "zz", - "kind": 22, - "tags": [], - "detail": "type zz", - "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} - }] +[] Complete src/Completion.res 261:33 posCursor:[261:33] posNoWhite:[261:32] Found type:[261:17->263:11] @@ -1533,13 +1356,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "zz", - "kind": 22, - "tags": [], - "detail": "type zz", - "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} - }] +[] Complete src/Completion.res 268:21 Ptype_variant unary SomeLocal:[268:12->268:21] @@ -1555,12 +1372,6 @@ Path SomeLocal "tags": [], "detail": "SomeLocalVariantItem", "documentation": {"kind": "markdown", "value": "```rescript\nSomeLocalVariantItem\n```\n\n```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```"} - }, { - "label": "SomeLocalModule", - "kind": 9, - "tags": [], - "detail": "module SomeLocalModule", - "documentation": null }] Complete src/Completion.res 271:20 @@ -1573,13 +1384,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocal] Path SomeLocal -[{ - "label": "SomeLocalModule", - "kind": 9, - "tags": [], - "detail": "module SomeLocalModule", - "documentation": null - }] +[] Complete src/Completion.res 275:15 posCursor:[275:15] posNoWhite:[275:14] Found expr:[274:11->278:1] @@ -1639,6 +1444,7 @@ Path funRecord CPPipe pathFromEnv: found:true Path Completion.someFun Path someFun +Path Completion.someFun Found type for function (~name: string) => unit [{ "label": "name", @@ -1666,6 +1472,7 @@ Path retAA CPPipe pathFromEnv: found:true Path Completion. Path +Path Completion. [{ "label": "x", "kind": 5, @@ -2022,10 +1829,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Stdlib.place holder Pervasives.JsxModules.place holder -Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\n{\"age\": int, \"forAutoLabel\": FAR.forAutoRecord}\n```"}} +null Hover src/Completion.res 355:17 Nothing at that position. Now trying to use completion. @@ -2163,13 +1967,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[AndThatOther, T] Path AndThatOther.T -[{ - "label": "ThatOther", - "kind": 4, - "tags": [], - "detail": "ThatOther", - "documentation": {"kind": "markdown", "value": "```rescript\nThatOther\n```\n\n```rescript\ntype v = And | ThatOther\n```"} - }] +[] Complete src/Completion.res 381:24 posCursor:[381:24] posNoWhite:[381:23] Found expr:[381:12->381:26] @@ -2184,19 +1982,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, ""] Path ForAuto. -[{ - "label": "abc", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }] +[] Complete src/Completion.res 384:38 posCursor:[384:38] posNoWhite:[384:37] Found expr:[384:12->384:41] @@ -2212,19 +1998,7 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "forAutoLabel", - "kind": 4, - "tags": [], - "detail": "FAR.forAutoRecord", - "documentation": null - }] +[] Complete src/Completion.res 387:24 posCursor:[387:24] posNoWhite:[387:23] Found expr:[387:11->387:26] @@ -2246,6 +2020,7 @@ Path funRecord CPPipe pathFromEnv: found:true Path Completion. Path +Path Completion. [{ "label": "someFun", "kind": 5, @@ -2273,6 +2048,7 @@ ContextPath array Path Stdlib.Array.ma Path ArrayUtils.ma Path ma +Path Completion.ma [{ "label": "Array.map", "kind": 12, @@ -2375,19 +2151,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "bb", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "aa", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Completion.res 414:21 posCursor:[414:21] posNoWhite:[414:20] Found expr:[410:14->417:1] @@ -2402,19 +2166,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "bb", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "aa", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Completion.res 419:17 posCursor:[419:17] posNoWhite:[419:16] Found expr:[419:11->419:17] @@ -2426,6 +2178,7 @@ ContextPath int->t ContextPath int Path Stdlib.Int.t Path t +Path Completion.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -2498,6 +2251,7 @@ ContextPath float->t ContextPath float Path Stdlib.Float.t Path t +Path Completion.t [{ "label": "Float.toStringWithRadix", "kind": 12, @@ -2571,6 +2325,7 @@ ContextPath Value[ok] Path ok Path Stdlib.Result.g Path g +Path Completion.g [{ "label": "Result.getExn", "kind": 12, @@ -2607,6 +2362,7 @@ Path rWithDepr CPPipe pathFromEnv: found:true Path Completion.so Path so +Path Completion.so [{ "label": "someInt", "kind": 5, @@ -2667,6 +2423,7 @@ ContextPath Value[uncurried] Path uncurried Path Stdlib.Int.toS Path toS +Path Completion.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -2709,23 +2466,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath ValueOrField[FAR, ""] Path FAR. -[{ - "label": "forAutoRecord", - "kind": 12, - "tags": [], - "detail": "forAutoRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "forAuto", - "kind": 5, - "tags": [], - "detail": "ForAuto.t", - "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "something", - "kind": 5, - "tags": [], - "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }] +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt index bb2bf05e4e..0492c563ae 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt @@ -9,6 +9,7 @@ Path x Path Stdlib.Array.em Path ArrayUtils.em Path em +Path CompletionConfiguredBuiltins.em [{ "label": "ArrayUtils.empty", "kind": 12, @@ -29,6 +30,7 @@ CPPipe pathFromEnv:Fastify found:false Path Fastify.doSt Path FastifyExt.doSt Path doSt +Path CompletionConfiguredBuiltins.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 bfea51f5fc..7b260228f3 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt @@ -1013,6 +1013,7 @@ Path fff CPPipe pathFromEnv: found:true Path CompletionExpressions.someOpt Path someOpt +Path CompletionExpressions.someOpt [{ "label": "someOptField", "kind": 5, @@ -1488,6 +1489,7 @@ Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. Path +Path CompletionExpressions. [{ "label": "test", "kind": 5, @@ -1549,6 +1551,7 @@ Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. Path +Path CompletionExpressions. [{ "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 8cfb06f7ea..47bd6af8a8 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt @@ -13,24 +13,13 @@ Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. Path +Path CompletionFromModule. [{ "label": "name", "kind": 5, "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->SomeModule.getName", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null, - "sortText": "getName", - "insertText": "->SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 10, "character": 4}, "end": {"line": 10, "character": 5}}, - "newText": "" - }] }] Complete src/CompletionFromModule.res 30:6 @@ -49,6 +38,7 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path SomeOtherModule. Path CompletionFromModule.SomeOtherModule. Path +Path CompletionFromModule. [{ "label": "nname", "kind": 5, @@ -79,30 +69,6 @@ Path "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, "newText": "" }] - }, { - "label": "->SomeOtherModule.getNName", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null, - "sortText": "getNName", - "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", - "kind": 12, - "tags": [], - "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", - "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] }] Complete src/CompletionFromModule.res 33:32 @@ -112,13 +78,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[SomeOthe] Path SomeOthe -[{ - "label": "SomeOtherModule", - "kind": 9, - "tags": [], - "detail": "module SomeOtherModule", - "documentation": null - }] +[] Complete src/CompletionFromModule.res 38:8 posCursor:[38:8] posNoWhite:[38:7] Found expr:[38:3->0:-1] @@ -132,6 +92,7 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path +Path CompletionFromModule. [{ "label": "SomeOtherModule.getNName", "kind": 12, @@ -159,6 +120,7 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path +Path CompletionFromModule. [{ "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 eb647d43c5..37e16f5a59 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt @@ -13,6 +13,7 @@ Path CompletionFromModule.n CPPipe pathFromEnv:SomeModule found:true Path CompletionFromModule.SomeModule. Path +Path CompletionFromModule2. [{ "label": "name", "kind": 5, @@ -49,6 +50,7 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path CompletionFromModule.SomeOtherModule. Path CompletionFromModule.SomeOtherModule. Path +Path CompletionFromModule2. [{ "label": "nname", "kind": 5, @@ -117,6 +119,7 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path +Path CompletionFromModule2. [{ "label": "CompletionFromModule.SomeOtherModule.getNName", "kind": 12, @@ -144,6 +147,7 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path +Path CompletionFromModule2. [{ "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 3beb757a82..3e75250d47 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt @@ -171,12 +171,6 @@ Path someFnTakingVariant "sortText": "A One", "insertText": "One", "insertTextFormat": 2 - }, { - "label": "OIncludeMeInCompletions", - "kind": 9, - "tags": [], - "detail": "module OIncludeMeInCompletions", - "documentation": null }, { "label": "Option", "kind": 9, @@ -254,12 +248,6 @@ Path someFnTakingVariant "sortText": "A One", "insertText": "One", "insertTextFormat": 2 - }, { - "label": "OIncludeMeInCompletions", - "kind": 9, - "tags": [], - "detail": "module OIncludeMeInCompletions", - "documentation": null }, { "label": "Option", "kind": 9, @@ -439,6 +427,7 @@ Path thisGetsBrokenLoc CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a Path a +Path CompletionFunctionArguments.a [{ "label": "JsxEvent.Mouse.altKey", "kind": 12, @@ -463,6 +452,7 @@ Path reassignedWorks CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a Path a +Path CompletionFunctionArguments.a [{ "label": "JsxEvent.Mouse.altKey", "kind": 12, @@ -485,11 +475,6 @@ Path fineModuleVal CPPipe pathFromEnv:FineModule found:true Path FineModule. Path -[{ - "label": "FineModule.setToFalse", - "kind": 12, - "tags": [], - "detail": "t => t", - "documentation": null - }] +Path CompletionFunctionArguments. +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index d9fe7877f9..7603c44877 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -11,6 +11,7 @@ Path x ContextPath int Path Stdlib.Int.t Path t +Path CompletionInferValues.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -94,6 +95,7 @@ Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "name", "kind": 5, @@ -133,6 +135,7 @@ Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "name", "kind": 5, @@ -175,6 +178,7 @@ Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "name", "kind": 5, @@ -221,6 +225,7 @@ Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "name", "kind": 5, @@ -253,6 +258,7 @@ Path reactEventFn CPPipe pathFromEnv:ReactEvent.Mouse found:false Path ReactEvent.Mouse.pr Path pr +Path CompletionInferValues.pr [{ "label": "ReactEvent.Mouse.preventDefault", "kind": 12, @@ -279,6 +285,7 @@ Path JsxDOM.domProps CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr Path pr +Path CompletionInferValues.pr [{ "label": "JsxEvent.Mouse.preventDefault", "kind": 12, @@ -301,16 +308,7 @@ Path event ContextPath CArgument CJsxPropValue [Div] onMouseEnter($0) 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, - "tags": [], - "detail": "t => unit", - "documentation": null - }] +[] Complete src/CompletionInferValues.res 47:87 posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:11->47:93] @@ -329,6 +327,7 @@ ContextPath Value[JsxEvent, Mouse, button] Path JsxEvent.Mouse.button Path Stdlib.Int.t Path t +Path CompletionInferValues.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -426,6 +425,7 @@ Path String.split Path Stdlib.Array.ma Path ArrayUtils.ma Path ma +Path CompletionInferValues.ma [{ "label": "Array.map", "kind": 12, @@ -465,6 +465,7 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "name", "kind": 5, @@ -504,6 +505,7 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "someRecord", "kind": 5, @@ -537,6 +539,7 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path +Path CompletionInferValues. [{ "label": "name", "kind": 5, @@ -566,6 +569,7 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.String.slic Path slic +Path CompletionInferValues.slic [{ "label": "String.slice", "kind": 12, @@ -595,6 +599,7 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.Int.toS Path toS +Path CompletionInferValues.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -627,6 +632,7 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS Path toS +Path CompletionInferValues.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -660,6 +666,7 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS Path toS +Path CompletionInferValues.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -689,6 +696,7 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic +Path CompletionInferValues.slic [{ "label": "String.slice", "kind": 12, @@ -718,6 +726,7 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic +Path CompletionInferValues.slic [{ "label": "String.slice", "kind": 12, @@ -747,6 +756,7 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic +Path CompletionInferValues.slic [{ "label": "String.slice", "kind": 12, @@ -774,6 +784,7 @@ Path x ContextPath int Path Stdlib.Int.toSt Path toSt +Path CompletionInferValues.toSt [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -835,6 +846,7 @@ Path fn2 CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. Path +Path CompletionInferValues. [{ "label": "ReactDOM.Client.Root.unmount", "kind": 12, @@ -869,6 +881,7 @@ Path fn3 CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path +Path CompletionInferValues. [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -949,6 +962,7 @@ Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:CompletionSupport.Nested found:false Path CompletionSupport.Nested. Path +Path CompletionInferValues. [{ "label": "root", "kind": 5, @@ -977,6 +991,7 @@ Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. Path +Path CompletionInferValues. [{ "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 ed71ec31d9..d07d95aad1 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -8,6 +8,7 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st +Path CompletionJsx.st [{ "label": "String.startsWith", "kind": 12, @@ -38,6 +39,7 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st +Path CompletionJsx.SomeComponent.st [{ "label": "React.string", "kind": 12, @@ -77,6 +79,7 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st +Path CompletionJsx.SomeComponent.st [{ "label": "React.string", "kind": 12, @@ -115,6 +118,7 @@ ContextPath string->st <> ContextPath string Path Stdlib.String.st Path st +Path CompletionJsx.SomeComponent.st [{ "label": "React.string", "kind": 12, @@ -155,6 +159,7 @@ ContextPath Value[String, trim] Path String.trim Path Stdlib.String.st Path st +Path CompletionJsx.SomeComponent.st [{ "label": "React.string", "kind": 12, @@ -194,6 +199,7 @@ ContextPath Value[someInt] Path someInt Path Stdlib.Int. Path +Path CompletionJsx.SomeComponent. [{ "label": "React.int", "kind": 12, @@ -364,6 +370,7 @@ ContextPath int-> <> ContextPath int Path Stdlib.Int. Path +Path CompletionJsx.SomeComponent. [{ "label": "React.int", "kind": 12, @@ -536,6 +543,7 @@ Path someArr Path Stdlib.Array.a Path ArrayUtils.a Path a +Path CompletionJsx.SomeComponent.a [{ "label": "React.array", "kind": 12, @@ -595,13 +603,7 @@ Completable: Cjsx([CompWithoutJsxPpx], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path CompWithoutJsxPpx.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/CompletionJsx.res 48:27 posCursor:[48:27] posNoWhite:[48:26] Found expr:[48:3->48:28] @@ -611,16 +613,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [SomeComponent] someProp Path SomeComponent.make -[{ - "label": "\"\"", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null, - "sortText": "A", - "insertText": "{\"$0\"}", - "insertTextFormat": 2 - }] +[] Complete src/CompletionJsx.res 51:11 posCursor:[51:11] posNoWhite:[51:10] Found expr:[51:3->51:11] @@ -645,25 +638,7 @@ Completable: Cjsx([IntrinsicElementLowercase], "", []) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path IntrinsicElementLowercase.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/CompletionJsx.res 73:36 posCursor:[73:36] posNoWhite:[73:35] Found expr:[73:3->73:41] @@ -673,23 +648,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], - "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, - "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", - "kind": 4, - "tags": [], - "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, - "insertText": "{Later}", - "insertTextFormat": 2 - }] +[] Complete src/CompletionJsx.res 76:36 posCursor:[76:36] posNoWhite:[76:35] Found expr:[76:3->76:40] @@ -699,23 +658,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], - "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, - "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", - "kind": 4, - "tags": [], - "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, - "insertText": "{Later}", - "insertTextFormat": 2 - }] +[] Complete src/CompletionJsx.res 79:28 posCursor:[79:28] posNoWhite:[79:27] Found expr:[79:3->79:32] @@ -725,23 +668,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], - "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, - "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", - "kind": 4, - "tags": [], - "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, - "insertText": "{Later}", - "insertTextFormat": 2 - }] +[] Complete src/CompletionJsx.res 89:26 posCursor:[89:26] posNoWhite:[89:24] Found expr:[89:3->89:27] @@ -750,13 +677,7 @@ Completable: Cjsx([Info], "", [_type]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Info.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/CompletionJsx.res 93:19 posCursor:[93:19] posNoWhite:[93:18] Found expr:[93:11->93:24] @@ -772,6 +693,7 @@ ContextPath string->s <> ContextPath string Path Stdlib.String.s Path s +Path CompletionJsx.s [{ "label": "->React.string", "kind": 12, diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt index 686f4f5ec9..d979a1efad 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt @@ -389,21 +389,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletableComponentLazy] status Path CompletableComponentLazy.make -[{ - "label": "On", - "kind": 4, - "tags": [], - "detail": "On", - "documentation": {"kind": "markdown", "value": "```rescript\nOn\n```\n\n```rescript\ntype status = On | Off\n```"}, - "insertText": "{On}", - "insertTextFormat": 2 - }, { - "label": "Off", - "kind": 4, - "tags": [], - "detail": "Off", - "documentation": {"kind": "markdown", "value": "```rescript\nOff\n```\n\n```rescript\ntype status = On | Off\n```"}, - "insertText": "{Off}", - "insertTextFormat": 2 - }] +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt index cc9888647e..facd6daa7c 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt @@ -15,29 +15,6 @@ Path A. Path B. Path C. Path -[{ - "label": "->B.b", - "kind": 12, - "tags": [], - "detail": "A.a => int", - "documentation": null, - "sortText": "b", - "insertText": "->B.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, - "newText": "" - }] - }, { - "label": "->C.c", - "kind": 12, - "tags": [], - "detail": "A.a => char", - "documentation": null, - "sortText": "c", - "insertText": "->C.c", - "additionalTextEdits": [{ - "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, - "newText": "" - }] - }] +Path CompletionMultipleEditorCompleteFrom. +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index dcf268e218..cba6ca0b05 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -9,23 +9,12 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer. Path +Path CompletionPipeChain. [{ - "label": "Integer.toInt", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "Integer.increment", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "Integer.decrement", + "label": "toFlt", "kind": 12, "tags": [], - "detail": "(t, int => int) => t", + "detail": "Integer.t => SuperFloat.t", "documentation": null }, { "label": "toFlt", @@ -47,13 +36,8 @@ Path toFlt CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. Path -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], - "detail": "t => Integer.t", - "documentation": null - }] +Path CompletionPipeChain. +[] Complete src/CompletionPipeChain.res 33:38 posCursor:[33:38] posNoWhite:[33:37] Found expr:[33:11->0:-1] @@ -64,34 +48,7 @@ ContextPath Value[Integer, increment](Nolabel, Nolabel)-> ContextPath Value[Integer, increment](Nolabel, Nolabel) ContextPath Value[Integer, increment] Path Integer.increment -CPPipe pathFromEnv:Integer found:true -Path Integer. -Path -[{ - "label": "Integer.toInt", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "Integer.increment", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "Integer.decrement", - "kind": 12, - "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 posCursor:[36:38] posNoWhite:[36:37] Found expr:[36:11->0:-1] @@ -102,34 +59,7 @@ ContextPath Value[Integer, increment](Nolabel, Nolabel)-> ContextPath Value[Integer, increment](Nolabel, Nolabel) ContextPath Value[Integer, increment] Path Integer.increment -CPPipe pathFromEnv:Integer found:true -Path Integer. -Path -[{ - "label": "Integer.toInt", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "Integer.increment", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "Integer.decrement", - "kind": 12, - "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 posCursor:[39:47] posNoWhite:[39:46] Found expr:[39:11->0:-1] @@ -140,34 +70,7 @@ ContextPath Value[Integer, decrement](Nolabel, Nolabel)-> ContextPath Value[Integer, decrement](Nolabel, Nolabel) ContextPath Value[Integer, decrement] Path Integer.decrement -CPPipe pathFromEnv:Integer found:true -Path Integer. -Path -[{ - "label": "Integer.toInt", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "Integer.increment", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "Integer.decrement", - "kind": 12, - "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 posCursor:[42:69] posNoWhite:[42:68] Found expr:[42:11->0:-1] @@ -178,34 +81,7 @@ ContextPath Value[Integer, decrement](Nolabel, Nolabel)-> ContextPath Value[Integer, decrement](Nolabel, Nolabel) ContextPath Value[Integer, decrement] Path Integer.decrement -CPPipe pathFromEnv:Integer found:true -Path Integer. -Path -[{ - "label": "Integer.toInt", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "Integer.increment", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "Integer.decrement", - "kind": 12, - "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 posCursor:[45:62] posNoWhite:[45:61] Found expr:[45:11->0:-1] @@ -216,16 +92,7 @@ ContextPath Value[SuperFloat, fromInteger](Nolabel)-> ContextPath Value[SuperFloat, fromInteger](Nolabel) ContextPath Value[SuperFloat, fromInteger] Path SuperFloat.fromInteger -CPPipe pathFromEnv:SuperFloat found:true -Path SuperFloat. -Path -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], - "detail": "t => Integer.t", - "documentation": null - }] +[] Complete src/CompletionPipeChain.res 48:63 posCursor:[48:63] posNoWhite:[48:62] Found expr:[48:11->48:63] @@ -236,16 +103,7 @@ ContextPath Value[SuperFloat, fromInteger](Nolabel)->t ContextPath Value[SuperFloat, fromInteger](Nolabel) ContextPath Value[SuperFloat, fromInteger] Path SuperFloat.fromInteger -CPPipe pathFromEnv:SuperFloat found:true -Path SuperFloat.t -Path t -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], - "detail": "t => Integer.t", - "documentation": null - }] +[] Complete src/CompletionPipeChain.res 51:82 posCursor:[51:82] posNoWhite:[51:81] Found expr:[51:11->0:-1] @@ -259,6 +117,7 @@ Path CompletionSupport.Test.make CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. Path +Path CompletionPipeChain. [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -285,6 +144,7 @@ Path CompletionSupport.Test.addSelf CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. Path +Path CompletionPipeChain. [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -311,6 +171,7 @@ Path Array.forEach CPPipe pathFromEnv: found:true Path Stdlib_Array. Path +Path CompletionPipeChain. [] Complete src/CompletionPipeChain.res 62:6 @@ -324,6 +185,7 @@ ContextPath Value[Belt, Array, reduce] Path Belt.Array.reduce Path Stdlib.Int.t Path t +Path CompletionPipeChain.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -397,6 +259,7 @@ Path aliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path +Path CompletionPipeChain. [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -422,6 +285,7 @@ Path notAliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path +Path CompletionPipeChain. [{ "label": "CompletionSupport.Test.add", "kind": 12, @@ -457,6 +321,7 @@ Path props CPPipe pathFromEnv:CompletionSupport2.Internal found:false Path CompletionSupport2.Internal.support Path support +Path CompletionPipeChain.support ContextPath Value[props].support->root ContextPath Value[props].support ContextPath Value[props] @@ -467,12 +332,15 @@ Path props CPPipe pathFromEnv:CompletionSupport2.Internal found:false Path CompletionSupport2.Internal.support Path support +Path CompletionPipeChain.support CPPipe pathFromEnv:CompletionSupport.Nested found:false Path CompletionSupport.Nested.root Path root +Path CompletionPipeChain.root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren Path ren +Path CompletionPipeChain.ren [{ "label": "ReactDOM.Client.Root.render", "kind": 12, @@ -499,6 +367,7 @@ Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren Path ren +Path CompletionPipeChain.ren [{ "label": "ReactDOM.Client.Root.render", "kind": 12, @@ -521,23 +390,12 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer. Path +Path CompletionPipeChain. [{ - "label": "Integer.toInt", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "Integer.increment", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "Integer.decrement", + "label": "toFlt", "kind": 12, "tags": [], - "detail": "(t, int => int) => t", + "detail": "Integer.t => SuperFloat.t", "documentation": null }, { "label": "toFlt", @@ -560,11 +418,12 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer.t Path t +Path CompletionPipeChain.t [{ - "label": "Integer.toInt", + "label": "toFlt", "kind": 12, "tags": [], - "detail": "t => int", + "detail": "Integer.t => SuperFloat.t", "documentation": null }, { "label": "toFlt", @@ -584,6 +443,7 @@ ContextPath Value[r] Path r Path Stdlib.RegExp.la Path la +Path CompletionPipeChain.la [{ "label": "RegExp.lastIndex", "kind": 12, @@ -603,11 +463,6 @@ Path xx CPPipe pathFromEnv:Xyz found:true Path Xyz. Path -[{ - "label": "Xyz.do", - "kind": 12, - "tags": [], - "detail": "xx => string", - "documentation": null - }] +Path CompletionPipeChain. +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt index 29d9652878..12cdc5e890 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt @@ -14,6 +14,7 @@ Path sprite CPPipe pathFromEnv:Sprite found:true Path Sprite.anchor Path anchor +Path CompletionPipeProperty.anchor ContextPath Value[sprite].anchor-> ContextPath Value[sprite].anchor ContextPath Value[sprite] @@ -24,9 +25,11 @@ Path sprite CPPipe pathFromEnv:Sprite found:true Path Sprite.anchor Path anchor +Path CompletionPipeProperty.anchor CPPipe pathFromEnv:ObservablePoint found:true Path ObservablePoint. Path +Path CompletionPipeProperty. [{ "label": "x", "kind": 5, @@ -39,29 +42,5 @@ Path "tags": [], "detail": "int", "documentation": {"kind": "markdown", "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} - }, { - "label": "->ObservablePoint.setBoth", - "kind": 12, - "tags": [], - "detail": "(op, float) => unit", - "documentation": null, - "sortText": "setBoth", - "insertText": "->ObservablePoint.setBoth", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, - "newText": "" - }] - }, { - "label": "->ObservablePoint.set", - "kind": 12, - "tags": [], - "detail": "(op, float, float) => unit", - "documentation": null, - "sortText": "set", - "insertText": "->ObservablePoint.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, - "newText": "" - }] }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt index 6669a1e770..f2e1ecf285 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt @@ -6,16 +6,7 @@ Resolved opens 1 Stdlib ContextPath Value[A, B1, xx]-> 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, - "tags": [], - "detail": "b1 => string", - "documentation": null - }] +[] Complete src/CompletionPipeSubmodules.res 17:18 posCursor:[17:18] posNoWhite:[17:17] Found expr:[17:11->21:8] @@ -26,22 +17,7 @@ ContextPath Value[A, x].v-> ContextPath Value[A, x].v ContextPath Value[A, x] Path A.x -ContextPath Value[A, x]->v -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, - "tags": [], - "detail": "b1 => string", - "documentation": null - }] +[] Complete src/CompletionPipeSubmodules.res 41:20 posCursor:[41:20] posNoWhite:[41:19] Found expr:[41:11->0:-1] @@ -53,35 +29,7 @@ ContextPath Value[E, e].v.v ContextPath Value[E, e].v ContextPath Value[E, e] Path E.e -ContextPath Value[E, e]->v -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] -Path E.e -ContextPath Value[E, e]->v -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, - "tags": [], - "detail": "t => string", - "documentation": null - }] +[] Complete src/CompletionPipeSubmodules.res 45:21 posCursor:[45:21] posNoWhite:[45:20] Found expr:[45:11->0:-1] @@ -93,33 +41,5 @@ ContextPath Value[E, e].v.v2 ContextPath Value[E, e].v ContextPath Value[E, e] Path E.e -ContextPath Value[E, e]->v -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] -Path E.e -ContextPath Value[E, e]->v -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, - "tags": [], - "detail": "t2 => string", - "documentation": null - }] +[] diff --git a/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt b/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt index 053f84b1d0..85f49f5ca9 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt @@ -8,6 +8,7 @@ ContextPath Value[emailPattern] Path emailPattern Path Stdlib.RegExp. Path +Path CompletionRegexp. [{ "label": "RegExp.lastIndex", "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 2cfc84238d..adc4226230 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt @@ -13,43 +13,8 @@ Path w CPPipe pathFromEnv:M found:true Path M. Path -[{ - "label": "->M.xyz", - "kind": 12, - "tags": [], - "detail": "(t, int) => int", - "documentation": null, - "sortText": "xyz", - "insertText": "->M.xyz", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }, { - "label": "->M.b", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null, - "sortText": "b", - "insertText": "->M.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }, { - "label": "->M.a", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null, - "sortText": "a", - "insertText": "->M.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }] +Path CompletionTaggedTemplate. +[] Complete src/CompletionTaggedTemplate.res 16:20 posCursor:[16:20] posNoWhite:[16:19] Found expr:[16:11->0:-1] @@ -67,41 +32,6 @@ Path meh CPPipe pathFromEnv:M found:true Path M. Path -[{ - "label": "->M.xyz", - "kind": 12, - "tags": [], - "detail": "(t, int) => int", - "documentation": null, - "sortText": "xyz", - "insertText": "->M.xyz", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }, { - "label": "->M.b", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null, - "sortText": "b", - "insertText": "->M.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }, { - "label": "->M.a", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null, - "sortText": "a", - "insertText": "->M.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }] +Path CompletionTaggedTemplate. +[] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt index 70f6773fec..802d74c4d9 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt @@ -16,6 +16,7 @@ Path x CPPipe pathFromEnv:X found:true Path X. Path +Path DotPipeCompleteFromCurrentModule.Y. [{ "label": "->z", "kind": 12, @@ -28,5 +29,117 @@ Path "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, "newText": "" }] + }, { + "label": "->Y.b", + "kind": 12, + "tags": [], + "detail": "X.t => int", + "documentation": null, + "sortText": "b", + "insertText": "->Y.b", + "additionalTextEdits": [{ + "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, + "newText": "" + }] + }, { + "label": "->Y.z", + "kind": 12, + "tags": [], + "detail": "X.t => string", + "documentation": null, + "sortText": "z", + "insertText": "->Y.z", + "additionalTextEdits": [{ + "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, + "newText": "" + }] + }, { + "label": "->Y.a", + "kind": 12, + "tags": [], + "detail": "X.t => unit", + "documentation": null, + "sortText": "a", + "insertText": "->Y.a", + "additionalTextEdits": [{ + "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, + "newText": "" + }] + }] + +Complete src/DotPipeCompleteFromCurrentModule.res 59:17 +posCursor:[59:17] posNoWhite:[59:16] Found expr:[57:15->62:5] +posCursor:[59:17] posNoWhite:[59:16] Found expr:[58:8->61:9] +posCursor:[59:17] posNoWhite:[59:16] Found expr:[59:15->59:17] +Pexp_field [59:15->59:16] _:[61:8->59:17] +Completable: Cpath Value[k]."" +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib +ContextPath Value[k]."" +ContextPath Value[k] +Path k +ContextPath Value[k]-> +ContextPath Value[k] +Path k +CPPipe pathFromEnv:Types found:true +Path Types. +Path +Path DotPipeCompleteFromCurrentModule.Wall. +[{ + "label": "->Wall.addPos", + "kind": 12, + "tags": [], + "detail": "(Types.context, float, float) => Types.comp", + "documentation": null, + "sortText": "addPos", + "insertText": "->Wall.addPos", + "additionalTextEdits": [{ + "range": {"start": {"line": 59, "character": 16}, "end": {"line": 59, "character": 17}}, + "newText": "" + }] + }, { + "label": "->Wall.addPosFromVec2", + "kind": 12, + "tags": [], + "detail": "(Types.context, Types.vec2) => Types.comp", + "documentation": null, + "sortText": "addPosFromVec2", + "insertText": "->Wall.addPosFromVec2", + "additionalTextEdits": [{ + "range": {"start": {"line": 59, "character": 16}, "end": {"line": 59, "character": 17}}, + "newText": "" + }] + }] + +Complete src/DotPipeCompleteFromCurrentModule.res 71:21 +posCursor:[71:21] posNoWhite:[71:20] Found expr:[69:19->74:9] +posCursor:[71:21] posNoWhite:[71:20] Found expr:[70:12->73:13] +posCursor:[71:21] posNoWhite:[71:20] Found expr:[71:19->71:21] +Pexp_field [71:19->71:20] _:[73:12->71:21] +Completable: Cpath Value[k]."" +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib +ContextPath Value[k]."" +ContextPath Value[k] +Path k +ContextPath Value[k]-> +ContextPath Value[k] +Path k +CPPipe pathFromEnv:Types found:true +Path Types. +Path +Path DotPipeCompleteFromCurrentModule.Wall.Poster. +[{ + "label": "->Wall.Poster.addSprite", + "kind": 12, + "tags": [], + "detail": "(Types.context, string) => Types.comp", + "documentation": null, + "sortText": "addSprite", + "insertText": "->Wall.Poster.addSprite", + "additionalTextEdits": [{ + "range": {"start": {"line": 71, "character": 20}, "end": {"line": 71, "character": 21}}, + "newText": "" + }] }] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index 8db5129032..723a1059ba 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -13,36 +13,13 @@ Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. Path +Path DotPipeCompletionSpec. [{ "label": "name", "kind": 5, "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->SomeModule.withUnlabelledArgumentNotFirst", - "kind": 12, - "tags": [], - "detail": "(~name: string=?, t) => unit", - "documentation": null, - "sortText": "withUnlabelledArgumentNotFirst", - "insertText": "->SomeModule.withUnlabelledArgumentNotFirst", - "additionalTextEdits": [{ - "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, - "newText": "" - }] - }, { - "label": "->SomeModule.getName", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null, - "sortText": "getName", - "insertText": "->SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, - "newText": "" - }] }] Complete src/DotPipeCompletionSpec.res 44:6 @@ -62,12 +39,25 @@ Path SomeOtherModule. Path DotPipeCompletionSpec.CompleteFromThisToo. Path DotPipeCompletionSpec.SomeOtherModule. Path +Path DotPipeCompletionSpec. [{ "label": "nname", "kind": 5, "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} + }, { + "label": "->CompleteFromThisToo.a", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => string", + "documentation": null, + "sortText": "a", + "insertText": "->CompleteFromThisToo.a", + "additionalTextEdits": [{ + "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, + "newText": "" + }] }, { "label": "->SomeOtherModule.getNName", "kind": 12, @@ -93,49 +83,49 @@ Path "newText": "" }] }, { - "label": "->CompleteFromThisToo.a", + "label": "->doWithTypeOutsideModule", "kind": 12, "tags": [], "detail": "typeOutsideModule => string", "documentation": null, - "sortText": "a", - "insertText": "->CompleteFromThisToo.a", + "sortText": "doWithTypeOutsideModule", + "insertText": "->doWithTypeOutsideModule", "additionalTextEdits": [{ "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, "newText": "" }] }, { - "label": "->SomeOtherModule.getNName", + "label": "->outOfScope", "kind": 12, "tags": [], - "detail": "t => string", + "detail": "typeOutsideModule => typeOutsideModule", "documentation": null, - "sortText": "getNName", - "insertText": "->SomeOtherModule.getNName", + "sortText": "outOfScope", + "insertText": "->outOfScope", "additionalTextEdits": [{ "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, "newText": "" }] }, { - "label": "->SomeOtherModule.getNName2", + "label": "->doWithTypeOutsideModule", "kind": 12, "tags": [], "detail": "typeOutsideModule => string", "documentation": null, - "sortText": "getNName2", - "insertText": "->SomeOtherModule.getNName2", + "sortText": "doWithTypeOutsideModule", + "insertText": "->doWithTypeOutsideModule", "additionalTextEdits": [{ "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, "newText": "" }] }, { - "label": "->doWithTypeOutsideModule", + "label": "->cc", "kind": 12, "tags": [], - "detail": "typeOutsideModule => string", + "detail": "typeOutsideModule => typeOutsideModule", "documentation": null, - "sortText": "doWithTypeOutsideModule", - "insertText": "->doWithTypeOutsideModule", + "sortText": "cc", + "insertText": "->cc", "additionalTextEdits": [{ "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, "newText": "" @@ -158,31 +148,8 @@ CPPipe pathFromEnv:A found:true Path A. Path B. Path -[{ - "label": "->A.withA", - "kind": 12, - "tags": [], - "detail": "a => unit", - "documentation": null, - "sortText": "withA", - "insertText": "->A.withA", - "additionalTextEdits": [{ - "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, - "newText": "" - }] - }, { - "label": "->B.b", - "kind": 12, - "tags": [], - "detail": "A.a => int", - "documentation": null, - "sortText": "b", - "insertText": "->B.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, - "newText": "" - }] - }] +Path DotPipeCompletionSpec. +[] Complete src/DotPipeCompletionSpec.res 67:6 posCursor:[67:6] posNoWhite:[67:5] Found expr:[67:3->67:6] @@ -199,6 +166,7 @@ Path xx CPPipe pathFromEnv:CompletionFromModule.SomeModule found:false Path CompletionFromModule.SomeModule. Path +Path DotPipeCompletionSpec. [{ "label": "name", "kind": 5, @@ -234,6 +202,7 @@ Path ffff Path Stdlib.Array.u Path ArrayUtils.u Path u +Path DotPipeCompletionSpec.u [{ "label": "->Array.unshiftMany", "kind": 12, @@ -288,6 +257,7 @@ CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. Path +Path DotPipeCompletionSpec. [{ "label": "nname", "kind": 5, @@ -342,6 +312,42 @@ Path "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, "newText": "" }] + }, { + "label": "->outOfScope", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => typeOutsideModule", + "documentation": null, + "sortText": "outOfScope", + "insertText": "->outOfScope", + "additionalTextEdits": [{ + "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": "" + }] + }, { + "label": "->cc", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => typeOutsideModule", + "documentation": null, + "sortText": "cc", + "insertText": "->cc", + "additionalTextEdits": [{ + "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, + "newText": "" + }] }] Complete src/DotPipeCompletionSpec.res 86:39 @@ -362,6 +368,7 @@ Path Array.filter Path Stdlib.Array.filt Path ArrayUtils.filt Path filt +Path DotPipeCompletionSpec.filt [{ "label": "->Array.filterMap", "kind": 12, @@ -417,6 +424,7 @@ ContextPath Value[Array, joinWith] Path Array.joinWith Path Stdlib.String.includ Path includ +Path DotPipeCompletionSpec.includ [{ "label": "->String.includes", "kind": 12, @@ -459,6 +467,7 @@ ContextPath Value[String, toLowerCase] Path String.toLowerCase Path Stdlib.String.toUpperCa Path toUpperCa +Path DotPipeCompletionSpec.toUpperCa [{ "label": "->String.toUpperCase", "kind": 12, @@ -489,6 +498,7 @@ ContextPath Value[String, toUpperCase] Path String.toUpperCase Path Stdlib.String.toLowerC Path toLowerC +Path DotPipeCompletionSpec.toLowerC [{ "label": "->String.toLowerCase", "kind": 12, @@ -520,6 +530,7 @@ CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. Path +Path DotPipeCompletionSpec. [{ "label": "nname", "kind": 5, @@ -574,6 +585,42 @@ Path "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, "newText": "" }] + }, { + "label": "->outOfScope", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => typeOutsideModule", + "documentation": null, + "sortText": "outOfScope", + "insertText": "->outOfScope", + "additionalTextEdits": [{ + "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": "" + }] + }, { + "label": "->cc", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => typeOutsideModule", + "documentation": null, + "sortText": "cc", + "insertText": "->cc", + "additionalTextEdits": [{ + "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, + "newText": "" + }] }] Complete src/DotPipeCompletionSpec.res 108:27 @@ -754,6 +801,7 @@ CPPipe pathFromEnv:DOMAPI found:true Path DOMAPI. Path DotPipeCompletionSpec.HTMLButtonElement. Path +Path DotPipeCompletionSpec. [{ "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 2d5586d1f2..8212b3632d 100644 --- a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt +++ b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt @@ -106,6 +106,7 @@ Path x CPPipe pathFromEnv: found:true Path ExhaustiveSwitch. Path +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 17105d12f4..40ba88facc 100644 --- a/tests/analysis_tests/tests/src/expected/Firebase.res.txt +++ b/tests/analysis_tests/tests/src/expected/Firebase.res.txt @@ -14,6 +14,7 @@ Path ref CPPipe pathFromEnv:Firebase.Firestore found:true Path Firebase.Firestore. Path +Path Firebase.Sample. [{ "label": "id", "kind": 5, @@ -26,17 +27,5 @@ Path "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} - }, { - "label": "->Firestore.getDoc", - "kind": 12, - "tags": [], - "detail": "documentReference<\n 'documentdata,\n> => Promise.t>", - "documentation": null, - "sortText": "getDoc", - "insertText": "->Firestore.getDoc", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 8}, "end": {"line": 30, "character": 9}}, - "newText": "" - }] }] diff --git a/tests/analysis_tests/tests/src/expected/Hover.res.txt b/tests/analysis_tests/tests/src/expected/Hover.res.txt index bf4f292975..d16f77123e 100644 --- a/tests/analysis_tests/tests/src/expected/Hover.res.txt +++ b/tests/analysis_tests/tests/src/expected/Hover.res.txt @@ -120,6 +120,7 @@ Path x1 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content ContextPath Value[x1].content-> ContextPath Value[x1].content ContextPath Value[x1] @@ -130,9 +131,11 @@ Path x1 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content CPPipe pathFromEnv: found:true Path Hover. Path +Path Hover.TypeSubstitutionRecords. [{ "label": "age", "kind": 5, @@ -157,6 +160,7 @@ Path x2 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content ContextPath Value[x2].content-> ContextPath Value[x2].content ContextPath Value[x2] @@ -167,9 +171,11 @@ Path x2 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content CPPipe pathFromEnv: found:true Path Hover. Path +Path Hover.TypeSubstitutionRecords. [{ "label": "age", "kind": 5, @@ -194,6 +200,7 @@ Path y1 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content ContextPath Value[y1].content-> ContextPath Value[y1].content ContextPath Value[y1] @@ -204,9 +211,11 @@ Path y1 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content CPPipe pathFromEnv: found:true Path Hover. Path +Path Hover.TypeSubstitutionRecords. [{ "label": "age", "kind": 5, @@ -231,6 +240,7 @@ Path y2 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content ContextPath Value[y2].content-> ContextPath Value[y2].content ContextPath Value[y2] @@ -241,9 +251,11 @@ Path y2 CPPipe pathFromEnv: found:true Path Hover.content Path content +Path Hover.TypeSubstitutionRecords.content CPPipe pathFromEnv: found:true Path Hover. Path +Path Hover.TypeSubstitutionRecords. [{ "label": "age", "kind": 5, @@ -293,6 +305,7 @@ Path x CPPipe pathFromEnv: found:true Path Hover.someField Path someField +Path Hover.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/Jsx2.res.txt b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt index 66920cb633..9dfb1a6edf 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt @@ -18,19 +18,7 @@ Completable: Cjsx([M], f, [second, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "first", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "fun", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[] Complete src/Jsx2.res 14:13 posCursor:[14:13] posNoWhite:[14:12] Found expr:[14:11->14:13] @@ -41,12 +29,6 @@ Resolved opens 1 Stdlib ContextPath Module[M] Path M [{ - "label": "M", - "kind": 9, - "tags": [], - "detail": "module M", - "documentation": null - }, { "label": "Math", "kind": 9, "tags": [], @@ -77,13 +59,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 25:17 posCursor:[25:17] posNoWhite:[25:16] Found expr:[25:3->25:17] @@ -92,13 +68,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 28:21 posCursor:[28:21] posNoWhite:[28:20] Found expr:[28:3->28:21] @@ -107,13 +77,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 31:24 posCursor:[31:24] posNoWhite:[31:23] Found expr:[31:3->31:24] @@ -122,13 +86,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 34:18 posCursor:[34:18] posNoWhite:[34:17] Found expr:[34:3->34:18] @@ -137,13 +95,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 37:16 posCursor:[37:16] posNoWhite:[37:15] Found expr:[37:3->37:16] @@ -152,13 +104,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 40:17 posCursor:[40:17] posNoWhite:[40:16] Found expr:[40:3->40:17] @@ -167,13 +113,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 43:18 posCursor:[43:18] posNoWhite:[43:17] Found expr:[43:3->43:18] @@ -182,13 +122,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 46:16 posCursor:[46:16] posNoWhite:[46:15] Found expr:[46:3->46:16] @@ -197,13 +131,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 49:27 posCursor:[49:27] posNoWhite:[49:26] Found expr:[49:3->49:27] @@ -212,13 +140,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 52:38 posCursor:[52:38] posNoWhite:[52:37] Found expr:[52:3->52:38] @@ -227,13 +149,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 55:25 posCursor:[55:25] posNoWhite:[55:24] Found expr:[55:3->55:25] @@ -242,13 +158,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Definition src/Jsx2.res 58:11 {"uri": "Component.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}} @@ -260,13 +170,7 @@ Completable: Cjsx([Ext], al, [al]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Ext.make -[{ - "label": "align", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[] Complete src/Jsx2.res 71:11 posCursor:[71:11] posNoWhite:[71:10] Found expr:[71:3->71:11] @@ -284,13 +188,7 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 77:23 posCursor:[77:23] posNoWhite:[77:22] Found expr:[77:3->77:23] @@ -299,13 +197,7 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 80:6 posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:3->85:69] @@ -324,13 +216,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[{ - "label": "WithChildren", - "kind": 9, - "tags": [], - "detail": "module WithChildren", - "documentation": null - }] +[] Complete src/Jsx2.res 91:18 posCursor:[91:18] posNoWhite:[91:17] Found expr:[91:3->91:18] @@ -339,13 +225,7 @@ Completable: Cjsx([WithChildren], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path WithChildren.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[] Complete src/Jsx2.res 94:18 posCursor:[94:18] posNoWhite:[94:17] Found pattern:[94:7->94:18] @@ -396,13 +276,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[DefineSomeFields, ""] Path DefineSomeFields. -[{ - "label": "thisValue", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Jsx2.res 108:36 posCursor:[108:36] posNoWhite:[108:35] Found expr:[108:11->108:36] @@ -414,19 +288,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[DefineSomeFields].th Path DefineSomeFields.th -[{ - "label": "thisField", - "kind": 5, - "tags": [], - "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nthisField: int\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} - }, { - "label": "thatField", - "kind": 5, - "tags": [], - "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nthatField: string\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} - }] +[] Complete src/Jsx2.res 122:20 posCursor:[122:20] posNoWhite:[122:19] Found expr:[121:2->125:4] @@ -438,13 +300,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, h] Path Outer.Inner.h -[{ - "label": "hello", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Jsx2.res 129:19 posCursor:[129:19] posNoWhite:[129:18] Found expr:[128:2->131:9] @@ -456,13 +312,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, ""] Path Outer.Inner. -[{ - "label": "hello", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[] Complete src/Jsx2.res 136:7 posCursor:[136:7] posNoWhite:[136:6] Found expr:[135:2->138:9] @@ -492,13 +342,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, Co] Path Nested.Co -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[] Complete src/Jsx2.res 153:19 posCursor:[153:19] posNoWhite:[153:18] Found expr:[153:11->153:25] @@ -508,13 +352,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, ""] Path Nested. -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[] Hover src/Jsx2.res 162:12 {"contents": {"kind": "markdown", "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n"}} diff --git a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt index ba54c5d047..e0baee3911 100644 --- a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt +++ b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt @@ -8,13 +8,7 @@ Completable: Cjsx([M4], f, [first, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M4.make -[{ - "label": "fun", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[] Hover src/JsxV4.res 14:9 {"contents": {"kind": "markdown", "value": "```rescript\nReact.component>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C12%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n\n---\n Doc Comment For M4 "}} diff --git a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt index c417c15932..b2e3884c3d 100644 --- a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt +++ b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt @@ -27,6 +27,7 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.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```"}} @@ -48,6 +49,7 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.extra ContextPath Value[options].extra->superExtra ContextPath Value[options].extra ContextPath Value[options] @@ -58,9 +60,11 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.extra CPPipe pathFromEnv: found:true Path NestedRecords.superExtra Path superExtra +Path NestedRecords.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```"}} @@ -83,6 +87,7 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.extra ContextPath Value[options].extra->superExtra ContextPath Value[options].extra ContextPath Value[options] @@ -93,9 +98,11 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.extra CPPipe pathFromEnv: found:true Path NestedRecords.superExtra Path superExtra +Path NestedRecords.superExtra ContextPath Value[options].extra.superExtra->age ContextPath Value[options].extra.superExtra ContextPath Value[options].extra @@ -107,6 +114,7 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.extra ContextPath Value[options].extra->superExtra ContextPath Value[options].extra ContextPath Value[options] @@ -117,12 +125,15 @@ Path options CPPipe pathFromEnv: found:true Path NestedRecords.extra Path extra +Path NestedRecords.extra CPPipe pathFromEnv: found:true Path NestedRecords.superExtra Path superExtra +Path NestedRecords.superExtra CPPipe pathFromEnv: found:true Path NestedRecords.age Path age +Path NestedRecords.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/RecordCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt index bef7e1df39..ea19225246 100644 --- a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt @@ -13,9 +13,11 @@ Path t CPPipe pathFromEnv: found:true Path RecordCompletion.n Path n +Path RecordCompletion.n Path Stdlib.Array.m Path ArrayUtils.m Path m +Path RecordCompletion.m [{ "label": "Array.map", "kind": 12, @@ -46,6 +48,7 @@ Path t2 CPPipe pathFromEnv: found:true Path RecordCompletion.n2 Path n2 +Path RecordCompletion.n2 ContextPath Value[t2].n2->n ContextPath Value[t2].n2 ContextPath Value[t2] @@ -56,12 +59,15 @@ Path t2 CPPipe pathFromEnv: found:true Path RecordCompletion.n2 Path n2 +Path RecordCompletion.n2 CPPipe pathFromEnv: found:true Path RecordCompletion.n Path n +Path RecordCompletion.n Path Stdlib.Array.m Path ArrayUtils.m Path m +Path RecordCompletion.m [{ "label": "Array.map", "kind": 12, @@ -84,13 +90,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[{ - "label": "name", - "kind": 5, - "tags": [], - "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }] +[] Complete src/RecordCompletion.res 22:7 posCursor:[22:7] posNoWhite:[22:6] Found expr:[22:3->22:10] @@ -100,11 +100,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[{ - "label": "name", - "kind": 5, - "tags": [], - "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }] +[] diff --git a/tests/analysis_tests/tests/src/expected/Reprod.res.txt b/tests/analysis_tests/tests/src/expected/Reprod.res.txt index 08783543a5..9f96ca0a76 100644 --- a/tests/analysis_tests/tests/src/expected/Reprod.res.txt +++ b/tests/analysis_tests/tests/src/expected/Reprod.res.txt @@ -7,16 +7,7 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Query, use](~variables) ContextPath Value[Query, use] Path Query.use -[{ - "label": "{}", - "kind": 12, - "tags": [], - "detail": "input_ByAddress", - "documentation": {"kind": "markdown", "value": "```rescript\ntype input_ByAddress = {city: string}\n```"}, - "sortText": "A", - "insertText": "{$0}", - "insertTextFormat": 2 - }] +[] Complete src/Reprod.res 33:28 posCursor:[33:28] posNoWhite:[33:27] Found pattern:[33:21->33:31] diff --git a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt index 9ab09fb999..4390165da8 100644 --- a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt @@ -22,6 +22,7 @@ CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. Path +Path RxjsCompletion. [{ "label": "->Observable.subscribe", "kind": 12, @@ -105,6 +106,7 @@ CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. Path +Path RxjsCompletion. [{ "label": "->Rxjs.Observable.subscribe", "kind": 12, From aeaf2d412ea9ac2b27a8d7f7f99297d82e88af46 Mon Sep 17 00:00:00 2001 From: nojaf Date: Fri, 23 May 2025 17:56:50 +0200 Subject: [PATCH 2/2] Enable currentFullyQualifiedPathModuleCompletions --- analysis/src/CompletionBackEnd.ml | 5 +- .../src/expected/CompletePrioritize1.res.txt | 8 +- .../src/expected/CompletePrioritize2.res.txt | 8 +- .../tests/src/expected/Completion.res.txt | 364 ++++++++++++++++-- .../src/expected/CompletionFromModule.res.txt | 44 ++- .../CompletionFunctionArguments.res.txt | 20 +- .../expected/CompletionInferValues.res.txt | 12 +- .../tests/src/expected/CompletionJsx.res.txt | 101 ++++- .../src/expected/CompletionJsxProps.res.txt | 18 +- ...mpletionMultipleEditorCompleteFrom.res.txt | 26 +- .../src/expected/CompletionPipeChain.res.txt | 226 ++++++++++- .../expected/CompletionPipeProperty.res.txt | 24 ++ .../expected/CompletionPipeSubmodules.res.txt | 99 ++++- .../expected/CompletionTaggedTemplate.res.txt | 76 +++- .../expected/DotPipeCompletionSpec.res.txt | 74 +++- .../tests/src/expected/Firebase.res.txt | 12 + .../tests/src/expected/Jsx2.res.txt | 210 ++++++++-- .../tests/src/expected/JsxV4.res.txt | 8 +- .../src/expected/RecordCompletion.res.txt | 16 +- .../tests/src/expected/Reprod.res.txt | 11 +- 20 files changed, 1275 insertions(+), 87 deletions(-) diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 3c56e5f5f9..76d20e1cdd 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -1184,12 +1184,11 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact in (* Add completions from current fully qualified path module *) let currentFullyQualifiedPathModuleCompletions = - [] - (* completionsForPipeFromCompletionPath ~envCompletionIsMadeFrom + completionsForPipeFromCompletionPath ~envCompletionIsMadeFrom ~opens:[] ~pos ~scope ~debug ~prefix ~env ~rawOpens ~full cursorPath |> TypeUtils.filterPipeableFunctions ~synthetic:true ~env ~full - ~targetTypeId:mainTypeId *) + ~targetTypeId:mainTypeId in jsxCompletions @ pipeCompletions @ extraCompletions @ currentModuleCompletions @ globallyConfiguredCompletions diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt index 12219e3ab4..d372bd7537 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt @@ -10,5 +10,11 @@ CPPipe pathFromEnv:Test found:true Path Test. Path Path CompletePrioritize1. -[] +[{ + "label": "Test.name", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt index 4ccbd43869..2edc8b0cca 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt @@ -10,7 +10,13 @@ CPPipe pathFromEnv:Test found:true Path Test. Path Path CompletePrioritize2. -[] +[{ + "label": "Test.add", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }] Complete src/CompletePrioritize2.res 12:5 posCursor:[12:5] posNoWhite:[12:4] Found expr:[12:3->12:5] diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index f4f52e4ba5..006084d5e6 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -6,7 +6,37 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[MyList, m] Path MyList.m -[] +[{ + "label": "mapReverse", + "kind": 12, + "tags": [], + "detail": "(list<'a>, 'a => 'b) => list<'b>", + "documentation": {"kind": "markdown", "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n"} + }, { + "label": "mapReverse2", + "kind": 12, + "tags": [], + "detail": "(list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>", + "documentation": {"kind": "markdown", "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nassertEqual(List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b), list{4, 2})\n```\n"} + }, { + "label": "make", + "kind": 12, + "tags": [], + "detail": "(~length: int, 'a) => list<'a>", + "documentation": {"kind": "markdown", "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nassertEqual(List.make(~length=3, 1), list{1, 1, 1})\n```\n"} + }, { + "label": "mapWithIndex", + "kind": 12, + "tags": [], + "detail": "(list<'a>, ('a, int) => 'b) => list<'b>", + "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->List.mapWithIndex((x, index) => index + x), list{1, 3, 5})\n```\n"} + }, { + "label": "map", + "kind": 12, + "tags": [], + "detail": "(list<'a>, 'a => 'b) => list<'b>", + "documentation": {"kind": "markdown", "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2}->List.map(x => x + 1), list{2, 3})\n```\n"} + }] Complete src/Completion.res 3:9 posCursor:[3:9] posNoWhite:[3:8] Found expr:[3:3->3:9] @@ -594,7 +624,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Dep, c] Path Dep.c -[] +[{ + "label": "customDouble", + "kind": 12, + "tags": [1], + "detail": "int => int", + "documentation": {"kind": "markdown", "value": "Deprecated: Use customDouble instead\n\nSome doc comment"} + }] Complete src/Completion.res 23:20 posCursor:[23:20] posNoWhite:[23:19] Found expr:[23:11->23:20] @@ -604,7 +640,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -[] +Found type for function (~age: int, ~name: string) => string +[{ + "label": "age", + "kind": 4, + "tags": [], + "detail": "int", + "documentation": null + }, { + "label": "name", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Completion.res 26:13 posCursor:[26:13] posNoWhite:[26:12] Found expr:[26:3->26:13] @@ -683,6 +732,18 @@ Path ForAuto. Path Path Completion. [{ + "label": "ForAuto.abc", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "ForAuto.abd", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { "label": "myAmazingFunction", "kind": 12, "tags": [], @@ -723,7 +784,13 @@ Completable: Cjsx([O, Comp], z, [z]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path O.Comp.make -[] +[{ + "label": "zoo", + "kind": 4, + "tags": [], + "detail": "option", + "documentation": null + }] Complete src/Completion.res 65:8 Attribute id:reac:[65:3->65:8] label:reac @@ -763,7 +830,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -[] +Found type for function (~age: int, ~name: string) => string +[{ + "label": "age", + "kind": 4, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Completion.res 74:26 posCursor:[74:26] posNoWhite:[74:25] Found expr:[74:11->74:26] @@ -773,7 +847,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -[] +Found type for function (~age: int, ~name: string) => string +[{ + "label": "name", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Completion.res 77:32 posCursor:[77:32] posNoWhite:[77:31] Found expr:[77:11->77:32] @@ -783,7 +864,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo -[] +Found type for function (~age: int, ~name: string) => string +[{ + "label": "name", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Completion.res 82:5 posCursor:[82:5] posNoWhite:[82:4] Found expr:[80:8->86:1] @@ -793,6 +881,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo +Found type for function (~age: int, ~name: string) => string [] Complete src/Completion.res 90:13 @@ -988,7 +1077,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[O, ""] Path O. -[] +[{ + "label": "Comp", + "kind": 9, + "tags": [], + "detail": "module Comp", + "documentation": null + }] Complete src/Completion.res 157:8 posCursor:[157:8] posNoWhite:[157:7] Found expr:[157:3->157:8] @@ -1100,7 +1195,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[] +[{ + "label": "WithChildren", + "kind": 9, + "tags": [], + "detail": "module WithChildren", + "documentation": null + }] Complete src/Completion.res 172:17 posCursor:[172:17] posNoWhite:[172:16] Found type:[172:12->172:17] @@ -1126,7 +1227,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[ForAuto, ""] Path ForAuto. -[] +[{ + "label": "t", + "kind": 22, + "tags": [], + "detail": "type t", + "documentation": {"kind": "markdown", "value": "```rescript\ntype t = int\n```"} + }] Complete src/Completion.res 179:13 posCursor:[179:13] posNoWhite:[179:12] Found expr:[179:11->179:13] @@ -1157,7 +1264,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[For] Path For -[] +[{ + "label": "ForAuto", + "kind": 9, + "tags": [], + "detail": "module ForAuto", + "documentation": null + }] Complete src/Completion.res 190:11 posCursor:[190:11] posNoWhite:[190:10] Found expr:[190:3->190:11] @@ -1167,7 +1280,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Private, ""] Path Private. -[] +[{ + "label": "b", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Completion.res 202:6 posCursor:[202:6] posNoWhite:[202:5] Found expr:[202:3->202:6] @@ -1223,7 +1342,19 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[] +[{ + "label": "age", + "kind": 4, + "tags": [], + "detail": "int", + "documentation": null + }, { + "label": "forAutoLabel", + "kind": 4, + "tags": [], + "detail": "FAR.forAutoRecord", + "documentation": null + }] Complete src/Completion.res 224:37 posCursor:[224:37] posNoWhite:[224:36] Found expr:[224:3->224:37] @@ -1236,7 +1367,27 @@ ContextPath Value[FAO, forAutoObject]["forAutoLabel"]."" ContextPath Value[FAO, forAutoObject]["forAutoLabel"] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[] +ContextPath Value[FAO, forAutoObject]["forAutoLabel"]-> +ContextPath Value[FAO, forAutoObject]["forAutoLabel"] +ContextPath Value[FAO, forAutoObject] +Path FAO.forAutoObject +CPPipe pathFromEnv:FAR found:true +Path FAR. +Path +Path Completion. +[{ + "label": "forAuto", + "kind": 5, + "tags": [], + "detail": "ForAuto.t", + "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} + }, { + "label": "something", + "kind": 5, + "tags": [], + "detail": "option", + "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} + }] Complete src/Completion.res 227:46 posCursor:[227:46] posNoWhite:[227:45] Found expr:[227:3->0:-1] @@ -1249,7 +1400,49 @@ ContextPath Value[FAO, forAutoObject]["forAutoLabel"].forAuto ContextPath Value[FAO, forAutoObject]["forAutoLabel"] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[] +ContextPath Value[FAO, forAutoObject]["forAutoLabel"]->forAuto +ContextPath Value[FAO, forAutoObject]["forAutoLabel"] +ContextPath Value[FAO, forAutoObject] +Path FAO.forAutoObject +CPPipe pathFromEnv:FAR found:true +Path FAR.forAuto +Path forAuto +Path Completion.forAuto +CPPipe pathFromEnv:ForAuto found:false +Path ForAuto. +Path +Path Completion. +[{ + "label": "ForAuto.abc", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "ForAuto.abd", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "myAmazingFunction", + "kind": 12, + "tags": [], + "detail": "(int, int) => int", + "documentation": null + }, { + "label": "myAmazingFunction", + "kind": 12, + "tags": [], + "detail": "(int, int) => int", + "documentation": null + }, { + "label": "uncurried", + "kind": 12, + "tags": [], + "detail": "int => int", + "documentation": null + }] Complete src/Completion.res 230:55 posCursor:[230:55] posNoWhite:[230:54] Found expr:[230:3->230:55] @@ -1261,7 +1454,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, a] Path ForAuto.a -[] +[{ + "label": "abc", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "abd", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }] Complete src/Completion.res 234:34 posCursor:[234:34] posNoWhite:[234:33] Found expr:[234:18->234:36] @@ -1334,7 +1539,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLo] Path SomeLo -[] +[{ + "label": "SomeLocalModule", + "kind": 9, + "tags": [], + "detail": "module SomeLocalModule", + "documentation": null + }] Complete src/Completion.res 256:29 posCursor:[256:29] posNoWhite:[256:28] Found type:[256:13->256:29] @@ -1345,7 +1556,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[] +[{ + "label": "zz", + "kind": 22, + "tags": [], + "detail": "type zz", + "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} + }] Complete src/Completion.res 261:33 posCursor:[261:33] posNoWhite:[261:32] Found type:[261:17->263:11] @@ -1356,7 +1573,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[] +[{ + "label": "zz", + "kind": 22, + "tags": [], + "detail": "type zz", + "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} + }] Complete src/Completion.res 268:21 Ptype_variant unary SomeLocal:[268:12->268:21] @@ -1372,6 +1595,12 @@ Path SomeLocal "tags": [], "detail": "SomeLocalVariantItem", "documentation": {"kind": "markdown", "value": "```rescript\nSomeLocalVariantItem\n```\n\n```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```"} + }, { + "label": "SomeLocalModule", + "kind": 9, + "tags": [], + "detail": "module SomeLocalModule", + "documentation": null }] Complete src/Completion.res 271:20 @@ -1384,7 +1613,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocal] Path SomeLocal -[] +[{ + "label": "SomeLocalModule", + "kind": 9, + "tags": [], + "detail": "module SomeLocalModule", + "documentation": null + }] Complete src/Completion.res 275:15 posCursor:[275:15] posNoWhite:[275:14] Found expr:[274:11->278:1] @@ -1829,7 +2064,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -null +Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib +{"contents": {"kind": "markdown", "value": "```rescript\n{\"age\": int, \"forAutoLabel\": FAR.forAutoRecord}\n```"}} Hover src/Completion.res 355:17 Nothing at that position. Now trying to use completion. @@ -1967,7 +2205,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[AndThatOther, T] Path AndThatOther.T -[] +[{ + "label": "ThatOther", + "kind": 4, + "tags": [], + "detail": "ThatOther", + "documentation": {"kind": "markdown", "value": "```rescript\nThatOther\n```\n\n```rescript\ntype v = And | ThatOther\n```"} + }] Complete src/Completion.res 381:24 posCursor:[381:24] posNoWhite:[381:23] Found expr:[381:12->381:26] @@ -1982,7 +2226,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, ""] Path ForAuto. -[] +[{ + "label": "abc", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "abd", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }] Complete src/Completion.res 384:38 posCursor:[384:38] posNoWhite:[384:37] Found expr:[384:12->384:41] @@ -1998,7 +2254,19 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[] +[{ + "label": "age", + "kind": 4, + "tags": [], + "detail": "int", + "documentation": null + }, { + "label": "forAutoLabel", + "kind": 4, + "tags": [], + "detail": "FAR.forAutoRecord", + "documentation": null + }] Complete src/Completion.res 387:24 posCursor:[387:24] posNoWhite:[387:23] Found expr:[387:11->387:26] @@ -2151,7 +2419,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[] +[{ + "label": "bb", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }, { + "label": "aa", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Completion.res 414:21 posCursor:[414:21] posNoWhite:[414:20] Found expr:[410:14->417:1] @@ -2166,7 +2446,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[] +[{ + "label": "bb", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }, { + "label": "aa", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Completion.res 419:17 posCursor:[419:17] posNoWhite:[419:16] Found expr:[419:11->419:17] @@ -2466,5 +2758,23 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath ValueOrField[FAR, ""] Path FAR. -[] +[{ + "label": "forAutoRecord", + "kind": 12, + "tags": [], + "detail": "forAutoRecord", + "documentation": {"kind": "markdown", "value": "```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} + }, { + "label": "forAuto", + "kind": 5, + "tags": [], + "detail": "ForAuto.t", + "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} + }, { + "label": "something", + "kind": 5, + "tags": [], + "detail": "option", + "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt index 47bd6af8a8..90787cd6ee 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt @@ -20,6 +20,18 @@ Path CompletionFromModule. "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} + }, { + "label": "->SomeModule.getName", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null, + "sortText": "getName", + "insertText": "->SomeModule.getName", + "additionalTextEdits": [{ + "range": {"start": {"line": 10, "character": 4}, "end": {"line": 10, "character": 5}}, + "newText": "" + }] }] Complete src/CompletionFromModule.res 30:6 @@ -69,6 +81,30 @@ Path CompletionFromModule. "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, "newText": "" }] + }, { + "label": "->SomeOtherModule.getNName", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null, + "sortText": "getNName", + "insertText": "->SomeOtherModule.getNName", + "additionalTextEdits": [{ + "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, + "newText": "" + }] + }, { + "label": "->SomeOtherModule.getNName2", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => string", + "documentation": null, + "sortText": "getNName2", + "insertText": "->SomeOtherModule.getNName2", + "additionalTextEdits": [{ + "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, + "newText": "" + }] }] Complete src/CompletionFromModule.res 33:32 @@ -78,7 +114,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[SomeOthe] Path SomeOthe -[] +[{ + "label": "SomeOtherModule", + "kind": 9, + "tags": [], + "detail": "module SomeOtherModule", + "documentation": null + }] Complete src/CompletionFromModule.res 38:8 posCursor:[38:8] posNoWhite:[38:7] Found expr:[38:3->0:-1] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt index 3e75250d47..bc86d8ad38 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt @@ -171,6 +171,12 @@ Path someFnTakingVariant "sortText": "A One", "insertText": "One", "insertTextFormat": 2 + }, { + "label": "OIncludeMeInCompletions", + "kind": 9, + "tags": [], + "detail": "module OIncludeMeInCompletions", + "documentation": null }, { "label": "Option", "kind": 9, @@ -248,6 +254,12 @@ Path someFnTakingVariant "sortText": "A One", "insertText": "One", "insertTextFormat": 2 + }, { + "label": "OIncludeMeInCompletions", + "kind": 9, + "tags": [], + "detail": "module OIncludeMeInCompletions", + "documentation": null }, { "label": "Option", "kind": 9, @@ -476,5 +488,11 @@ CPPipe pathFromEnv:FineModule found:true Path FineModule. Path Path CompletionFunctionArguments. -[] +[{ + "label": "FineModule.setToFalse", + "kind": 12, + "tags": [], + "detail": "t => t", + "documentation": null + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index 7603c44877..a9e5af44d0 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -308,7 +308,17 @@ Path event ContextPath CArgument CJsxPropValue [Div] onMouseEnter($0) ContextPath CJsxPropValue [Div] onMouseEnter Path Div.make -[] +CPPipe pathFromEnv:JsxEvent.Mouse found:false +Path JsxEvent.Mouse.pr +Path pr +Path CompletionInferValues.pr +[{ + "label": "JsxEvent.Mouse.preventDefault", + "kind": 12, + "tags": [], + "detail": "t => unit", + "documentation": null + }] Complete src/CompletionInferValues.res 47:87 posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:11->47:93] diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt index d07d95aad1..2c729506aa 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -603,7 +603,13 @@ Completable: Cjsx([CompWithoutJsxPpx], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path CompWithoutJsxPpx.make -[] +[{ + "label": "name", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/CompletionJsx.res 48:27 posCursor:[48:27] posNoWhite:[48:26] Found expr:[48:3->48:28] @@ -613,7 +619,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [SomeComponent] someProp Path SomeComponent.make -[] +[{ + "label": "\"\"", + "kind": 12, + "tags": [], + "detail": "string", + "documentation": null, + "sortText": "A", + "insertText": "{\"$0\"}", + "insertTextFormat": 2 + }] Complete src/CompletionJsx.res 51:11 posCursor:[51:11] posNoWhite:[51:10] Found expr:[51:3->51:11] @@ -638,7 +653,25 @@ Completable: Cjsx([IntrinsicElementLowercase], "", []) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path IntrinsicElementLowercase.make -[] +[{ + "label": "name", + "kind": 4, + "tags": [], + "detail": "option", + "documentation": null + }, { + "label": "age", + "kind": 4, + "tags": [], + "detail": "option", + "documentation": null + }, { + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/CompletionJsx.res 73:36 posCursor:[73:36] posNoWhite:[73:35] Found expr:[73:3->73:41] @@ -648,7 +681,23 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[] +[{ + "label": "Now", + "kind": 4, + "tags": [], + "detail": "Now", + "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "insertText": "{Now}", + "insertTextFormat": 2 + }, { + "label": "Later", + "kind": 4, + "tags": [], + "detail": "Later", + "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "insertText": "{Later}", + "insertTextFormat": 2 + }] Complete src/CompletionJsx.res 76:36 posCursor:[76:36] posNoWhite:[76:35] Found expr:[76:3->76:40] @@ -658,7 +707,23 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[] +[{ + "label": "Now", + "kind": 4, + "tags": [], + "detail": "Now", + "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "insertText": "{Now}", + "insertTextFormat": 2 + }, { + "label": "Later", + "kind": 4, + "tags": [], + "detail": "Later", + "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "insertText": "{Later}", + "insertTextFormat": 2 + }] Complete src/CompletionJsx.res 79:28 posCursor:[79:28] posNoWhite:[79:27] Found expr:[79:3->79:32] @@ -668,7 +733,23 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[] +[{ + "label": "Now", + "kind": 4, + "tags": [], + "detail": "Now", + "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "insertText": "{Now}", + "insertTextFormat": 2 + }, { + "label": "Later", + "kind": 4, + "tags": [], + "detail": "Later", + "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "insertText": "{Later}", + "insertTextFormat": 2 + }] Complete src/CompletionJsx.res 89:26 posCursor:[89:26] posNoWhite:[89:24] Found expr:[89:3->89:27] @@ -677,7 +758,13 @@ Completable: Cjsx([Info], "", [_type]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Info.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/CompletionJsx.res 93:19 posCursor:[93:19] posNoWhite:[93:18] Found expr:[93:11->93:24] diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt index d979a1efad..686f4f5ec9 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt @@ -389,5 +389,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletableComponentLazy] status Path CompletableComponentLazy.make -[] +[{ + "label": "On", + "kind": 4, + "tags": [], + "detail": "On", + "documentation": {"kind": "markdown", "value": "```rescript\nOn\n```\n\n```rescript\ntype status = On | Off\n```"}, + "insertText": "{On}", + "insertTextFormat": 2 + }, { + "label": "Off", + "kind": 4, + "tags": [], + "detail": "Off", + "documentation": {"kind": "markdown", "value": "```rescript\nOff\n```\n\n```rescript\ntype status = On | Off\n```"}, + "insertText": "{Off}", + "insertTextFormat": 2 + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt index facd6daa7c..dbb2cd5be6 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt @@ -16,5 +16,29 @@ Path B. Path C. Path Path CompletionMultipleEditorCompleteFrom. -[] +[{ + "label": "->B.b", + "kind": 12, + "tags": [], + "detail": "A.a => int", + "documentation": null, + "sortText": "b", + "insertText": "->B.b", + "additionalTextEdits": [{ + "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, + "newText": "" + }] + }, { + "label": "->C.c", + "kind": 12, + "tags": [], + "detail": "A.a => char", + "documentation": null, + "sortText": "c", + "insertText": "->C.c", + "additionalTextEdits": [{ + "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, + "newText": "" + }] + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index cba6ca0b05..c3827fad88 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -11,6 +11,24 @@ Path Integer. Path Path CompletionPipeChain. [{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { + "label": "Integer.increment", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "Integer.decrement", + "kind": 12, + "tags": [], + "detail": "(t, int => int) => t", + "documentation": null + }, { "label": "toFlt", "kind": 12, "tags": [], @@ -37,7 +55,13 @@ CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. Path Path CompletionPipeChain. -[] +[{ + "label": "SuperFloat.toInteger", + "kind": 12, + "tags": [], + "detail": "t => Integer.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 33:38 posCursor:[33:38] posNoWhite:[33:37] Found expr:[33:11->0:-1] @@ -48,7 +72,41 @@ ContextPath Value[Integer, increment](Nolabel, Nolabel)-> ContextPath Value[Integer, increment](Nolabel, Nolabel) ContextPath Value[Integer, increment] Path Integer.increment -[] +CPPipe pathFromEnv:Integer found:true +Path Integer. +Path +Path CompletionPipeChain. +[{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { + "label": "Integer.increment", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "Integer.decrement", + "kind": 12, + "tags": [], + "detail": "(t, int => int) => t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 36:38 posCursor:[36:38] posNoWhite:[36:37] Found expr:[36:11->0:-1] @@ -59,7 +117,41 @@ ContextPath Value[Integer, increment](Nolabel, Nolabel)-> ContextPath Value[Integer, increment](Nolabel, Nolabel) ContextPath Value[Integer, increment] Path Integer.increment -[] +CPPipe pathFromEnv:Integer found:true +Path Integer. +Path +Path CompletionPipeChain. +[{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { + "label": "Integer.increment", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "Integer.decrement", + "kind": 12, + "tags": [], + "detail": "(t, int => int) => t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 39:47 posCursor:[39:47] posNoWhite:[39:46] Found expr:[39:11->0:-1] @@ -70,7 +162,41 @@ ContextPath Value[Integer, decrement](Nolabel, Nolabel)-> ContextPath Value[Integer, decrement](Nolabel, Nolabel) ContextPath Value[Integer, decrement] Path Integer.decrement -[] +CPPipe pathFromEnv:Integer found:true +Path Integer. +Path +Path CompletionPipeChain. +[{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { + "label": "Integer.increment", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "Integer.decrement", + "kind": 12, + "tags": [], + "detail": "(t, int => int) => t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 42:69 posCursor:[42:69] posNoWhite:[42:68] Found expr:[42:11->0:-1] @@ -81,7 +207,41 @@ ContextPath Value[Integer, decrement](Nolabel, Nolabel)-> ContextPath Value[Integer, decrement](Nolabel, Nolabel) ContextPath Value[Integer, decrement] Path Integer.decrement -[] +CPPipe pathFromEnv:Integer found:true +Path Integer. +Path +Path CompletionPipeChain. +[{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { + "label": "Integer.increment", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "Integer.decrement", + "kind": 12, + "tags": [], + "detail": "(t, int => int) => t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }, { + "label": "toFlt", + "kind": 12, + "tags": [], + "detail": "Integer.t => SuperFloat.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 45:62 posCursor:[45:62] posNoWhite:[45:61] Found expr:[45:11->0:-1] @@ -92,7 +252,17 @@ ContextPath Value[SuperFloat, fromInteger](Nolabel)-> ContextPath Value[SuperFloat, fromInteger](Nolabel) ContextPath Value[SuperFloat, fromInteger] Path SuperFloat.fromInteger -[] +CPPipe pathFromEnv:SuperFloat found:true +Path SuperFloat. +Path +Path CompletionPipeChain. +[{ + "label": "SuperFloat.toInteger", + "kind": 12, + "tags": [], + "detail": "t => Integer.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 48:63 posCursor:[48:63] posNoWhite:[48:62] Found expr:[48:11->48:63] @@ -103,7 +273,17 @@ ContextPath Value[SuperFloat, fromInteger](Nolabel)->t ContextPath Value[SuperFloat, fromInteger](Nolabel) ContextPath Value[SuperFloat, fromInteger] Path SuperFloat.fromInteger -[] +CPPipe pathFromEnv:SuperFloat found:true +Path SuperFloat.t +Path t +Path CompletionPipeChain.t +[{ + "label": "SuperFloat.toInteger", + "kind": 12, + "tags": [], + "detail": "t => Integer.t", + "documentation": null + }] Complete src/CompletionPipeChain.res 51:82 posCursor:[51:82] posNoWhite:[51:81] Found expr:[51:11->0:-1] @@ -392,6 +572,24 @@ Path Integer. Path Path CompletionPipeChain. [{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { + "label": "Integer.increment", + "kind": 12, + "tags": [], + "detail": "(t, int) => t", + "documentation": null + }, { + "label": "Integer.decrement", + "kind": 12, + "tags": [], + "detail": "(t, int => int) => t", + "documentation": null + }, { "label": "toFlt", "kind": 12, "tags": [], @@ -420,6 +618,12 @@ Path Integer.t Path t Path CompletionPipeChain.t [{ + "label": "Integer.toInt", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null + }, { "label": "toFlt", "kind": 12, "tags": [], @@ -464,5 +668,11 @@ CPPipe pathFromEnv:Xyz found:true Path Xyz. Path Path CompletionPipeChain. -[] +[{ + "label": "Xyz.do", + "kind": 12, + "tags": [], + "detail": "xx => string", + "documentation": null + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt index 12cdc5e890..6d2ed15746 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt @@ -42,5 +42,29 @@ Path CompletionPipeProperty. "tags": [], "detail": "int", "documentation": {"kind": "markdown", "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} + }, { + "label": "->ObservablePoint.setBoth", + "kind": 12, + "tags": [], + "detail": "(op, float) => unit", + "documentation": null, + "sortText": "setBoth", + "insertText": "->ObservablePoint.setBoth", + "additionalTextEdits": [{ + "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, + "newText": "" + }] + }, { + "label": "->ObservablePoint.set", + "kind": 12, + "tags": [], + "detail": "(op, float, float) => unit", + "documentation": null, + "sortText": "set", + "insertText": "->ObservablePoint.set", + "additionalTextEdits": [{ + "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, + "newText": "" + }] }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt index f2e1ecf285..de9bfd142e 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt @@ -6,7 +6,17 @@ Resolved opens 1 Stdlib ContextPath Value[A, B1, xx]-> ContextPath Value[A, B1, xx] Path A.B1.xx -[] +CPPipe pathFromEnv:A.B1 found:true +Path A.B1. +Path +Path CompletionPipeSubmodules. +[{ + "label": "A.B1.d", + "kind": 12, + "tags": [], + "detail": "b1 => string", + "documentation": null + }] Complete src/CompletionPipeSubmodules.res 17:18 posCursor:[17:18] posNoWhite:[17:17] Found expr:[17:11->21:8] @@ -17,7 +27,24 @@ ContextPath Value[A, x].v-> ContextPath Value[A, x].v ContextPath Value[A, x] Path A.x -[] +ContextPath Value[A, x]->v +ContextPath Value[A, x] +Path A.x +CPPipe pathFromEnv:A found:true +Path A.v +Path v +Path CompletionPipeSubmodules.v +CPPipe pathFromEnv:A.B1 found:true +Path A.B1. +Path +Path CompletionPipeSubmodules. +[{ + "label": "A.B1.d", + "kind": 12, + "tags": [], + "detail": "b1 => string", + "documentation": null + }] Complete src/CompletionPipeSubmodules.res 41:20 posCursor:[41:20] posNoWhite:[41:19] Found expr:[41:11->0:-1] @@ -29,7 +56,39 @@ ContextPath Value[E, e].v.v ContextPath Value[E, e].v ContextPath Value[E, e] Path E.e -[] +ContextPath Value[E, e]->v +ContextPath Value[E, e] +Path E.e +CPPipe pathFromEnv:E found:true +Path E.v +Path v +Path CompletionPipeSubmodules.v +ContextPath Value[E, e].v->v +ContextPath Value[E, e].v +ContextPath Value[E, e] +Path E.e +ContextPath Value[E, e]->v +ContextPath Value[E, e] +Path E.e +CPPipe pathFromEnv:E found:true +Path E.v +Path v +Path CompletionPipeSubmodules.v +CPPipe pathFromEnv:D found:true +Path D.v +Path v +Path CompletionPipeSubmodules.v +CPPipe pathFromEnv:C found:false +Path C. +Path +Path CompletionPipeSubmodules. +[{ + "label": "C.do", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null + }] Complete src/CompletionPipeSubmodules.res 45:21 posCursor:[45:21] posNoWhite:[45:20] Found expr:[45:11->0:-1] @@ -41,5 +100,37 @@ ContextPath Value[E, e].v.v2 ContextPath Value[E, e].v ContextPath Value[E, e] Path E.e -[] +ContextPath Value[E, e]->v +ContextPath Value[E, e] +Path E.e +CPPipe pathFromEnv:E found:true +Path E.v +Path v +Path CompletionPipeSubmodules.v +ContextPath Value[E, e].v->v2 +ContextPath Value[E, e].v +ContextPath Value[E, e] +Path E.e +ContextPath Value[E, e]->v +ContextPath Value[E, e] +Path E.e +CPPipe pathFromEnv:E found:true +Path E.v +Path v +Path CompletionPipeSubmodules.v +CPPipe pathFromEnv:D found:true +Path D.v2 +Path v2 +Path CompletionPipeSubmodules.v2 +CPPipe pathFromEnv:D.C2 found:true +Path D.C2. +Path +Path CompletionPipeSubmodules. +[{ + "label": "D.C2.do", + "kind": 12, + "tags": [], + "detail": "t2 => string", + "documentation": null + }] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt index adc4226230..320a26a0bf 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt @@ -14,7 +14,43 @@ CPPipe pathFromEnv:M found:true Path M. Path Path CompletionTaggedTemplate. -[] +[{ + "label": "->M.xyz", + "kind": 12, + "tags": [], + "detail": "(t, int) => int", + "documentation": null, + "sortText": "xyz", + "insertText": "->M.xyz", + "additionalTextEdits": [{ + "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, + "newText": "" + }] + }, { + "label": "->M.b", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null, + "sortText": "b", + "insertText": "->M.b", + "additionalTextEdits": [{ + "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, + "newText": "" + }] + }, { + "label": "->M.a", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null, + "sortText": "a", + "insertText": "->M.a", + "additionalTextEdits": [{ + "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, + "newText": "" + }] + }] Complete src/CompletionTaggedTemplate.res 16:20 posCursor:[16:20] posNoWhite:[16:19] Found expr:[16:11->0:-1] @@ -33,5 +69,41 @@ CPPipe pathFromEnv:M found:true Path M. Path Path CompletionTaggedTemplate. -[] +[{ + "label": "->M.xyz", + "kind": 12, + "tags": [], + "detail": "(t, int) => int", + "documentation": null, + "sortText": "xyz", + "insertText": "->M.xyz", + "additionalTextEdits": [{ + "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, + "newText": "" + }] + }, { + "label": "->M.b", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null, + "sortText": "b", + "insertText": "->M.b", + "additionalTextEdits": [{ + "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, + "newText": "" + }] + }, { + "label": "->M.a", + "kind": 12, + "tags": [], + "detail": "t => int", + "documentation": null, + "sortText": "a", + "insertText": "->M.a", + "additionalTextEdits": [{ + "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, + "newText": "" + }] + }] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index 723a1059ba..01511c760f 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -20,6 +20,30 @@ Path DotPipeCompletionSpec. "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} + }, { + "label": "->SomeModule.withUnlabelledArgumentNotFirst", + "kind": 12, + "tags": [], + "detail": "(~name: string=?, t) => unit", + "documentation": null, + "sortText": "withUnlabelledArgumentNotFirst", + "insertText": "->SomeModule.withUnlabelledArgumentNotFirst", + "additionalTextEdits": [{ + "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, + "newText": "" + }] + }, { + "label": "->SomeModule.getName", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null, + "sortText": "getName", + "insertText": "->SomeModule.getName", + "additionalTextEdits": [{ + "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, + "newText": "" + }] }] Complete src/DotPipeCompletionSpec.res 44:6 @@ -46,6 +70,30 @@ Path DotPipeCompletionSpec. "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} + }, { + "label": "->SomeOtherModule.getNName", + "kind": 12, + "tags": [], + "detail": "t => string", + "documentation": null, + "sortText": "getNName", + "insertText": "->SomeOtherModule.getNName", + "additionalTextEdits": [{ + "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, + "newText": "" + }] + }, { + "label": "->SomeOtherModule.getNName2", + "kind": 12, + "tags": [], + "detail": "typeOutsideModule => string", + "documentation": null, + "sortText": "getNName2", + "insertText": "->SomeOtherModule.getNName2", + "additionalTextEdits": [{ + "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, + "newText": "" + }] }, { "label": "->CompleteFromThisToo.a", "kind": 12, @@ -149,7 +197,31 @@ Path A. Path B. Path Path DotPipeCompletionSpec. -[] +[{ + "label": "->A.withA", + "kind": 12, + "tags": [], + "detail": "a => unit", + "documentation": null, + "sortText": "withA", + "insertText": "->A.withA", + "additionalTextEdits": [{ + "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, + "newText": "" + }] + }, { + "label": "->B.b", + "kind": 12, + "tags": [], + "detail": "A.a => int", + "documentation": null, + "sortText": "b", + "insertText": "->B.b", + "additionalTextEdits": [{ + "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, + "newText": "" + }] + }] Complete src/DotPipeCompletionSpec.res 67:6 posCursor:[67:6] posNoWhite:[67:5] Found expr:[67:3->67:6] diff --git a/tests/analysis_tests/tests/src/expected/Firebase.res.txt b/tests/analysis_tests/tests/src/expected/Firebase.res.txt index 40ba88facc..d39c5424cd 100644 --- a/tests/analysis_tests/tests/src/expected/Firebase.res.txt +++ b/tests/analysis_tests/tests/src/expected/Firebase.res.txt @@ -27,5 +27,17 @@ Path Firebase.Sample. "tags": [], "detail": "string", "documentation": {"kind": "markdown", "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} + }, { + "label": "->Firestore.getDoc", + "kind": 12, + "tags": [], + "detail": "documentReference<\n 'documentdata,\n> => Promise.t>", + "documentation": null, + "sortText": "getDoc", + "insertText": "->Firestore.getDoc", + "additionalTextEdits": [{ + "range": {"start": {"line": 30, "character": 8}, "end": {"line": 30, "character": 9}}, + "newText": "" + }] }] diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt index 9dfb1a6edf..66920cb633 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt @@ -18,7 +18,19 @@ Completable: Cjsx([M], f, [second, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "first", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }, { + "label": "fun", + "kind": 4, + "tags": [], + "detail": "option", + "documentation": null + }] Complete src/Jsx2.res 14:13 posCursor:[14:13] posNoWhite:[14:12] Found expr:[14:11->14:13] @@ -29,6 +41,12 @@ Resolved opens 1 Stdlib ContextPath Module[M] Path M [{ + "label": "M", + "kind": 9, + "tags": [], + "detail": "module M", + "documentation": null + }, { "label": "Math", "kind": 9, "tags": [], @@ -59,7 +77,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 25:17 posCursor:[25:17] posNoWhite:[25:16] Found expr:[25:3->25:17] @@ -68,7 +92,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 28:21 posCursor:[28:21] posNoWhite:[28:20] Found expr:[28:3->28:21] @@ -77,7 +107,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 31:24 posCursor:[31:24] posNoWhite:[31:23] Found expr:[31:3->31:24] @@ -86,7 +122,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 34:18 posCursor:[34:18] posNoWhite:[34:17] Found expr:[34:3->34:18] @@ -95,7 +137,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 37:16 posCursor:[37:16] posNoWhite:[37:15] Found expr:[37:3->37:16] @@ -104,7 +152,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 40:17 posCursor:[40:17] posNoWhite:[40:16] Found expr:[40:3->40:17] @@ -113,7 +167,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 43:18 posCursor:[43:18] posNoWhite:[43:17] Found expr:[43:3->43:18] @@ -122,7 +182,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 46:16 posCursor:[46:16] posNoWhite:[46:15] Found expr:[46:3->46:16] @@ -131,7 +197,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 49:27 posCursor:[49:27] posNoWhite:[49:26] Found expr:[49:3->49:27] @@ -140,7 +212,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 52:38 posCursor:[52:38] posNoWhite:[52:37] Found expr:[52:3->52:38] @@ -149,7 +227,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 55:25 posCursor:[55:25] posNoWhite:[55:24] Found expr:[55:3->55:25] @@ -158,7 +242,13 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Definition src/Jsx2.res 58:11 {"uri": "Component.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}} @@ -170,7 +260,13 @@ Completable: Cjsx([Ext], al, [al]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Ext.make -[] +[{ + "label": "align", + "kind": 4, + "tags": [], + "detail": "option", + "documentation": null + }] Complete src/Jsx2.res 71:11 posCursor:[71:11] posNoWhite:[71:10] Found expr:[71:3->71:11] @@ -188,7 +284,13 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 77:23 posCursor:[77:23] posNoWhite:[77:22] Found expr:[77:3->77:23] @@ -197,7 +299,13 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[] +[{ + "label": "key", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 80:6 posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:3->85:69] @@ -216,7 +324,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[] +[{ + "label": "WithChildren", + "kind": 9, + "tags": [], + "detail": "module WithChildren", + "documentation": null + }] Complete src/Jsx2.res 91:18 posCursor:[91:18] posNoWhite:[91:17] Found expr:[91:3->91:18] @@ -225,7 +339,13 @@ Completable: Cjsx([WithChildren], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path WithChildren.make -[] +[{ + "label": "name", + "kind": 4, + "tags": [], + "detail": "string", + "documentation": null + }] Complete src/Jsx2.res 94:18 posCursor:[94:18] posNoWhite:[94:17] Found pattern:[94:7->94:18] @@ -276,7 +396,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[DefineSomeFields, ""] Path DefineSomeFields. -[] +[{ + "label": "thisValue", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Jsx2.res 108:36 posCursor:[108:36] posNoWhite:[108:35] Found expr:[108:11->108:36] @@ -288,7 +414,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[DefineSomeFields].th Path DefineSomeFields.th -[] +[{ + "label": "thisField", + "kind": 5, + "tags": [], + "detail": "int", + "documentation": {"kind": "markdown", "value": "```rescript\nthisField: int\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} + }, { + "label": "thatField", + "kind": 5, + "tags": [], + "detail": "string", + "documentation": {"kind": "markdown", "value": "```rescript\nthatField: string\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} + }] Complete src/Jsx2.res 122:20 posCursor:[122:20] posNoWhite:[122:19] Found expr:[121:2->125:4] @@ -300,7 +438,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, h] Path Outer.Inner.h -[] +[{ + "label": "hello", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Jsx2.res 129:19 posCursor:[129:19] posNoWhite:[129:18] Found expr:[128:2->131:9] @@ -312,7 +456,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, ""] Path Outer.Inner. -[] +[{ + "label": "hello", + "kind": 12, + "tags": [], + "detail": "int", + "documentation": null + }] Complete src/Jsx2.res 136:7 posCursor:[136:7] posNoWhite:[136:6] Found expr:[135:2->138:9] @@ -342,7 +492,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, Co] Path Nested.Co -[] +[{ + "label": "Comp", + "kind": 9, + "tags": [], + "detail": "module Comp", + "documentation": null + }] Complete src/Jsx2.res 153:19 posCursor:[153:19] posNoWhite:[153:18] Found expr:[153:11->153:25] @@ -352,7 +508,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, ""] Path Nested. -[] +[{ + "label": "Comp", + "kind": 9, + "tags": [], + "detail": "module Comp", + "documentation": null + }] Hover src/Jsx2.res 162:12 {"contents": {"kind": "markdown", "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n"}} diff --git a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt index e0baee3911..ba54c5d047 100644 --- a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt +++ b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt @@ -8,7 +8,13 @@ Completable: Cjsx([M4], f, [first, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M4.make -[] +[{ + "label": "fun", + "kind": 4, + "tags": [], + "detail": "option", + "documentation": null + }] Hover src/JsxV4.res 14:9 {"contents": {"kind": "markdown", "value": "```rescript\nReact.component>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C12%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n\n---\n Doc Comment For M4 "}} diff --git a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt index ea19225246..3806c7fb4a 100644 --- a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt @@ -90,7 +90,13 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[] +[{ + "label": "name", + "kind": 5, + "tags": [], + "detail": "string", + "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} + }] Complete src/RecordCompletion.res 22:7 posCursor:[22:7] posNoWhite:[22:6] Found expr:[22:3->22:10] @@ -100,5 +106,11 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[] +[{ + "label": "name", + "kind": 5, + "tags": [], + "detail": "string", + "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} + }] diff --git a/tests/analysis_tests/tests/src/expected/Reprod.res.txt b/tests/analysis_tests/tests/src/expected/Reprod.res.txt index 9f96ca0a76..08783543a5 100644 --- a/tests/analysis_tests/tests/src/expected/Reprod.res.txt +++ b/tests/analysis_tests/tests/src/expected/Reprod.res.txt @@ -7,7 +7,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Query, use](~variables) ContextPath Value[Query, use] Path Query.use -[] +[{ + "label": "{}", + "kind": 12, + "tags": [], + "detail": "input_ByAddress", + "documentation": {"kind": "markdown", "value": "```rescript\ntype input_ByAddress = {city: string}\n```"}, + "sortText": "A", + "insertText": "{$0}", + "insertTextFormat": 2 + }] Complete src/Reprod.res 33:28 posCursor:[33:28] posNoWhite:[33:27] Found pattern:[33:21->33:31]