diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 091ba059ec..392883d386 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,7 +153,7 @@ jobs: # matrix.ocaml_compiler may contain commas - name: Get OPAM cache key shell: bash - run: echo "opam_cache_key=opam-env-v6-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" | sed 's/,/-/g' >> $GITHUB_ENV + run: echo "opam_cache_key=opam-env-v7-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" | sed 's/,/-/g' >> $GITHUB_ENV - name: Restore OPAM environment id: cache-opam-env @@ -191,6 +191,10 @@ jobs: if: steps.cache-opam-env.outputs.cache-hit != 'true' run: opam install . --deps-only --with-test + - name: "Install reanalyze" + if: steps.cache-opam-env.outputs.cache-hit != 'true' && matrix.run_reanalyze + run: opam install reanalyze + - name: Cache OPAM environment if: steps.cache-opam-env.outputs.cache-hit != 'true' uses: actions/cache/save@v4 @@ -303,9 +307,7 @@ jobs: - name: "Syntax: Run reanalyze" if: matrix.run_reanalyze - run: | - opam install reanalyze - opam exec -- make reanalyze + run: opam exec -- make reanalyze - name: Build runtime/stdlib run: ./scripts/buildRuntime.sh @@ -324,7 +326,7 @@ jobs: run: git diff --ignore-cr-at-eol --exit-code tests - name: Run analysis / tools tests - if: runner.os != 'Windows' && matrix.os != 'ubuntu-24.04-arm' + if: runner.os != 'Windows' && runner.os != 'Linux' run: opam exec -- make -C tests/analysis_tests test && make -C tests/tools_tests test - name: Run gentype tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 6600d69249..e86b504fcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,8 @@ - Fix completion for application with tagged template. https://github.com/rescript-lang/rescript/pull/7278 - Fix error message for arity in the presence of optional arguments. https://github.com/rescript-lang/rescript/pull/7284 - Fix issue in functors with more than one argument (which are curried): emit nested function always. https://github.com/rescript-lang/rescript/pull/7273 -- Fix dot completion issue with React primitives. https://github.com/rescript-lang/rescript/pull/7292 +- Fix dot completion issue with React primitives. https://github.com/rescript-lang/rescript/pull/7292 +- Stdlib namespace for Core modules (fixes name clashes with user modules). https://github.com/rescript-lang/rescript/pull/7285 #### :house: Internal diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index dbb2382b5b..1d618ae9ed 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -1452,6 +1452,7 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens let completionItems = match path with | Pdot (Pdot (Pident {name = "Js"}, "Re", _), "t", _) + | Pdot (Pdot (Pident {name = "Stdlib"}, "RegExp", _), "t", _) | Pdot (Pident {name = "RegExp"}, "t", _) -> (* regexps *) create "//g" ~insertText:"/$0/g" ~includesSnippets:true diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 4bdeaa79b6..dd04ee170f 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -115,26 +115,35 @@ let newBsPackage ~rootPath = let path = [FindFiles.nameSpaceToName namespace] in [path] in + let bind f x = Option.bind x f in + let bsc_flags = + Json.get "bsc-flags" config + |> bind Json.array |> Option.value ~default:[] + in + let no_pervasives = + bsc_flags + |> List.exists (fun s -> Json.string s = Some "-nopervasives") + in let opens_from_bsc_flags = - let bind f x = Option.bind x f in - match Json.get "bsc-flags" config |> bind Json.array with - | Some l -> - List.fold_left - (fun opens item -> - match item |> Json.string with - | None -> opens - | Some s -> ( - let parts = String.split_on_char ' ' s in - match parts with - | "-open" :: name :: _ -> - let path = name |> String.split_on_char '.' in - path :: opens - | _ -> opens)) - [] l - | None -> [] + List.fold_left + (fun opens item -> + match item |> Json.string with + | None -> opens + | Some s -> ( + let parts = String.split_on_char ' ' s in + match parts with + | "-open" :: name :: _ -> + let path = name |> String.split_on_char '.' in + path :: opens + | _ -> opens)) + [] bsc_flags + in + let opens_from_pervasives = + if no_pervasives then [] + else [["Stdlib"]; ["Pervasives"; "JsxModules"]] in let opens = - ["Pervasives"; "JsxModules"] :: opens_from_namespace + opens_from_pervasives @ opens_from_namespace |> List.rev_append opens_from_bsc_flags |> List.map (fun path -> path @ ["place holder"]) in diff --git a/analysis/src/TypeUtils.ml b/analysis/src/TypeUtils.ml index ed78c81e37..783685d551 100644 --- a/analysis/src/TypeUtils.ml +++ b/analysis/src/TypeUtils.ml @@ -1255,14 +1255,14 @@ let pathToBuiltin path = let completionPathFromMaybeBuiltin path = match pathToBuiltin path with - | Some ("array", _) -> Some ["Array"] - | Some ("option", _) -> Some ["Option"] - | Some ("string", _) -> Some ["String"] - | Some ("int", _) -> Some ["Int"] - | Some ("float", _) -> Some ["Float"] - | Some ("promise", _) -> Some ["Promise"] - | Some ("list", _) -> Some ["List"] - | Some ("result", _) -> Some ["Result"] - | Some ("dict", _) -> Some ["Dict"] - | Some ("char", _) -> Some ["Char"] + | Some ("array", _) -> Some ["Stdlib"; "Array"] + | Some ("option", _) -> Some ["Stdlib"; "Option"] + | Some ("string", _) -> Some ["Stdlib"; "String"] + | Some ("int", _) -> Some ["Stdlib"; "Int"] + | Some ("float", _) -> Some ["Stdlib"; "Float"] + | Some ("promise", _) -> Some ["Stdlib"; "Promise"] + | Some ("list", _) -> Some ["Stdlib"; "List"] + | Some ("result", _) -> Some ["Stdlib"; "Result"] + | Some ("dict", _) -> Some ["Stdlib"; "Dict"] + | Some ("char", _) -> Some ["Stdlib"; "Char"] | _ -> None diff --git a/compiler/core/res_compmisc.ml b/compiler/core/res_compmisc.ml index 3f8650858a..3f21ce9cc5 100644 --- a/compiler/core/res_compmisc.ml +++ b/compiler/core/res_compmisc.ml @@ -54,7 +54,10 @@ let initial_env ?modulename () = let initial = Env.initial_safe_string in let env = if !Clflags.nopervasives then initial - else open_implicit_module "Pervasives" initial + else + initial + |> open_implicit_module "Pervasives" + |> open_implicit_module "Stdlib" in List.fold_left (fun env m -> open_implicit_module m env) diff --git a/compiler/gentype/TranslateTypeExprFromTypes.ml b/compiler/gentype/TranslateTypeExprFromTypes.ml index 75615bcdef..ca00856408 100644 --- a/compiler/gentype/TranslateTypeExprFromTypes.ml +++ b/compiler/gentype/TranslateTypeExprFromTypes.ml @@ -81,36 +81,42 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env = | ( ( ["FB"; "string"] | ["string"] | ["String"; "t"] + | ["Stdlib"; "String"; "t"] | ["Js"; ("String" | "String2"); "t"] ), [] ) -> {dependencies = []; type_ = string_t} - | (["Js"; "Types"; "bigint_val"] | ["BigInt"; "t"]), [] -> + | ( ( ["Js"; "Types"; "bigint_val"] + | ["BigInt"; "t"] + | ["Stdlib"; "BigInt"; "t"] ), + [] ) -> {dependencies = []; type_ = bigint_t} - | (["Js"; "Date"; "t"] | ["Date"; "t"]), [] -> + | (["Js"; "Date"; "t"] | ["Date"; "t"] | ["Stdlib"; "Date"; "t"]), [] -> {dependencies = []; type_ = date_t} - | ["Map"; "t"], [param_translation1; param_translation2] -> + | ( (["Map"; "t"] | ["Stdlib"; "Map"; "t"]), + [param_translation1; param_translation2] ) -> { dependencies = param_translation1.dependencies @ param_translation2.dependencies; type_ = map_t (param_translation1.type_, param_translation2.type_); } - | ["WeakMap"; "t"], [param_translation1; param_translation2] -> + | ( (["WeakMap"; "t"] | ["Stdlib"; "WeakMap"; "t"]), + [param_translation1; param_translation2] ) -> { dependencies = param_translation1.dependencies @ param_translation2.dependencies; type_ = weakmap_t (param_translation1.type_, param_translation2.type_); } - | ["Set"; "t"], [param_translation] -> + | (["Set"; "t"] | ["Stdlib"; "Set"; "t"]), [param_translation] -> { dependencies = param_translation.dependencies; type_ = set_t param_translation.type_; } - | ["WeakSet"; "t"], [param_translation] -> + | (["WeakSet"; "t"] | ["Stdlib"; "WeakSet"; "t"]), [param_translation] -> { dependencies = param_translation.dependencies; type_ = weakset_t param_translation.type_; } - | (["Js"; "Re"; "t"] | ["RegExp"; "t"]), [] -> + | (["Js"; "Re"; "t"] | ["RegExp"; "t"] | ["Stdlib"; "RegExp"; "t"]), [] -> {dependencies = []; type_ = regexp_t} | (["FB"; "unit"] | ["unit"]), [] -> {dependencies = []; type_ = unit_t} | ( (["FB"; "array"] | ["array"] | ["Js"; ("Array" | "Array2"); "t"]), @@ -134,7 +140,10 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env = }; ] ); } - | ( (["Pervasives"; "result"] | ["Belt"; "Result"; "t"] | ["result"]), + | ( ( ["Pervasives"; "result"] + | ["Belt"; "Result"; "t"] + | ["result"] + | ["Stdlib"; "Result"; "t"] ), [param_translation1; param_translation2] ) -> let case name type_ = {case = {label_js = StringLabel name}; t = type_} in let variant = @@ -216,20 +225,28 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env = | ( (["Js"; "Undefined"; "t"] | ["Undefined"; "t"] | ["Js"; "undefined"]), [param_translation] ) -> {param_translation with type_ = Option param_translation.type_} - | (["Js"; "Null"; "t"] | ["Null"; "t"] | ["Js"; "null"]), [param_translation] - -> + | ( ( ["Js"; "Null"; "t"] + | ["Null"; "t"] + | ["Js"; "null"] + | ["Stdlib"; "Null"; "t"] ), + [param_translation] ) -> {param_translation with type_ = Null param_translation.type_} | ( ( ["Js"; "Nullable"; "t"] | ["Nullable"; "t"] | ["Js"; "nullable"] | ["Js"; "Null_undefined"; "t"] - | ["Js"; "null_undefined"] ), + | ["Js"; "null_undefined"] + | ["Stdlib"; "Nullable"; "t"] ), [param_translation] ) -> {param_translation with type_ = Nullable param_translation.type_} - | ( (["Js"; "Promise"; "t"] | ["Promise"; "t"] | ["promise"]), + | ( ( ["Js"; "Promise"; "t"] + | ["Promise"; "t"] + | ["promise"] + | ["Stdlib"; "Promise"; "t"] ), [param_translation] ) -> {param_translation with type_ = Promise param_translation.type_} - | (["Js"; "Dict"; "t"] | ["Dict"; "t"] | ["dict"]), [param_translation] -> + | ( (["Js"; "Dict"; "t"] | ["Dict"; "t"] | ["dict"] | ["Stdlib"; "Dict"; "t"]), + [param_translation] ) -> {param_translation with type_ = Dict param_translation.type_} | _ -> default_case () diff --git a/compiler/ml/ast_untagged_variants.ml b/compiler/ml/ast_untagged_variants.ml index 253791acf1..006f56288e 100644 --- a/compiler/ml/ast_untagged_variants.ml +++ b/compiler/ml/ast_untagged_variants.ml @@ -179,8 +179,8 @@ let type_to_instanceof_backed_obj (t : Types.type_expr) = | Tconstr (path, _, _) when Path.same path Predef.path_array -> Some Array | Tconstr (path, _, _) -> ( match Path.name path with - | "Js_date.t" -> Some Date - | "Js_re.t" -> Some RegExp + | "Stdlib_Date.t" -> Some Date + | "Stdlib_RegExp.t" -> Some RegExp | "Js_file.t" -> Some File | "Js_blob.t" -> Some Blob | _ -> None) diff --git a/lib/es6/Pervasives.js b/lib/es6/Pervasives.js index 65fe437b38..98f20a6e15 100644 --- a/lib/es6/Pervasives.js +++ b/lib/es6/Pervasives.js @@ -1,7 +1,5 @@ -import * as $$Error from "./Error.js"; -import * as Primitive_object from "./Primitive_object.js"; import * as Primitive_exceptions from "./Primitive_exceptions.js"; function failwith(s) { @@ -117,21 +115,6 @@ function $at(l1, l2) { } } -function assertEqual(a, b) { - if (!Primitive_object.notequal(a, b)) { - return; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "Pervasives.res", - 596, - 4 - ], - Error: new Error() - }; -} - let max_int = 2147483647; let infinity = Infinity; @@ -144,8 +127,6 @@ let min_float = 2.22507385850720138e-308; let epsilon_float = 2.22044604925031308e-16; -let panic = $$Error.panic; - export { failwith, invalid_arg, @@ -166,7 +147,5 @@ export { bool_of_string_opt, int_of_string_opt, $at, - panic, - assertEqual, } /* No side effect */ diff --git a/lib/es6/Stdlib.js b/lib/es6/Stdlib.js new file mode 100644 index 0000000000..39bdaf88ea --- /dev/null +++ b/lib/es6/Stdlib.js @@ -0,0 +1,159 @@ + + +import * as Stdlib_Error from "./Stdlib_Error.js"; +import * as Primitive_object from "./Primitive_object.js"; + +function assertEqual(a, b) { + if (!Primitive_object.notequal(a, b)) { + return; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "Stdlib.res", + 117, + 4 + ], + Error: new Error() + }; +} + +let $$Array; + +let $$BigInt; + +let Console; + +let $$DataView; + +let $$Date; + +let Dict; + +let Exn; + +let $$Error; + +let Float; + +let Int; + +let $$Intl; + +let $$JSON; + +let List; + +let $$Math; + +let Null; + +let Nullable; + +let $$Object; + +let Option; + +let Ordering; + +let $$Promise; + +let $$RegExp; + +let Result; + +let $$String; + +let $$Symbol; + +let Type; + +let $$Iterator; + +let $$AsyncIterator; + +let $$Map; + +let $$WeakMap; + +let $$Set; + +let $$WeakSet; + +let $$ArrayBuffer; + +let $$TypedArray; + +let $$Float32Array; + +let $$Float64Array; + +let $$Int8Array; + +let $$Int16Array; + +let $$Int32Array; + +let $$Uint8Array; + +let $$Uint16Array; + +let $$Uint32Array; + +let $$Uint8ClampedArray; + +let $$BigInt64Array; + +let $$BigUint64Array; + +let panic = Stdlib_Error.panic; + +export { + $$Array, + $$BigInt, + Console, + $$DataView, + $$Date, + Dict, + Exn, + $$Error, + Float, + Int, + $$Intl, + $$JSON, + List, + $$Math, + Null, + Nullable, + $$Object, + Option, + Ordering, + $$Promise, + $$RegExp, + Result, + $$String, + $$Symbol, + Type, + $$Iterator, + $$AsyncIterator, + $$Map, + $$WeakMap, + $$Set, + $$WeakSet, + $$ArrayBuffer, + $$TypedArray, + $$Float32Array, + $$Float64Array, + $$Int8Array, + $$Int16Array, + $$Int32Array, + $$Uint8Array, + $$Uint16Array, + $$Uint32Array, + $$Uint8ClampedArray, + $$BigInt64Array, + $$BigUint64Array, + panic, + assertEqual, +} +/* No side effect */ diff --git a/lib/es6/Array.js b/lib/es6/Stdlib_Array.js similarity index 100% rename from lib/es6/Array.js rename to lib/es6/Stdlib_Array.js diff --git a/lib/es6/ArrayBuffer.js b/lib/es6/Stdlib_ArrayBuffer.js similarity index 100% rename from lib/es6/ArrayBuffer.js rename to lib/es6/Stdlib_ArrayBuffer.js diff --git a/lib/es6/AsyncIterator.js b/lib/es6/Stdlib_AsyncIterator.js similarity index 100% rename from lib/es6/AsyncIterator.js rename to lib/es6/Stdlib_AsyncIterator.js diff --git a/lib/es6/BigInt.js b/lib/es6/Stdlib_BigInt.js similarity index 100% rename from lib/es6/BigInt.js rename to lib/es6/Stdlib_BigInt.js diff --git a/lib/es6/BigInt64Array.js b/lib/es6/Stdlib_BigInt64Array.js similarity index 100% rename from lib/es6/BigInt64Array.js rename to lib/es6/Stdlib_BigInt64Array.js diff --git a/lib/es6/BigUint64Array.js b/lib/es6/Stdlib_BigUint64Array.js similarity index 100% rename from lib/es6/BigUint64Array.js rename to lib/es6/Stdlib_BigUint64Array.js diff --git a/lib/es6/Console.js b/lib/es6/Stdlib_Console.js similarity index 100% rename from lib/es6/Console.js rename to lib/es6/Stdlib_Console.js diff --git a/lib/es6/DataView.js b/lib/es6/Stdlib_DataView.js similarity index 100% rename from lib/es6/DataView.js rename to lib/es6/Stdlib_DataView.js diff --git a/lib/es6/Date.js b/lib/es6/Stdlib_Date.js similarity index 100% rename from lib/es6/Date.js rename to lib/es6/Stdlib_Date.js diff --git a/lib/es6/Dict.js b/lib/es6/Stdlib_Dict.js similarity index 100% rename from lib/es6/Dict.js rename to lib/es6/Stdlib_Dict.js diff --git a/lib/es6/Error.js b/lib/es6/Stdlib_Error.js similarity index 100% rename from lib/es6/Error.js rename to lib/es6/Stdlib_Error.js diff --git a/lib/es6/Exn.js b/lib/es6/Stdlib_Exn.js similarity index 100% rename from lib/es6/Exn.js rename to lib/es6/Stdlib_Exn.js diff --git a/lib/es6/Float.js b/lib/es6/Stdlib_Float.js similarity index 100% rename from lib/es6/Float.js rename to lib/es6/Stdlib_Float.js diff --git a/lib/es6/Float32Array.js b/lib/es6/Stdlib_Float32Array.js similarity index 100% rename from lib/es6/Float32Array.js rename to lib/es6/Stdlib_Float32Array.js diff --git a/lib/es6/Float64Array.js b/lib/es6/Stdlib_Float64Array.js similarity index 100% rename from lib/es6/Float64Array.js rename to lib/es6/Stdlib_Float64Array.js diff --git a/lib/es6/Intl_Collator.js b/lib/es6/Stdlib_Global.js similarity index 100% rename from lib/es6/Intl_Collator.js rename to lib/es6/Stdlib_Global.js diff --git a/lib/es6/Int.js b/lib/es6/Stdlib_Int.js similarity index 92% rename from lib/es6/Int.js rename to lib/es6/Stdlib_Int.js index d817901429..f8a2f4a351 100644 --- a/lib/es6/Int.js +++ b/lib/es6/Stdlib_Int.js @@ -1,6 +1,6 @@ -import * as $$Array from "./Array.js"; +import * as Stdlib_Array from "./Stdlib_Array.js"; function fromString(x, radix) { let maybeInt = radix !== undefined ? parseInt(x, radix) : parseInt(x); @@ -46,7 +46,7 @@ function range(start, end, optionsOpt) { let range$2 = options.inclusive === true ? range$1 + 1 | 0 : range$1; length = Math.ceil(range$2 / abs(step)) | 0; } - return $$Array.fromInitializer(length, i => start + Math.imul(i, step) | 0); + return Stdlib_Array.fromInitializer(length, i => start + Math.imul(i, step) | 0); } function rangeWithOptions(start, end, options) { diff --git a/lib/es6/Int16Array.js b/lib/es6/Stdlib_Int16Array.js similarity index 100% rename from lib/es6/Int16Array.js rename to lib/es6/Stdlib_Int16Array.js diff --git a/lib/es6/Int32Array.js b/lib/es6/Stdlib_Int32Array.js similarity index 100% rename from lib/es6/Int32Array.js rename to lib/es6/Stdlib_Int32Array.js diff --git a/lib/es6/Int8Array.js b/lib/es6/Stdlib_Int8Array.js similarity index 100% rename from lib/es6/Int8Array.js rename to lib/es6/Stdlib_Int8Array.js diff --git a/lib/es6/Intl.js b/lib/es6/Stdlib_Intl.js similarity index 100% rename from lib/es6/Intl.js rename to lib/es6/Stdlib_Intl.js diff --git a/lib/es6/Intl_Common.js b/lib/es6/Stdlib_Intl_Collator.js similarity index 100% rename from lib/es6/Intl_Common.js rename to lib/es6/Stdlib_Intl_Collator.js diff --git a/lib/es6/Intl_DateTimeFormat.js b/lib/es6/Stdlib_Intl_Common.js similarity index 100% rename from lib/es6/Intl_DateTimeFormat.js rename to lib/es6/Stdlib_Intl_Common.js diff --git a/lib/es6/Intl_ListFormat.js b/lib/es6/Stdlib_Intl_DateTimeFormat.js similarity index 100% rename from lib/es6/Intl_ListFormat.js rename to lib/es6/Stdlib_Intl_DateTimeFormat.js diff --git a/lib/es6/Intl_Locale.js b/lib/es6/Stdlib_Intl_ListFormat.js similarity index 100% rename from lib/es6/Intl_Locale.js rename to lib/es6/Stdlib_Intl_ListFormat.js diff --git a/lib/es6/Intl_PluralRules.js b/lib/es6/Stdlib_Intl_Locale.js similarity index 100% rename from lib/es6/Intl_PluralRules.js rename to lib/es6/Stdlib_Intl_Locale.js diff --git a/lib/es6/Intl_NumberFormat.js b/lib/es6/Stdlib_Intl_NumberFormat.js similarity index 100% rename from lib/es6/Intl_NumberFormat.js rename to lib/es6/Stdlib_Intl_NumberFormat.js diff --git a/lib/es6/Intl_NumberFormat_Grouping.js b/lib/es6/Stdlib_Intl_NumberFormat_Grouping.js similarity index 83% rename from lib/es6/Intl_NumberFormat_Grouping.js rename to lib/es6/Stdlib_Intl_NumberFormat_Grouping.js index 4633bbc588..b22460914a 100644 --- a/lib/es6/Intl_NumberFormat_Grouping.js +++ b/lib/es6/Stdlib_Intl_NumberFormat_Grouping.js @@ -1,9 +1,9 @@ -import * as Type from "./Type.js"; +import * as Stdlib_Type from "./Stdlib_Type.js"; function parseJsValue(value) { - let value$1 = Type.Classify.classify(value); + let value$1 = Stdlib_Type.Classify.classify(value); if (typeof value$1 !== "object") { return; } diff --git a/lib/es6/Intl_RelativeTimeFormat.js b/lib/es6/Stdlib_Intl_PluralRules.js similarity index 100% rename from lib/es6/Intl_RelativeTimeFormat.js rename to lib/es6/Stdlib_Intl_PluralRules.js diff --git a/lib/es6/Intl_Segmenter.js b/lib/es6/Stdlib_Intl_RelativeTimeFormat.js similarity index 100% rename from lib/es6/Intl_Segmenter.js rename to lib/es6/Stdlib_Intl_RelativeTimeFormat.js diff --git a/lib/es6/Intl_Segments.js b/lib/es6/Stdlib_Intl_Segmenter.js similarity index 100% rename from lib/es6/Intl_Segments.js rename to lib/es6/Stdlib_Intl_Segmenter.js diff --git a/lib/es6/Map.js b/lib/es6/Stdlib_Intl_Segments.js similarity index 100% rename from lib/es6/Map.js rename to lib/es6/Stdlib_Intl_Segments.js diff --git a/lib/es6/Iterator.js b/lib/es6/Stdlib_Iterator.js similarity index 100% rename from lib/es6/Iterator.js rename to lib/es6/Stdlib_Iterator.js diff --git a/lib/es6/JSON.js b/lib/es6/Stdlib_JSON.js similarity index 100% rename from lib/es6/JSON.js rename to lib/es6/Stdlib_JSON.js diff --git a/lib/es6/List.js b/lib/es6/Stdlib_List.js similarity index 99% rename from lib/es6/List.js rename to lib/es6/Stdlib_List.js index 2b0f6cd7d2..ce19bd0763 100644 --- a/lib/es6/List.js +++ b/lib/es6/Stdlib_List.js @@ -1,6 +1,6 @@ -import * as $$Array from "./Array.js"; +import * as Stdlib_Array from "./Stdlib_Array.js"; import * as Primitive_int from "./Primitive_int.js"; import * as Primitive_option from "./Primitive_option.js"; @@ -648,7 +648,7 @@ function toArray(x) { function toShuffled(xs) { let v = toArray(xs); - $$Array.shuffle(v); + Stdlib_Array.shuffle(v); return fromArray(v); } diff --git a/lib/es6/Object.js b/lib/es6/Stdlib_Map.js similarity index 100% rename from lib/es6/Object.js rename to lib/es6/Stdlib_Map.js diff --git a/lib/es6/Math.js b/lib/es6/Stdlib_Math.js similarity index 100% rename from lib/es6/Math.js rename to lib/es6/Stdlib_Math.js diff --git a/lib/es6/Null.js b/lib/es6/Stdlib_Null.js similarity index 78% rename from lib/es6/Null.js rename to lib/es6/Stdlib_Null.js index 11cf9f43ce..a9227bd384 100644 --- a/lib/es6/Null.js +++ b/lib/es6/Stdlib_Null.js @@ -1,6 +1,6 @@ -import * as Option from "./Option.js"; +import * as Stdlib_Option from "./Stdlib_Option.js"; import * as Primitive_option from "./Primitive_option.js"; function fromOption(option) { @@ -12,11 +12,11 @@ function fromOption(option) { } function equal(a, b, eq) { - return Option.equal(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), eq); + return Stdlib_Option.equal(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), eq); } function compare(a, b, cmp) { - return Option.compare(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), cmp); + return Stdlib_Option.compare(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), cmp); } function getOr(value, $$default) { diff --git a/lib/es6/Nullable.js b/lib/es6/Stdlib_Nullable.js similarity index 78% rename from lib/es6/Nullable.js rename to lib/es6/Stdlib_Nullable.js index 13415fc964..de9df692a1 100644 --- a/lib/es6/Nullable.js +++ b/lib/es6/Stdlib_Nullable.js @@ -1,6 +1,6 @@ -import * as Option from "./Option.js"; +import * as Stdlib_Option from "./Stdlib_Option.js"; import * as Primitive_option from "./Primitive_option.js"; function fromOption(option) { @@ -11,11 +11,11 @@ function fromOption(option) { } function equal(a, b, eq) { - return Option.equal((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), eq); + return Stdlib_Option.equal((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), eq); } function compare(a, b, cmp) { - return Option.compare((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), cmp); + return Stdlib_Option.compare((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), cmp); } function getOr(value, $$default) { diff --git a/lib/es6/Set.js b/lib/es6/Stdlib_Object.js similarity index 100% rename from lib/es6/Set.js rename to lib/es6/Stdlib_Object.js diff --git a/lib/es6/Option.js b/lib/es6/Stdlib_Option.js similarity index 96% rename from lib/es6/Option.js rename to lib/es6/Stdlib_Option.js index 98e8467077..2bb1041776 100644 --- a/lib/es6/Option.js +++ b/lib/es6/Stdlib_Option.js @@ -1,6 +1,6 @@ -import * as $$Error from "./Error.js"; +import * as Stdlib_Error from "./Stdlib_Error.js"; import * as Primitive_option from "./Primitive_option.js"; function filter(opt, p) { @@ -21,7 +21,7 @@ function getExn(x, message) { if (x !== undefined) { return Primitive_option.valFromOption(x); } else { - return $$Error.panic(message !== undefined ? message : "Option.getExn called for None value"); + return Stdlib_Error.panic(message !== undefined ? message : "Option.getExn called for None value"); } } diff --git a/lib/es6/Ordering.js b/lib/es6/Stdlib_Ordering.js similarity index 100% rename from lib/es6/Ordering.js rename to lib/es6/Stdlib_Ordering.js diff --git a/lib/es6/Promise.js b/lib/es6/Stdlib_Promise.js similarity index 100% rename from lib/es6/Promise.js rename to lib/es6/Stdlib_Promise.js diff --git a/lib/es6/RegExp.js b/lib/es6/Stdlib_RegExp.js similarity index 100% rename from lib/es6/RegExp.js rename to lib/es6/Stdlib_RegExp.js diff --git a/lib/es6/Result.js b/lib/es6/Stdlib_Result.js similarity index 100% rename from lib/es6/Result.js rename to lib/es6/Stdlib_Result.js diff --git a/lib/es6/Symbol.js b/lib/es6/Stdlib_Set.js similarity index 100% rename from lib/es6/Symbol.js rename to lib/es6/Stdlib_Set.js diff --git a/lib/es6/String.js b/lib/es6/Stdlib_String.js similarity index 100% rename from lib/es6/String.js rename to lib/es6/Stdlib_String.js diff --git a/lib/es6/TypedArray.js b/lib/es6/Stdlib_Symbol.js similarity index 100% rename from lib/es6/TypedArray.js rename to lib/es6/Stdlib_Symbol.js diff --git a/lib/es6/Type.js b/lib/es6/Stdlib_Type.js similarity index 100% rename from lib/es6/Type.js rename to lib/es6/Stdlib_Type.js diff --git a/lib/es6/WeakMap.js b/lib/es6/Stdlib_TypedArray.js similarity index 100% rename from lib/es6/WeakMap.js rename to lib/es6/Stdlib_TypedArray.js diff --git a/lib/es6/Uint16Array.js b/lib/es6/Stdlib_Uint16Array.js similarity index 100% rename from lib/es6/Uint16Array.js rename to lib/es6/Stdlib_Uint16Array.js diff --git a/lib/es6/Uint32Array.js b/lib/es6/Stdlib_Uint32Array.js similarity index 100% rename from lib/es6/Uint32Array.js rename to lib/es6/Stdlib_Uint32Array.js diff --git a/lib/es6/Uint8Array.js b/lib/es6/Stdlib_Uint8Array.js similarity index 100% rename from lib/es6/Uint8Array.js rename to lib/es6/Stdlib_Uint8Array.js diff --git a/lib/es6/Uint8ClampedArray.js b/lib/es6/Stdlib_Uint8ClampedArray.js similarity index 100% rename from lib/es6/Uint8ClampedArray.js rename to lib/es6/Stdlib_Uint8ClampedArray.js diff --git a/lib/es6/WeakSet.js b/lib/es6/Stdlib_WeakMap.js similarity index 100% rename from lib/es6/WeakSet.js rename to lib/es6/Stdlib_WeakMap.js diff --git a/lib/js/ArrayBuffer.js b/lib/es6/Stdlib_WeakSet.js similarity index 100% rename from lib/js/ArrayBuffer.js rename to lib/es6/Stdlib_WeakSet.js diff --git a/lib/js/Pervasives.js b/lib/js/Pervasives.js index bc1fb820b4..92db18e121 100644 --- a/lib/js/Pervasives.js +++ b/lib/js/Pervasives.js @@ -1,7 +1,5 @@ 'use strict'; -let $$Error = require("./Error.js"); -let Primitive_object = require("./Primitive_object.js"); let Primitive_exceptions = require("./Primitive_exceptions.js"); function failwith(s) { @@ -117,21 +115,6 @@ function $at(l1, l2) { } } -function assertEqual(a, b) { - if (!Primitive_object.notequal(a, b)) { - return; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "Pervasives.res", - 596, - 4 - ], - Error: new Error() - }; -} - let max_int = 2147483647; let infinity = Infinity; @@ -144,8 +127,6 @@ let min_float = 2.22507385850720138e-308; let epsilon_float = 2.22044604925031308e-16; -let panic = $$Error.panic; - exports.failwith = failwith; exports.invalid_arg = invalid_arg; exports.Exit = Exit; @@ -165,6 +146,4 @@ exports.bool_of_string = bool_of_string; exports.bool_of_string_opt = bool_of_string_opt; exports.int_of_string_opt = int_of_string_opt; exports.$at = $at; -exports.panic = panic; -exports.assertEqual = assertEqual; /* No side effect */ diff --git a/lib/js/Stdlib.js b/lib/js/Stdlib.js new file mode 100644 index 0000000000..4ac16823db --- /dev/null +++ b/lib/js/Stdlib.js @@ -0,0 +1,157 @@ +'use strict'; + +let Stdlib_Error = require("./Stdlib_Error.js"); +let Primitive_object = require("./Primitive_object.js"); + +function assertEqual(a, b) { + if (!Primitive_object.notequal(a, b)) { + return; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "Stdlib.res", + 117, + 4 + ], + Error: new Error() + }; +} + +let $$Array; + +let $$BigInt; + +let Console; + +let $$DataView; + +let $$Date; + +let Dict; + +let Exn; + +let $$Error; + +let Float; + +let Int; + +let $$Intl; + +let $$JSON; + +let List; + +let $$Math; + +let Null; + +let Nullable; + +let $$Object; + +let Option; + +let Ordering; + +let $$Promise; + +let $$RegExp; + +let Result; + +let $$String; + +let $$Symbol; + +let Type; + +let $$Iterator; + +let $$AsyncIterator; + +let $$Map; + +let $$WeakMap; + +let $$Set; + +let $$WeakSet; + +let $$ArrayBuffer; + +let $$TypedArray; + +let $$Float32Array; + +let $$Float64Array; + +let $$Int8Array; + +let $$Int16Array; + +let $$Int32Array; + +let $$Uint8Array; + +let $$Uint16Array; + +let $$Uint32Array; + +let $$Uint8ClampedArray; + +let $$BigInt64Array; + +let $$BigUint64Array; + +let panic = Stdlib_Error.panic; + +exports.$$Array = $$Array; +exports.$$BigInt = $$BigInt; +exports.Console = Console; +exports.$$DataView = $$DataView; +exports.$$Date = $$Date; +exports.Dict = Dict; +exports.Exn = Exn; +exports.$$Error = $$Error; +exports.Float = Float; +exports.Int = Int; +exports.$$Intl = $$Intl; +exports.$$JSON = $$JSON; +exports.List = List; +exports.$$Math = $$Math; +exports.Null = Null; +exports.Nullable = Nullable; +exports.$$Object = $$Object; +exports.Option = Option; +exports.Ordering = Ordering; +exports.$$Promise = $$Promise; +exports.$$RegExp = $$RegExp; +exports.Result = Result; +exports.$$String = $$String; +exports.$$Symbol = $$Symbol; +exports.Type = Type; +exports.$$Iterator = $$Iterator; +exports.$$AsyncIterator = $$AsyncIterator; +exports.$$Map = $$Map; +exports.$$WeakMap = $$WeakMap; +exports.$$Set = $$Set; +exports.$$WeakSet = $$WeakSet; +exports.$$ArrayBuffer = $$ArrayBuffer; +exports.$$TypedArray = $$TypedArray; +exports.$$Float32Array = $$Float32Array; +exports.$$Float64Array = $$Float64Array; +exports.$$Int8Array = $$Int8Array; +exports.$$Int16Array = $$Int16Array; +exports.$$Int32Array = $$Int32Array; +exports.$$Uint8Array = $$Uint8Array; +exports.$$Uint16Array = $$Uint16Array; +exports.$$Uint32Array = $$Uint32Array; +exports.$$Uint8ClampedArray = $$Uint8ClampedArray; +exports.$$BigInt64Array = $$BigInt64Array; +exports.$$BigUint64Array = $$BigUint64Array; +exports.panic = panic; +exports.assertEqual = assertEqual; +/* No side effect */ diff --git a/lib/js/Array.js b/lib/js/Stdlib_Array.js similarity index 100% rename from lib/js/Array.js rename to lib/js/Stdlib_Array.js diff --git a/lib/js/Console.js b/lib/js/Stdlib_ArrayBuffer.js similarity index 100% rename from lib/js/Console.js rename to lib/js/Stdlib_ArrayBuffer.js diff --git a/lib/js/AsyncIterator.js b/lib/js/Stdlib_AsyncIterator.js similarity index 100% rename from lib/js/AsyncIterator.js rename to lib/js/Stdlib_AsyncIterator.js diff --git a/lib/js/BigInt.js b/lib/js/Stdlib_BigInt.js similarity index 100% rename from lib/js/BigInt.js rename to lib/js/Stdlib_BigInt.js diff --git a/lib/js/BigInt64Array.js b/lib/js/Stdlib_BigInt64Array.js similarity index 100% rename from lib/js/BigInt64Array.js rename to lib/js/Stdlib_BigInt64Array.js diff --git a/lib/js/BigUint64Array.js b/lib/js/Stdlib_BigUint64Array.js similarity index 100% rename from lib/js/BigUint64Array.js rename to lib/js/Stdlib_BigUint64Array.js diff --git a/lib/js/DataView.js b/lib/js/Stdlib_Console.js similarity index 100% rename from lib/js/DataView.js rename to lib/js/Stdlib_Console.js diff --git a/lib/js/Intl_Collator.js b/lib/js/Stdlib_DataView.js similarity index 100% rename from lib/js/Intl_Collator.js rename to lib/js/Stdlib_DataView.js diff --git a/lib/js/Date.js b/lib/js/Stdlib_Date.js similarity index 100% rename from lib/js/Date.js rename to lib/js/Stdlib_Date.js diff --git a/lib/js/Dict.js b/lib/js/Stdlib_Dict.js similarity index 100% rename from lib/js/Dict.js rename to lib/js/Stdlib_Dict.js diff --git a/lib/js/Error.js b/lib/js/Stdlib_Error.js similarity index 100% rename from lib/js/Error.js rename to lib/js/Stdlib_Error.js diff --git a/lib/js/Exn.js b/lib/js/Stdlib_Exn.js similarity index 100% rename from lib/js/Exn.js rename to lib/js/Stdlib_Exn.js diff --git a/lib/js/Float.js b/lib/js/Stdlib_Float.js similarity index 100% rename from lib/js/Float.js rename to lib/js/Stdlib_Float.js diff --git a/lib/js/Float32Array.js b/lib/js/Stdlib_Float32Array.js similarity index 100% rename from lib/js/Float32Array.js rename to lib/js/Stdlib_Float32Array.js diff --git a/lib/js/Float64Array.js b/lib/js/Stdlib_Float64Array.js similarity index 100% rename from lib/js/Float64Array.js rename to lib/js/Stdlib_Float64Array.js diff --git a/lib/js/Intl_Common.js b/lib/js/Stdlib_Global.js similarity index 100% rename from lib/js/Intl_Common.js rename to lib/js/Stdlib_Global.js diff --git a/lib/js/Int.js b/lib/js/Stdlib_Int.js similarity index 92% rename from lib/js/Int.js rename to lib/js/Stdlib_Int.js index 147f1cef99..44c2f7080d 100644 --- a/lib/js/Int.js +++ b/lib/js/Stdlib_Int.js @@ -1,6 +1,6 @@ 'use strict'; -let $$Array = require("./Array.js"); +let Stdlib_Array = require("./Stdlib_Array.js"); function fromString(x, radix) { let maybeInt = radix !== undefined ? parseInt(x, radix) : parseInt(x); @@ -46,7 +46,7 @@ function range(start, end, optionsOpt) { let range$2 = options.inclusive === true ? range$1 + 1 | 0 : range$1; length = Math.ceil(range$2 / abs(step)) | 0; } - return $$Array.fromInitializer(length, i => start + Math.imul(i, step) | 0); + return Stdlib_Array.fromInitializer(length, i => start + Math.imul(i, step) | 0); } function rangeWithOptions(start, end, options) { diff --git a/lib/js/Int16Array.js b/lib/js/Stdlib_Int16Array.js similarity index 100% rename from lib/js/Int16Array.js rename to lib/js/Stdlib_Int16Array.js diff --git a/lib/js/Int32Array.js b/lib/js/Stdlib_Int32Array.js similarity index 100% rename from lib/js/Int32Array.js rename to lib/js/Stdlib_Int32Array.js diff --git a/lib/js/Int8Array.js b/lib/js/Stdlib_Int8Array.js similarity index 100% rename from lib/js/Int8Array.js rename to lib/js/Stdlib_Int8Array.js diff --git a/lib/js/Intl.js b/lib/js/Stdlib_Intl.js similarity index 100% rename from lib/js/Intl.js rename to lib/js/Stdlib_Intl.js diff --git a/lib/js/Intl_DateTimeFormat.js b/lib/js/Stdlib_Intl_Collator.js similarity index 100% rename from lib/js/Intl_DateTimeFormat.js rename to lib/js/Stdlib_Intl_Collator.js diff --git a/lib/js/Intl_ListFormat.js b/lib/js/Stdlib_Intl_Common.js similarity index 100% rename from lib/js/Intl_ListFormat.js rename to lib/js/Stdlib_Intl_Common.js diff --git a/lib/js/Intl_Locale.js b/lib/js/Stdlib_Intl_DateTimeFormat.js similarity index 100% rename from lib/js/Intl_Locale.js rename to lib/js/Stdlib_Intl_DateTimeFormat.js diff --git a/lib/js/Intl_PluralRules.js b/lib/js/Stdlib_Intl_ListFormat.js similarity index 100% rename from lib/js/Intl_PluralRules.js rename to lib/js/Stdlib_Intl_ListFormat.js diff --git a/lib/js/Intl_RelativeTimeFormat.js b/lib/js/Stdlib_Intl_Locale.js similarity index 100% rename from lib/js/Intl_RelativeTimeFormat.js rename to lib/js/Stdlib_Intl_Locale.js diff --git a/lib/js/Intl_NumberFormat.js b/lib/js/Stdlib_Intl_NumberFormat.js similarity index 100% rename from lib/js/Intl_NumberFormat.js rename to lib/js/Stdlib_Intl_NumberFormat.js diff --git a/lib/js/Intl_NumberFormat_Grouping.js b/lib/js/Stdlib_Intl_NumberFormat_Grouping.js similarity index 84% rename from lib/js/Intl_NumberFormat_Grouping.js rename to lib/js/Stdlib_Intl_NumberFormat_Grouping.js index 56dd9f43eb..885d7bea82 100644 --- a/lib/js/Intl_NumberFormat_Grouping.js +++ b/lib/js/Stdlib_Intl_NumberFormat_Grouping.js @@ -1,9 +1,9 @@ 'use strict'; -let Type = require("./Type.js"); +let Stdlib_Type = require("./Stdlib_Type.js"); function parseJsValue(value) { - let value$1 = Type.Classify.classify(value); + let value$1 = Stdlib_Type.Classify.classify(value); if (typeof value$1 !== "object") { return; } diff --git a/lib/js/Intl_Segmenter.js b/lib/js/Stdlib_Intl_PluralRules.js similarity index 100% rename from lib/js/Intl_Segmenter.js rename to lib/js/Stdlib_Intl_PluralRules.js diff --git a/lib/js/Intl_Segments.js b/lib/js/Stdlib_Intl_RelativeTimeFormat.js similarity index 100% rename from lib/js/Intl_Segments.js rename to lib/js/Stdlib_Intl_RelativeTimeFormat.js diff --git a/lib/js/Map.js b/lib/js/Stdlib_Intl_Segmenter.js similarity index 100% rename from lib/js/Map.js rename to lib/js/Stdlib_Intl_Segmenter.js diff --git a/lib/js/Object.js b/lib/js/Stdlib_Intl_Segments.js similarity index 100% rename from lib/js/Object.js rename to lib/js/Stdlib_Intl_Segments.js diff --git a/lib/js/Iterator.js b/lib/js/Stdlib_Iterator.js similarity index 100% rename from lib/js/Iterator.js rename to lib/js/Stdlib_Iterator.js diff --git a/lib/js/JSON.js b/lib/js/Stdlib_JSON.js similarity index 100% rename from lib/js/JSON.js rename to lib/js/Stdlib_JSON.js diff --git a/lib/js/List.js b/lib/js/Stdlib_List.js similarity index 99% rename from lib/js/List.js rename to lib/js/Stdlib_List.js index b11ab0d3ff..18bca71af4 100644 --- a/lib/js/List.js +++ b/lib/js/Stdlib_List.js @@ -1,6 +1,6 @@ 'use strict'; -let $$Array = require("./Array.js"); +let Stdlib_Array = require("./Stdlib_Array.js"); let Primitive_int = require("./Primitive_int.js"); let Primitive_option = require("./Primitive_option.js"); @@ -648,7 +648,7 @@ function toArray(x) { function toShuffled(xs) { let v = toArray(xs); - $$Array.shuffle(v); + Stdlib_Array.shuffle(v); return fromArray(v); } diff --git a/lib/js/Set.js b/lib/js/Stdlib_Map.js similarity index 100% rename from lib/js/Set.js rename to lib/js/Stdlib_Map.js diff --git a/lib/js/Math.js b/lib/js/Stdlib_Math.js similarity index 100% rename from lib/js/Math.js rename to lib/js/Stdlib_Math.js diff --git a/lib/js/Null.js b/lib/js/Stdlib_Null.js similarity index 81% rename from lib/js/Null.js rename to lib/js/Stdlib_Null.js index 701d356403..19f2353d5a 100644 --- a/lib/js/Null.js +++ b/lib/js/Stdlib_Null.js @@ -1,6 +1,6 @@ 'use strict'; -let Option = require("./Option.js"); +let Stdlib_Option = require("./Stdlib_Option.js"); let Primitive_option = require("./Primitive_option.js"); function fromOption(option) { @@ -12,11 +12,11 @@ function fromOption(option) { } function equal(a, b, eq) { - return Option.equal(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), eq); + return Stdlib_Option.equal(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), eq); } function compare(a, b, cmp) { - return Option.compare(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), cmp); + return Stdlib_Option.compare(a === null ? undefined : Primitive_option.some(a), b === null ? undefined : Primitive_option.some(b), cmp); } function getOr(value, $$default) { diff --git a/lib/js/Nullable.js b/lib/js/Stdlib_Nullable.js similarity index 80% rename from lib/js/Nullable.js rename to lib/js/Stdlib_Nullable.js index d89d21173f..bae5ec43c6 100644 --- a/lib/js/Nullable.js +++ b/lib/js/Stdlib_Nullable.js @@ -1,6 +1,6 @@ 'use strict'; -let Option = require("./Option.js"); +let Stdlib_Option = require("./Stdlib_Option.js"); let Primitive_option = require("./Primitive_option.js"); function fromOption(option) { @@ -11,11 +11,11 @@ function fromOption(option) { } function equal(a, b, eq) { - return Option.equal((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), eq); + return Stdlib_Option.equal((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), eq); } function compare(a, b, cmp) { - return Option.compare((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), cmp); + return Stdlib_Option.compare((a == null) ? undefined : Primitive_option.some(a), (b == null) ? undefined : Primitive_option.some(b), cmp); } function getOr(value, $$default) { diff --git a/lib/js/Symbol.js b/lib/js/Stdlib_Object.js similarity index 100% rename from lib/js/Symbol.js rename to lib/js/Stdlib_Object.js diff --git a/lib/js/Option.js b/lib/js/Stdlib_Option.js similarity index 96% rename from lib/js/Option.js rename to lib/js/Stdlib_Option.js index ffa98d5746..ae2a98a30c 100644 --- a/lib/js/Option.js +++ b/lib/js/Stdlib_Option.js @@ -1,6 +1,6 @@ 'use strict'; -let $$Error = require("./Error.js"); +let Stdlib_Error = require("./Stdlib_Error.js"); let Primitive_option = require("./Primitive_option.js"); function filter(opt, p) { @@ -21,7 +21,7 @@ function getExn(x, message) { if (x !== undefined) { return Primitive_option.valFromOption(x); } else { - return $$Error.panic(message !== undefined ? message : "Option.getExn called for None value"); + return Stdlib_Error.panic(message !== undefined ? message : "Option.getExn called for None value"); } } diff --git a/lib/js/Ordering.js b/lib/js/Stdlib_Ordering.js similarity index 100% rename from lib/js/Ordering.js rename to lib/js/Stdlib_Ordering.js diff --git a/lib/js/Promise.js b/lib/js/Stdlib_Promise.js similarity index 100% rename from lib/js/Promise.js rename to lib/js/Stdlib_Promise.js diff --git a/lib/js/RegExp.js b/lib/js/Stdlib_RegExp.js similarity index 100% rename from lib/js/RegExp.js rename to lib/js/Stdlib_RegExp.js diff --git a/lib/js/Result.js b/lib/js/Stdlib_Result.js similarity index 100% rename from lib/js/Result.js rename to lib/js/Stdlib_Result.js diff --git a/lib/js/TypedArray.js b/lib/js/Stdlib_Set.js similarity index 100% rename from lib/js/TypedArray.js rename to lib/js/Stdlib_Set.js diff --git a/lib/js/String.js b/lib/js/Stdlib_String.js similarity index 100% rename from lib/js/String.js rename to lib/js/Stdlib_String.js diff --git a/lib/js/WeakMap.js b/lib/js/Stdlib_Symbol.js similarity index 100% rename from lib/js/WeakMap.js rename to lib/js/Stdlib_Symbol.js diff --git a/lib/js/Type.js b/lib/js/Stdlib_Type.js similarity index 100% rename from lib/js/Type.js rename to lib/js/Stdlib_Type.js diff --git a/lib/js/WeakSet.js b/lib/js/Stdlib_TypedArray.js similarity index 100% rename from lib/js/WeakSet.js rename to lib/js/Stdlib_TypedArray.js diff --git a/lib/js/Uint16Array.js b/lib/js/Stdlib_Uint16Array.js similarity index 100% rename from lib/js/Uint16Array.js rename to lib/js/Stdlib_Uint16Array.js diff --git a/lib/js/Uint32Array.js b/lib/js/Stdlib_Uint32Array.js similarity index 100% rename from lib/js/Uint32Array.js rename to lib/js/Stdlib_Uint32Array.js diff --git a/lib/js/Uint8Array.js b/lib/js/Stdlib_Uint8Array.js similarity index 100% rename from lib/js/Uint8Array.js rename to lib/js/Stdlib_Uint8Array.js diff --git a/lib/js/Uint8ClampedArray.js b/lib/js/Stdlib_Uint8ClampedArray.js similarity index 100% rename from lib/js/Uint8ClampedArray.js rename to lib/js/Stdlib_Uint8ClampedArray.js diff --git a/lib/js/Stdlib_WeakMap.js b/lib/js/Stdlib_WeakMap.js new file mode 100644 index 0000000000..ae1b9f17e6 --- /dev/null +++ b/lib/js/Stdlib_WeakMap.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/Stdlib_WeakSet.js b/lib/js/Stdlib_WeakSet.js new file mode 100644 index 0000000000..ae1b9f17e6 --- /dev/null +++ b/lib/js/Stdlib_WeakSet.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/packages/artifacts.txt b/packages/artifacts.txt index 7ed7e6d183..d98468c585 100644 --- a/packages/artifacts.txt +++ b/packages/artifacts.txt @@ -30,9 +30,6 @@ darwinarm64/rescript.exe darwinarm64/rewatch.exe docs/docson/build-schema.json lib/bstracing -lib/es6/Array.js -lib/es6/ArrayBuffer.js -lib/es6/AsyncIterator.js lib/es6/Belt.js lib/es6/Belt_Array.js lib/es6/Belt_Float.js @@ -76,40 +73,10 @@ lib/es6/Belt_internalMapString.js lib/es6/Belt_internalSetBuckets.js lib/es6/Belt_internalSetInt.js lib/es6/Belt_internalSetString.js -lib/es6/BigInt.js -lib/es6/BigInt64Array.js -lib/es6/BigUint64Array.js lib/es6/Char.js -lib/es6/Console.js -lib/es6/DataView.js -lib/es6/Date.js -lib/es6/Dict.js lib/es6/Dom.js lib/es6/Dom_storage.js lib/es6/Dom_storage2.js -lib/es6/Error.js -lib/es6/Exn.js -lib/es6/Float.js -lib/es6/Float32Array.js -lib/es6/Float64Array.js -lib/es6/Int.js -lib/es6/Int16Array.js -lib/es6/Int32Array.js -lib/es6/Int8Array.js -lib/es6/Intl.js -lib/es6/Intl_Collator.js -lib/es6/Intl_Common.js -lib/es6/Intl_DateTimeFormat.js -lib/es6/Intl_ListFormat.js -lib/es6/Intl_Locale.js -lib/es6/Intl_NumberFormat.js -lib/es6/Intl_NumberFormat_Grouping.js -lib/es6/Intl_PluralRules.js -lib/es6/Intl_RelativeTimeFormat.js -lib/es6/Intl_Segmenter.js -lib/es6/Intl_Segments.js -lib/es6/Iterator.js -lib/es6/JSON.js lib/es6/Js.js lib/es6/Js_OO.js lib/es6/Js_array.js @@ -150,15 +117,7 @@ lib/es6/JsxDOMStyle.js lib/es6/JsxEvent.js lib/es6/JsxPPXReactSupport.js lib/es6/Lazy.js -lib/es6/List.js -lib/es6/Map.js -lib/es6/Math.js -lib/es6/Null.js -lib/es6/Nullable.js lib/es6/Obj.js -lib/es6/Object.js -lib/es6/Option.js -lib/es6/Ordering.js lib/es6/Pervasives.js lib/es6/Primitive_array.js lib/es6/Primitive_array_extern.js @@ -183,26 +142,66 @@ lib/es6/Primitive_promise.js lib/es6/Primitive_string.js lib/es6/Primitive_string_extern.js lib/es6/Primitive_util.js -lib/es6/Promise.js -lib/es6/RegExp.js lib/es6/RescriptTools.js lib/es6/RescriptTools_Docgen.js -lib/es6/Result.js -lib/es6/Set.js -lib/es6/String.js -lib/es6/Symbol.js -lib/es6/Type.js -lib/es6/TypedArray.js -lib/es6/Uint16Array.js -lib/es6/Uint32Array.js -lib/es6/Uint8Array.js -lib/es6/Uint8ClampedArray.js -lib/es6/WeakMap.js -lib/es6/WeakSet.js +lib/es6/Stdlib.js +lib/es6/Stdlib_Array.js +lib/es6/Stdlib_ArrayBuffer.js +lib/es6/Stdlib_AsyncIterator.js +lib/es6/Stdlib_BigInt.js +lib/es6/Stdlib_BigInt64Array.js +lib/es6/Stdlib_BigUint64Array.js +lib/es6/Stdlib_Console.js +lib/es6/Stdlib_DataView.js +lib/es6/Stdlib_Date.js +lib/es6/Stdlib_Dict.js +lib/es6/Stdlib_Error.js +lib/es6/Stdlib_Exn.js +lib/es6/Stdlib_Float.js +lib/es6/Stdlib_Float32Array.js +lib/es6/Stdlib_Float64Array.js +lib/es6/Stdlib_Global.js +lib/es6/Stdlib_Int.js +lib/es6/Stdlib_Int16Array.js +lib/es6/Stdlib_Int32Array.js +lib/es6/Stdlib_Int8Array.js +lib/es6/Stdlib_Intl.js +lib/es6/Stdlib_Intl_Collator.js +lib/es6/Stdlib_Intl_Common.js +lib/es6/Stdlib_Intl_DateTimeFormat.js +lib/es6/Stdlib_Intl_ListFormat.js +lib/es6/Stdlib_Intl_Locale.js +lib/es6/Stdlib_Intl_NumberFormat.js +lib/es6/Stdlib_Intl_NumberFormat_Grouping.js +lib/es6/Stdlib_Intl_PluralRules.js +lib/es6/Stdlib_Intl_RelativeTimeFormat.js +lib/es6/Stdlib_Intl_Segmenter.js +lib/es6/Stdlib_Intl_Segments.js +lib/es6/Stdlib_Iterator.js +lib/es6/Stdlib_JSON.js +lib/es6/Stdlib_List.js +lib/es6/Stdlib_Map.js +lib/es6/Stdlib_Math.js +lib/es6/Stdlib_Null.js +lib/es6/Stdlib_Nullable.js +lib/es6/Stdlib_Object.js +lib/es6/Stdlib_Option.js +lib/es6/Stdlib_Ordering.js +lib/es6/Stdlib_Promise.js +lib/es6/Stdlib_RegExp.js +lib/es6/Stdlib_Result.js +lib/es6/Stdlib_Set.js +lib/es6/Stdlib_String.js +lib/es6/Stdlib_Symbol.js +lib/es6/Stdlib_Type.js +lib/es6/Stdlib_TypedArray.js +lib/es6/Stdlib_Uint16Array.js +lib/es6/Stdlib_Uint32Array.js +lib/es6/Stdlib_Uint8Array.js +lib/es6/Stdlib_Uint8ClampedArray.js +lib/es6/Stdlib_WeakMap.js +lib/es6/Stdlib_WeakSet.js lib/es6/package.json -lib/js/Array.js -lib/js/ArrayBuffer.js -lib/js/AsyncIterator.js lib/js/Belt.js lib/js/Belt_Array.js lib/js/Belt_Float.js @@ -246,40 +245,10 @@ lib/js/Belt_internalMapString.js lib/js/Belt_internalSetBuckets.js lib/js/Belt_internalSetInt.js lib/js/Belt_internalSetString.js -lib/js/BigInt.js -lib/js/BigInt64Array.js -lib/js/BigUint64Array.js lib/js/Char.js -lib/js/Console.js -lib/js/DataView.js -lib/js/Date.js -lib/js/Dict.js lib/js/Dom.js lib/js/Dom_storage.js lib/js/Dom_storage2.js -lib/js/Error.js -lib/js/Exn.js -lib/js/Float.js -lib/js/Float32Array.js -lib/js/Float64Array.js -lib/js/Int.js -lib/js/Int16Array.js -lib/js/Int32Array.js -lib/js/Int8Array.js -lib/js/Intl.js -lib/js/Intl_Collator.js -lib/js/Intl_Common.js -lib/js/Intl_DateTimeFormat.js -lib/js/Intl_ListFormat.js -lib/js/Intl_Locale.js -lib/js/Intl_NumberFormat.js -lib/js/Intl_NumberFormat_Grouping.js -lib/js/Intl_PluralRules.js -lib/js/Intl_RelativeTimeFormat.js -lib/js/Intl_Segmenter.js -lib/js/Intl_Segments.js -lib/js/Iterator.js -lib/js/JSON.js lib/js/Js.js lib/js/Js_OO.js lib/js/Js_array.js @@ -320,15 +289,7 @@ lib/js/JsxDOMStyle.js lib/js/JsxEvent.js lib/js/JsxPPXReactSupport.js lib/js/Lazy.js -lib/js/List.js -lib/js/Map.js -lib/js/Math.js -lib/js/Null.js -lib/js/Nullable.js lib/js/Obj.js -lib/js/Object.js -lib/js/Option.js -lib/js/Ordering.js lib/js/Pervasives.js lib/js/Primitive_array.js lib/js/Primitive_array_extern.js @@ -353,39 +314,66 @@ lib/js/Primitive_promise.js lib/js/Primitive_string.js lib/js/Primitive_string_extern.js lib/js/Primitive_util.js -lib/js/Promise.js -lib/js/RegExp.js lib/js/RescriptTools.js lib/js/RescriptTools_Docgen.js -lib/js/Result.js -lib/js/Set.js -lib/js/String.js -lib/js/Symbol.js -lib/js/Type.js -lib/js/TypedArray.js -lib/js/Uint16Array.js -lib/js/Uint32Array.js -lib/js/Uint8Array.js -lib/js/Uint8ClampedArray.js -lib/js/WeakMap.js -lib/js/WeakSet.js +lib/js/Stdlib.js +lib/js/Stdlib_Array.js +lib/js/Stdlib_ArrayBuffer.js +lib/js/Stdlib_AsyncIterator.js +lib/js/Stdlib_BigInt.js +lib/js/Stdlib_BigInt64Array.js +lib/js/Stdlib_BigUint64Array.js +lib/js/Stdlib_Console.js +lib/js/Stdlib_DataView.js +lib/js/Stdlib_Date.js +lib/js/Stdlib_Dict.js +lib/js/Stdlib_Error.js +lib/js/Stdlib_Exn.js +lib/js/Stdlib_Float.js +lib/js/Stdlib_Float32Array.js +lib/js/Stdlib_Float64Array.js +lib/js/Stdlib_Global.js +lib/js/Stdlib_Int.js +lib/js/Stdlib_Int16Array.js +lib/js/Stdlib_Int32Array.js +lib/js/Stdlib_Int8Array.js +lib/js/Stdlib_Intl.js +lib/js/Stdlib_Intl_Collator.js +lib/js/Stdlib_Intl_Common.js +lib/js/Stdlib_Intl_DateTimeFormat.js +lib/js/Stdlib_Intl_ListFormat.js +lib/js/Stdlib_Intl_Locale.js +lib/js/Stdlib_Intl_NumberFormat.js +lib/js/Stdlib_Intl_NumberFormat_Grouping.js +lib/js/Stdlib_Intl_PluralRules.js +lib/js/Stdlib_Intl_RelativeTimeFormat.js +lib/js/Stdlib_Intl_Segmenter.js +lib/js/Stdlib_Intl_Segments.js +lib/js/Stdlib_Iterator.js +lib/js/Stdlib_JSON.js +lib/js/Stdlib_List.js +lib/js/Stdlib_Map.js +lib/js/Stdlib_Math.js +lib/js/Stdlib_Null.js +lib/js/Stdlib_Nullable.js +lib/js/Stdlib_Object.js +lib/js/Stdlib_Option.js +lib/js/Stdlib_Ordering.js +lib/js/Stdlib_Promise.js +lib/js/Stdlib_RegExp.js +lib/js/Stdlib_Result.js +lib/js/Stdlib_Set.js +lib/js/Stdlib_String.js +lib/js/Stdlib_Symbol.js +lib/js/Stdlib_Type.js +lib/js/Stdlib_TypedArray.js +lib/js/Stdlib_Uint16Array.js +lib/js/Stdlib_Uint32Array.js +lib/js/Stdlib_Uint8Array.js +lib/js/Stdlib_Uint8ClampedArray.js +lib/js/Stdlib_WeakMap.js +lib/js/Stdlib_WeakSet.js lib/minisocket.js -lib/ocaml/Array.cmi -lib/ocaml/Array.cmj -lib/ocaml/Array.cmt -lib/ocaml/Array.cmti -lib/ocaml/Array.res -lib/ocaml/Array.resi -lib/ocaml/ArrayBuffer.cmi -lib/ocaml/ArrayBuffer.cmj -lib/ocaml/ArrayBuffer.cmt -lib/ocaml/ArrayBuffer.res -lib/ocaml/AsyncIterator.cmi -lib/ocaml/AsyncIterator.cmj -lib/ocaml/AsyncIterator.cmt -lib/ocaml/AsyncIterator.cmti -lib/ocaml/AsyncIterator.res -lib/ocaml/AsyncIterator.resi lib/ocaml/Belt.cmi lib/ocaml/Belt.cmj lib/ocaml/Belt.cmt @@ -634,46 +622,12 @@ lib/ocaml/Belt_internalSetString.cmi lib/ocaml/Belt_internalSetString.cmj lib/ocaml/Belt_internalSetString.cmt lib/ocaml/Belt_internalSetString.res -lib/ocaml/BigInt.cmi -lib/ocaml/BigInt.cmj -lib/ocaml/BigInt.cmt -lib/ocaml/BigInt.res -lib/ocaml/BigInt64Array.cmi -lib/ocaml/BigInt64Array.cmj -lib/ocaml/BigInt64Array.cmt -lib/ocaml/BigInt64Array.res -lib/ocaml/BigUint64Array.cmi -lib/ocaml/BigUint64Array.cmj -lib/ocaml/BigUint64Array.cmt -lib/ocaml/BigUint64Array.res lib/ocaml/Char.cmi lib/ocaml/Char.cmj lib/ocaml/Char.cmt lib/ocaml/Char.cmti lib/ocaml/Char.res lib/ocaml/Char.resi -lib/ocaml/Console.cmi -lib/ocaml/Console.cmj -lib/ocaml/Console.cmt -lib/ocaml/Console.cmti -lib/ocaml/Console.res -lib/ocaml/Console.resi -lib/ocaml/DataView.cmi -lib/ocaml/DataView.cmj -lib/ocaml/DataView.cmt -lib/ocaml/DataView.res -lib/ocaml/Date.cmi -lib/ocaml/Date.cmj -lib/ocaml/Date.cmt -lib/ocaml/Date.cmti -lib/ocaml/Date.res -lib/ocaml/Date.resi -lib/ocaml/Dict.cmi -lib/ocaml/Dict.cmj -lib/ocaml/Dict.cmt -lib/ocaml/Dict.cmti -lib/ocaml/Dict.res -lib/ocaml/Dict.resi lib/ocaml/Dom.cmi lib/ocaml/Dom.cmj lib/ocaml/Dom.cmt @@ -686,110 +640,6 @@ lib/ocaml/Dom_storage2.cmi lib/ocaml/Dom_storage2.cmj lib/ocaml/Dom_storage2.cmt lib/ocaml/Dom_storage2.res -lib/ocaml/Error.cmi -lib/ocaml/Error.cmj -lib/ocaml/Error.cmt -lib/ocaml/Error.cmti -lib/ocaml/Error.res -lib/ocaml/Error.resi -lib/ocaml/Exn.cmi -lib/ocaml/Exn.cmj -lib/ocaml/Exn.cmt -lib/ocaml/Exn.cmti -lib/ocaml/Exn.res -lib/ocaml/Exn.resi -lib/ocaml/Float.cmi -lib/ocaml/Float.cmj -lib/ocaml/Float.cmt -lib/ocaml/Float.cmti -lib/ocaml/Float.res -lib/ocaml/Float.resi -lib/ocaml/Float32Array.cmi -lib/ocaml/Float32Array.cmj -lib/ocaml/Float32Array.cmt -lib/ocaml/Float32Array.res -lib/ocaml/Float64Array.cmi -lib/ocaml/Float64Array.cmj -lib/ocaml/Float64Array.cmt -lib/ocaml/Float64Array.res -lib/ocaml/Int.cmi -lib/ocaml/Int.cmj -lib/ocaml/Int.cmt -lib/ocaml/Int.cmti -lib/ocaml/Int.res -lib/ocaml/Int.resi -lib/ocaml/Int16Array.cmi -lib/ocaml/Int16Array.cmj -lib/ocaml/Int16Array.cmt -lib/ocaml/Int16Array.res -lib/ocaml/Int32Array.cmi -lib/ocaml/Int32Array.cmj -lib/ocaml/Int32Array.cmt -lib/ocaml/Int32Array.res -lib/ocaml/Int8Array.cmi -lib/ocaml/Int8Array.cmj -lib/ocaml/Int8Array.cmt -lib/ocaml/Int8Array.res -lib/ocaml/Intl.cmi -lib/ocaml/Intl.cmj -lib/ocaml/Intl.cmt -lib/ocaml/Intl.res -lib/ocaml/Intl_Collator.cmi -lib/ocaml/Intl_Collator.cmj -lib/ocaml/Intl_Collator.cmt -lib/ocaml/Intl_Collator.res -lib/ocaml/Intl_Common.cmi -lib/ocaml/Intl_Common.cmj -lib/ocaml/Intl_Common.cmt -lib/ocaml/Intl_Common.res -lib/ocaml/Intl_DateTimeFormat.cmi -lib/ocaml/Intl_DateTimeFormat.cmj -lib/ocaml/Intl_DateTimeFormat.cmt -lib/ocaml/Intl_DateTimeFormat.res -lib/ocaml/Intl_ListFormat.cmi -lib/ocaml/Intl_ListFormat.cmj -lib/ocaml/Intl_ListFormat.cmt -lib/ocaml/Intl_ListFormat.res -lib/ocaml/Intl_Locale.cmi -lib/ocaml/Intl_Locale.cmj -lib/ocaml/Intl_Locale.cmt -lib/ocaml/Intl_Locale.res -lib/ocaml/Intl_NumberFormat.cmi -lib/ocaml/Intl_NumberFormat.cmj -lib/ocaml/Intl_NumberFormat.cmt -lib/ocaml/Intl_NumberFormat.res -lib/ocaml/Intl_NumberFormat_Grouping.cmi -lib/ocaml/Intl_NumberFormat_Grouping.cmj -lib/ocaml/Intl_NumberFormat_Grouping.cmt -lib/ocaml/Intl_NumberFormat_Grouping.res -lib/ocaml/Intl_PluralRules.cmi -lib/ocaml/Intl_PluralRules.cmj -lib/ocaml/Intl_PluralRules.cmt -lib/ocaml/Intl_PluralRules.res -lib/ocaml/Intl_RelativeTimeFormat.cmi -lib/ocaml/Intl_RelativeTimeFormat.cmj -lib/ocaml/Intl_RelativeTimeFormat.cmt -lib/ocaml/Intl_RelativeTimeFormat.res -lib/ocaml/Intl_Segmenter.cmi -lib/ocaml/Intl_Segmenter.cmj -lib/ocaml/Intl_Segmenter.cmt -lib/ocaml/Intl_Segmenter.res -lib/ocaml/Intl_Segments.cmi -lib/ocaml/Intl_Segments.cmj -lib/ocaml/Intl_Segments.cmt -lib/ocaml/Intl_Segments.res -lib/ocaml/Iterator.cmi -lib/ocaml/Iterator.cmj -lib/ocaml/Iterator.cmt -lib/ocaml/Iterator.cmti -lib/ocaml/Iterator.res -lib/ocaml/Iterator.resi -lib/ocaml/JSON.cmi -lib/ocaml/JSON.cmj -lib/ocaml/JSON.cmt -lib/ocaml/JSON.cmti -lib/ocaml/JSON.res -lib/ocaml/JSON.resi lib/ocaml/Js.cmi lib/ocaml/Js.cmj lib/ocaml/Js.cmt @@ -968,54 +818,10 @@ lib/ocaml/Lazy.cmt lib/ocaml/Lazy.cmti lib/ocaml/Lazy.res lib/ocaml/Lazy.resi -lib/ocaml/List.cmi -lib/ocaml/List.cmj -lib/ocaml/List.cmt -lib/ocaml/List.cmti -lib/ocaml/List.res -lib/ocaml/List.resi -lib/ocaml/Map.cmi -lib/ocaml/Map.cmj -lib/ocaml/Map.cmt -lib/ocaml/Map.cmti -lib/ocaml/Map.res -lib/ocaml/Map.resi -lib/ocaml/Math.cmi -lib/ocaml/Math.cmj -lib/ocaml/Math.cmt -lib/ocaml/Math.cmti -lib/ocaml/Math.res -lib/ocaml/Math.resi -lib/ocaml/Null.cmi -lib/ocaml/Null.cmj -lib/ocaml/Null.cmt -lib/ocaml/Null.cmti -lib/ocaml/Null.res -lib/ocaml/Null.resi -lib/ocaml/Nullable.cmi -lib/ocaml/Nullable.cmj -lib/ocaml/Nullable.cmt -lib/ocaml/Nullable.cmti -lib/ocaml/Nullable.res -lib/ocaml/Nullable.resi lib/ocaml/Obj.cmi lib/ocaml/Obj.cmj lib/ocaml/Obj.cmt lib/ocaml/Obj.res -lib/ocaml/Object.cmi -lib/ocaml/Object.cmj -lib/ocaml/Object.cmt -lib/ocaml/Object.res -lib/ocaml/Option.cmi -lib/ocaml/Option.cmj -lib/ocaml/Option.cmt -lib/ocaml/Option.cmti -lib/ocaml/Option.res -lib/ocaml/Option.resi -lib/ocaml/Ordering.cmi -lib/ocaml/Ordering.cmj -lib/ocaml/Ordering.cmt -lib/ocaml/Ordering.res lib/ocaml/Pervasives.cmi lib/ocaml/Pervasives.cmj lib/ocaml/Pervasives.cmt @@ -1126,18 +932,6 @@ lib/ocaml/Primitive_util.cmi lib/ocaml/Primitive_util.cmj lib/ocaml/Primitive_util.cmt lib/ocaml/Primitive_util.res -lib/ocaml/Promise.cmi -lib/ocaml/Promise.cmj -lib/ocaml/Promise.cmt -lib/ocaml/Promise.cmti -lib/ocaml/Promise.res -lib/ocaml/Promise.resi -lib/ocaml/RegExp.cmi -lib/ocaml/RegExp.cmj -lib/ocaml/RegExp.cmt -lib/ocaml/RegExp.cmti -lib/ocaml/RegExp.res -lib/ocaml/RegExp.resi lib/ocaml/RescriptTools.cmi lib/ocaml/RescriptTools.cmj lib/ocaml/RescriptTools.cmt @@ -1148,62 +942,282 @@ lib/ocaml/RescriptTools_Docgen.cmt lib/ocaml/RescriptTools_Docgen.cmti lib/ocaml/RescriptTools_Docgen.res lib/ocaml/RescriptTools_Docgen.resi -lib/ocaml/Result.cmi -lib/ocaml/Result.cmj -lib/ocaml/Result.cmt -lib/ocaml/Result.cmti -lib/ocaml/Result.res -lib/ocaml/Result.resi -lib/ocaml/Set.cmi -lib/ocaml/Set.cmj -lib/ocaml/Set.cmt -lib/ocaml/Set.cmti -lib/ocaml/Set.res -lib/ocaml/Set.resi -lib/ocaml/String.cmi -lib/ocaml/String.cmj -lib/ocaml/String.cmt -lib/ocaml/String.cmti -lib/ocaml/String.res -lib/ocaml/String.resi -lib/ocaml/Symbol.cmi -lib/ocaml/Symbol.cmj -lib/ocaml/Symbol.cmt -lib/ocaml/Symbol.res -lib/ocaml/Type.cmi -lib/ocaml/Type.cmj -lib/ocaml/Type.cmt -lib/ocaml/Type.cmti -lib/ocaml/Type.res -lib/ocaml/Type.resi -lib/ocaml/TypedArray.cmi -lib/ocaml/TypedArray.cmj -lib/ocaml/TypedArray.cmt -lib/ocaml/TypedArray.res -lib/ocaml/Uint16Array.cmi -lib/ocaml/Uint16Array.cmj -lib/ocaml/Uint16Array.cmt -lib/ocaml/Uint16Array.res -lib/ocaml/Uint32Array.cmi -lib/ocaml/Uint32Array.cmj -lib/ocaml/Uint32Array.cmt -lib/ocaml/Uint32Array.res -lib/ocaml/Uint8Array.cmi -lib/ocaml/Uint8Array.cmj -lib/ocaml/Uint8Array.cmt -lib/ocaml/Uint8Array.res -lib/ocaml/Uint8ClampedArray.cmi -lib/ocaml/Uint8ClampedArray.cmj -lib/ocaml/Uint8ClampedArray.cmt -lib/ocaml/Uint8ClampedArray.res -lib/ocaml/WeakMap.cmi -lib/ocaml/WeakMap.cmj -lib/ocaml/WeakMap.cmt -lib/ocaml/WeakMap.res -lib/ocaml/WeakSet.cmi -lib/ocaml/WeakSet.cmj -lib/ocaml/WeakSet.cmt -lib/ocaml/WeakSet.res +lib/ocaml/Stdlib.cmi +lib/ocaml/Stdlib.cmj +lib/ocaml/Stdlib.cmt +lib/ocaml/Stdlib.res +lib/ocaml/Stdlib_Array.cmi +lib/ocaml/Stdlib_Array.cmj +lib/ocaml/Stdlib_Array.cmt +lib/ocaml/Stdlib_Array.cmti +lib/ocaml/Stdlib_Array.res +lib/ocaml/Stdlib_Array.resi +lib/ocaml/Stdlib_ArrayBuffer.cmi +lib/ocaml/Stdlib_ArrayBuffer.cmj +lib/ocaml/Stdlib_ArrayBuffer.cmt +lib/ocaml/Stdlib_ArrayBuffer.res +lib/ocaml/Stdlib_AsyncIterator.cmi +lib/ocaml/Stdlib_AsyncIterator.cmj +lib/ocaml/Stdlib_AsyncIterator.cmt +lib/ocaml/Stdlib_AsyncIterator.cmti +lib/ocaml/Stdlib_AsyncIterator.res +lib/ocaml/Stdlib_AsyncIterator.resi +lib/ocaml/Stdlib_BigInt.cmi +lib/ocaml/Stdlib_BigInt.cmj +lib/ocaml/Stdlib_BigInt.cmt +lib/ocaml/Stdlib_BigInt.res +lib/ocaml/Stdlib_BigInt64Array.cmi +lib/ocaml/Stdlib_BigInt64Array.cmj +lib/ocaml/Stdlib_BigInt64Array.cmt +lib/ocaml/Stdlib_BigInt64Array.res +lib/ocaml/Stdlib_BigUint64Array.cmi +lib/ocaml/Stdlib_BigUint64Array.cmj +lib/ocaml/Stdlib_BigUint64Array.cmt +lib/ocaml/Stdlib_BigUint64Array.res +lib/ocaml/Stdlib_Console.cmi +lib/ocaml/Stdlib_Console.cmj +lib/ocaml/Stdlib_Console.cmt +lib/ocaml/Stdlib_Console.cmti +lib/ocaml/Stdlib_Console.res +lib/ocaml/Stdlib_Console.resi +lib/ocaml/Stdlib_DataView.cmi +lib/ocaml/Stdlib_DataView.cmj +lib/ocaml/Stdlib_DataView.cmt +lib/ocaml/Stdlib_DataView.res +lib/ocaml/Stdlib_Date.cmi +lib/ocaml/Stdlib_Date.cmj +lib/ocaml/Stdlib_Date.cmt +lib/ocaml/Stdlib_Date.cmti +lib/ocaml/Stdlib_Date.res +lib/ocaml/Stdlib_Date.resi +lib/ocaml/Stdlib_Dict.cmi +lib/ocaml/Stdlib_Dict.cmj +lib/ocaml/Stdlib_Dict.cmt +lib/ocaml/Stdlib_Dict.cmti +lib/ocaml/Stdlib_Dict.res +lib/ocaml/Stdlib_Dict.resi +lib/ocaml/Stdlib_Error.cmi +lib/ocaml/Stdlib_Error.cmj +lib/ocaml/Stdlib_Error.cmt +lib/ocaml/Stdlib_Error.cmti +lib/ocaml/Stdlib_Error.res +lib/ocaml/Stdlib_Error.resi +lib/ocaml/Stdlib_Exn.cmi +lib/ocaml/Stdlib_Exn.cmj +lib/ocaml/Stdlib_Exn.cmt +lib/ocaml/Stdlib_Exn.cmti +lib/ocaml/Stdlib_Exn.res +lib/ocaml/Stdlib_Exn.resi +lib/ocaml/Stdlib_Float.cmi +lib/ocaml/Stdlib_Float.cmj +lib/ocaml/Stdlib_Float.cmt +lib/ocaml/Stdlib_Float.cmti +lib/ocaml/Stdlib_Float.res +lib/ocaml/Stdlib_Float.resi +lib/ocaml/Stdlib_Float32Array.cmi +lib/ocaml/Stdlib_Float32Array.cmj +lib/ocaml/Stdlib_Float32Array.cmt +lib/ocaml/Stdlib_Float32Array.res +lib/ocaml/Stdlib_Float64Array.cmi +lib/ocaml/Stdlib_Float64Array.cmj +lib/ocaml/Stdlib_Float64Array.cmt +lib/ocaml/Stdlib_Float64Array.res +lib/ocaml/Stdlib_Global.cmi +lib/ocaml/Stdlib_Global.cmj +lib/ocaml/Stdlib_Global.cmt +lib/ocaml/Stdlib_Global.cmti +lib/ocaml/Stdlib_Global.res +lib/ocaml/Stdlib_Global.resi +lib/ocaml/Stdlib_Int.cmi +lib/ocaml/Stdlib_Int.cmj +lib/ocaml/Stdlib_Int.cmt +lib/ocaml/Stdlib_Int.cmti +lib/ocaml/Stdlib_Int.res +lib/ocaml/Stdlib_Int.resi +lib/ocaml/Stdlib_Int16Array.cmi +lib/ocaml/Stdlib_Int16Array.cmj +lib/ocaml/Stdlib_Int16Array.cmt +lib/ocaml/Stdlib_Int16Array.res +lib/ocaml/Stdlib_Int32Array.cmi +lib/ocaml/Stdlib_Int32Array.cmj +lib/ocaml/Stdlib_Int32Array.cmt +lib/ocaml/Stdlib_Int32Array.res +lib/ocaml/Stdlib_Int8Array.cmi +lib/ocaml/Stdlib_Int8Array.cmj +lib/ocaml/Stdlib_Int8Array.cmt +lib/ocaml/Stdlib_Int8Array.res +lib/ocaml/Stdlib_Intl.cmi +lib/ocaml/Stdlib_Intl.cmj +lib/ocaml/Stdlib_Intl.cmt +lib/ocaml/Stdlib_Intl.res +lib/ocaml/Stdlib_Intl_Collator.cmi +lib/ocaml/Stdlib_Intl_Collator.cmj +lib/ocaml/Stdlib_Intl_Collator.cmt +lib/ocaml/Stdlib_Intl_Collator.res +lib/ocaml/Stdlib_Intl_Common.cmi +lib/ocaml/Stdlib_Intl_Common.cmj +lib/ocaml/Stdlib_Intl_Common.cmt +lib/ocaml/Stdlib_Intl_Common.res +lib/ocaml/Stdlib_Intl_DateTimeFormat.cmi +lib/ocaml/Stdlib_Intl_DateTimeFormat.cmj +lib/ocaml/Stdlib_Intl_DateTimeFormat.cmt +lib/ocaml/Stdlib_Intl_DateTimeFormat.res +lib/ocaml/Stdlib_Intl_ListFormat.cmi +lib/ocaml/Stdlib_Intl_ListFormat.cmj +lib/ocaml/Stdlib_Intl_ListFormat.cmt +lib/ocaml/Stdlib_Intl_ListFormat.res +lib/ocaml/Stdlib_Intl_Locale.cmi +lib/ocaml/Stdlib_Intl_Locale.cmj +lib/ocaml/Stdlib_Intl_Locale.cmt +lib/ocaml/Stdlib_Intl_Locale.res +lib/ocaml/Stdlib_Intl_NumberFormat.cmi +lib/ocaml/Stdlib_Intl_NumberFormat.cmj +lib/ocaml/Stdlib_Intl_NumberFormat.cmt +lib/ocaml/Stdlib_Intl_NumberFormat.res +lib/ocaml/Stdlib_Intl_NumberFormat_Grouping.cmi +lib/ocaml/Stdlib_Intl_NumberFormat_Grouping.cmj +lib/ocaml/Stdlib_Intl_NumberFormat_Grouping.cmt +lib/ocaml/Stdlib_Intl_NumberFormat_Grouping.res +lib/ocaml/Stdlib_Intl_PluralRules.cmi +lib/ocaml/Stdlib_Intl_PluralRules.cmj +lib/ocaml/Stdlib_Intl_PluralRules.cmt +lib/ocaml/Stdlib_Intl_PluralRules.res +lib/ocaml/Stdlib_Intl_RelativeTimeFormat.cmi +lib/ocaml/Stdlib_Intl_RelativeTimeFormat.cmj +lib/ocaml/Stdlib_Intl_RelativeTimeFormat.cmt +lib/ocaml/Stdlib_Intl_RelativeTimeFormat.res +lib/ocaml/Stdlib_Intl_Segmenter.cmi +lib/ocaml/Stdlib_Intl_Segmenter.cmj +lib/ocaml/Stdlib_Intl_Segmenter.cmt +lib/ocaml/Stdlib_Intl_Segmenter.res +lib/ocaml/Stdlib_Intl_Segments.cmi +lib/ocaml/Stdlib_Intl_Segments.cmj +lib/ocaml/Stdlib_Intl_Segments.cmt +lib/ocaml/Stdlib_Intl_Segments.res +lib/ocaml/Stdlib_Iterator.cmi +lib/ocaml/Stdlib_Iterator.cmj +lib/ocaml/Stdlib_Iterator.cmt +lib/ocaml/Stdlib_Iterator.cmti +lib/ocaml/Stdlib_Iterator.res +lib/ocaml/Stdlib_Iterator.resi +lib/ocaml/Stdlib_JSON.cmi +lib/ocaml/Stdlib_JSON.cmj +lib/ocaml/Stdlib_JSON.cmt +lib/ocaml/Stdlib_JSON.cmti +lib/ocaml/Stdlib_JSON.res +lib/ocaml/Stdlib_JSON.resi +lib/ocaml/Stdlib_List.cmi +lib/ocaml/Stdlib_List.cmj +lib/ocaml/Stdlib_List.cmt +lib/ocaml/Stdlib_List.cmti +lib/ocaml/Stdlib_List.res +lib/ocaml/Stdlib_List.resi +lib/ocaml/Stdlib_Map.cmi +lib/ocaml/Stdlib_Map.cmj +lib/ocaml/Stdlib_Map.cmt +lib/ocaml/Stdlib_Map.cmti +lib/ocaml/Stdlib_Map.res +lib/ocaml/Stdlib_Map.resi +lib/ocaml/Stdlib_Math.cmi +lib/ocaml/Stdlib_Math.cmj +lib/ocaml/Stdlib_Math.cmt +lib/ocaml/Stdlib_Math.cmti +lib/ocaml/Stdlib_Math.res +lib/ocaml/Stdlib_Math.resi +lib/ocaml/Stdlib_Null.cmi +lib/ocaml/Stdlib_Null.cmj +lib/ocaml/Stdlib_Null.cmt +lib/ocaml/Stdlib_Null.cmti +lib/ocaml/Stdlib_Null.res +lib/ocaml/Stdlib_Null.resi +lib/ocaml/Stdlib_Nullable.cmi +lib/ocaml/Stdlib_Nullable.cmj +lib/ocaml/Stdlib_Nullable.cmt +lib/ocaml/Stdlib_Nullable.cmti +lib/ocaml/Stdlib_Nullable.res +lib/ocaml/Stdlib_Nullable.resi +lib/ocaml/Stdlib_Object.cmi +lib/ocaml/Stdlib_Object.cmj +lib/ocaml/Stdlib_Object.cmt +lib/ocaml/Stdlib_Object.res +lib/ocaml/Stdlib_Option.cmi +lib/ocaml/Stdlib_Option.cmj +lib/ocaml/Stdlib_Option.cmt +lib/ocaml/Stdlib_Option.cmti +lib/ocaml/Stdlib_Option.res +lib/ocaml/Stdlib_Option.resi +lib/ocaml/Stdlib_Ordering.cmi +lib/ocaml/Stdlib_Ordering.cmj +lib/ocaml/Stdlib_Ordering.cmt +lib/ocaml/Stdlib_Ordering.res +lib/ocaml/Stdlib_Promise.cmi +lib/ocaml/Stdlib_Promise.cmj +lib/ocaml/Stdlib_Promise.cmt +lib/ocaml/Stdlib_Promise.cmti +lib/ocaml/Stdlib_Promise.res +lib/ocaml/Stdlib_Promise.resi +lib/ocaml/Stdlib_RegExp.cmi +lib/ocaml/Stdlib_RegExp.cmj +lib/ocaml/Stdlib_RegExp.cmt +lib/ocaml/Stdlib_RegExp.cmti +lib/ocaml/Stdlib_RegExp.res +lib/ocaml/Stdlib_RegExp.resi +lib/ocaml/Stdlib_Result.cmi +lib/ocaml/Stdlib_Result.cmj +lib/ocaml/Stdlib_Result.cmt +lib/ocaml/Stdlib_Result.cmti +lib/ocaml/Stdlib_Result.res +lib/ocaml/Stdlib_Result.resi +lib/ocaml/Stdlib_Set.cmi +lib/ocaml/Stdlib_Set.cmj +lib/ocaml/Stdlib_Set.cmt +lib/ocaml/Stdlib_Set.cmti +lib/ocaml/Stdlib_Set.res +lib/ocaml/Stdlib_Set.resi +lib/ocaml/Stdlib_String.cmi +lib/ocaml/Stdlib_String.cmj +lib/ocaml/Stdlib_String.cmt +lib/ocaml/Stdlib_String.cmti +lib/ocaml/Stdlib_String.res +lib/ocaml/Stdlib_String.resi +lib/ocaml/Stdlib_Symbol.cmi +lib/ocaml/Stdlib_Symbol.cmj +lib/ocaml/Stdlib_Symbol.cmt +lib/ocaml/Stdlib_Symbol.res +lib/ocaml/Stdlib_Type.cmi +lib/ocaml/Stdlib_Type.cmj +lib/ocaml/Stdlib_Type.cmt +lib/ocaml/Stdlib_Type.cmti +lib/ocaml/Stdlib_Type.res +lib/ocaml/Stdlib_Type.resi +lib/ocaml/Stdlib_TypedArray.cmi +lib/ocaml/Stdlib_TypedArray.cmj +lib/ocaml/Stdlib_TypedArray.cmt +lib/ocaml/Stdlib_TypedArray.res +lib/ocaml/Stdlib_Uint16Array.cmi +lib/ocaml/Stdlib_Uint16Array.cmj +lib/ocaml/Stdlib_Uint16Array.cmt +lib/ocaml/Stdlib_Uint16Array.res +lib/ocaml/Stdlib_Uint32Array.cmi +lib/ocaml/Stdlib_Uint32Array.cmj +lib/ocaml/Stdlib_Uint32Array.cmt +lib/ocaml/Stdlib_Uint32Array.res +lib/ocaml/Stdlib_Uint8Array.cmi +lib/ocaml/Stdlib_Uint8Array.cmj +lib/ocaml/Stdlib_Uint8Array.cmt +lib/ocaml/Stdlib_Uint8Array.res +lib/ocaml/Stdlib_Uint8ClampedArray.cmi +lib/ocaml/Stdlib_Uint8ClampedArray.cmj +lib/ocaml/Stdlib_Uint8ClampedArray.cmt +lib/ocaml/Stdlib_Uint8ClampedArray.res +lib/ocaml/Stdlib_WeakMap.cmi +lib/ocaml/Stdlib_WeakMap.cmj +lib/ocaml/Stdlib_WeakMap.cmt +lib/ocaml/Stdlib_WeakMap.res +lib/ocaml/Stdlib_WeakSet.cmi +lib/ocaml/Stdlib_WeakSet.cmj +lib/ocaml/Stdlib_WeakSet.cmt +lib/ocaml/Stdlib_WeakSet.res linux/bsb_helper.exe linux/bsc.exe linux/ninja.exe diff --git a/runtime/Intl.res b/runtime/Intl.res deleted file mode 100644 index da9e86c920..0000000000 --- a/runtime/Intl.res +++ /dev/null @@ -1,25 +0,0 @@ -module Common = Intl_Common -module Collator = Intl_Collator -module DateTimeFormat = Intl_DateTimeFormat -module ListFormat = Intl_ListFormat -module Locale = Intl_Locale -module NumberFormat = Intl_NumberFormat -module PluralRules = Intl_PluralRules -module RelativeTimeFormat = Intl_RelativeTimeFormat -module Segmenter = Intl_Segmenter -module Segments = Intl_Segments - -/** -@throws RangeError -*/ -external getCanonicalLocalesExn: string => array = "Intl.getCanonicalLocales" - -/** -@throws RangeError -*/ -external getCanonicalLocalesManyExn: array => array = "Intl.getCanonicalLocales" - -/** -@throws RangeError -*/ -external supportedValuesOfExn: string => array = "Intl.supportedValuesOf" diff --git a/runtime/Js.res b/runtime/Js.res index fbca7efc08..e1bfdcd334 100644 --- a/runtime/Js.res +++ b/runtime/Js.res @@ -86,7 +86,7 @@ module Nullable = Js_null_undefined module Null_undefined = Js_null_undefined /** Provide utilities for dealing with Js exceptions */ -module Exn = Exn +module Exn = Stdlib_Exn /** Provide bindings to JS array*/ module Array = Js_array diff --git a/runtime/Js_array2.res b/runtime/Js_array2.res index 1666cf531d..c4239dc7a2 100644 --- a/runtime/Js_array2.res +++ b/runtime/Js_array2.res @@ -59,7 +59,7 @@ type t<'a> = array<'a> /** A type used to describe JavaScript objects that are like an array or are iterable. */ -type array_like<'a> +type array_like<'a> = Stdlib_Array.arrayLike<'a> /* commented out until bs has a plan for iterators type 'a array_iter = 'a array_like diff --git a/runtime/Js_date.res b/runtime/Js_date.res index 2a7b6be24b..0892211745 100644 --- a/runtime/Js_date.res +++ b/runtime/Js_date.res @@ -29,7 +29,7 @@ on MDN.) JavaScript stores dates as the number of milliseconds since the UNIX *epoch*, midnight 1 January 1970, UTC. */ -type t +type t = Stdlib_Date.t @send /** diff --git a/runtime/Js_global.res b/runtime/Js_global.res index 901a64d3e4..ed0f9a7b97 100644 --- a/runtime/Js_global.res +++ b/runtime/Js_global.res @@ -27,10 +27,10 @@ Contains functions available in the global scope (`window` in a browser context) */ /** Identify an interval started by `Js.Global.setInterval`. */ -type intervalId +type intervalId = Stdlib_Global.intervalId /** Identify timeout started by `Js.Global.setTimeout`. */ -type timeoutId +type timeoutId = Stdlib_Global.timeoutId @val /** diff --git a/runtime/Js_json.res b/runtime/Js_json.res index f30a748c34..49b672935e 100644 --- a/runtime/Js_json.res +++ b/runtime/Js_json.res @@ -25,7 +25,7 @@ /*** Efficient JSON encoding using JavaScript API */ @unboxed -type rec t = +type rec t = Stdlib_JSON.t = | Boolean(bool) | @as(null) Null | String(string) diff --git a/runtime/Js_json.resi b/runtime/Js_json.resi index 5686c916f3..8afa7e5430 100644 --- a/runtime/Js_json.resi +++ b/runtime/Js_json.resi @@ -31,7 +31,7 @@ Efficient JSON encoding using JavaScript API /* ## Types */ @unboxed /** The JSON data structure */ -type rec t = +type rec t = Stdlib_JSON.t = | Boolean(bool) | @as(null) Null | String(string) diff --git a/runtime/Js_map.res b/runtime/Js_map.res index e5e1c8e202..1f9cbdf19f 100644 --- a/runtime/Js_map.res +++ b/runtime/Js_map.res @@ -1,3 +1,3 @@ /*** ES6 Map API */ -type t<'k, 'v> +type t<'k, 'v> = Stdlib_Map.t<'k, 'v> diff --git a/runtime/Js_null.res b/runtime/Js_null.res index 1943fc60f4..927759fb82 100644 --- a/runtime/Js_null.res +++ b/runtime/Js_null.res @@ -36,7 +36,7 @@ external getUnsafe: t<'a> => 'a = "%identity" let getExn = f => switch toOption(f) { - | None => Exn.raiseError("Js.Null.getExn") + | None => Stdlib_Exn.raiseError("Js.Null.getExn") | Some(x) => x } diff --git a/runtime/Js_option.res b/runtime/Js_option.res index fb48406df4..e2d2dbaaa8 100644 --- a/runtime/Js_option.res +++ b/runtime/Js_option.res @@ -86,7 +86,7 @@ If given `None`, it throws a `getExn` exception. */ let getExn = x => switch x { - | None => Exn.raiseError("getExn") + | None => Stdlib_Exn.raiseError("getExn") | Some(x) => x } diff --git a/runtime/Js_re.res b/runtime/Js_re.res index 05e46ec64a..f81c5bf96e 100644 --- a/runtime/Js_re.res +++ b/runtime/Js_re.res @@ -31,7 +31,7 @@ and subsequent uses will continue the search from the previous [`lastIndex`](). */ /** The RegExp object. */ -type t +type t = Stdlib_RegExp.t /** The result of a executing a RegExp on a string. */ type result diff --git a/runtime/Js_set.res b/runtime/Js_set.res index 8e0d51d186..bb195cd4f4 100644 --- a/runtime/Js_set.res +++ b/runtime/Js_set.res @@ -1,3 +1,3 @@ /*** ES6 Set API */ -type t<'a> +type t<'a> = Stdlib_Set.t<'a> diff --git a/runtime/Js_typed_array2.res b/runtime/Js_typed_array2.res index 47338d748f..077ed84d8d 100644 --- a/runtime/Js_typed_array2.res +++ b/runtime/Js_typed_array2.res @@ -28,7 +28,7 @@ JavaScript Typed Array API **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) */ -type array_buffer +type array_buffer = Stdlib_ArrayBuffer.t type array_like<'a> /* should be shared with js_array */ module ArrayBuffer = { diff --git a/runtime/Js_types.res b/runtime/Js_types.res index 88bd6f6fbe..bd9c0943f0 100644 --- a/runtime/Js_types.res +++ b/runtime/Js_types.res @@ -23,16 +23,17 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** Js symbol type only available in ES6 */ -type symbol +type symbol = Stdlib_Symbol.t + +type obj_val = Stdlib_Type.Classify.object -type obj_val /** This type has only one value `undefined` */ type undefined_val /** This type has only one value `null` */ type null_val -type function_val +type function_val = Stdlib_Type.Classify.function type rec t<_> = | Undefined: t diff --git a/runtime/Js_types.resi b/runtime/Js_types.resi index a2faaf8afe..7ac929ff11 100644 --- a/runtime/Js_types.resi +++ b/runtime/Js_types.resi @@ -25,9 +25,9 @@ /*** Provide utilities for manipulating JS types. */ /** Js symbol type (only available in ES6) */ -type symbol +type symbol = Stdlib_Symbol.t -type obj_val +type obj_val = Stdlib_Type.Classify.object /** This type has only one value `undefined` */ type undefined_val @@ -35,7 +35,7 @@ type undefined_val /** This type has only one value `null` */ type null_val -type function_val +type function_val = Stdlib_Type.Classify.function type rec t<_> = | Undefined: t diff --git a/runtime/Js_undefined.res b/runtime/Js_undefined.res index 699004cea6..8a518b1ce8 100644 --- a/runtime/Js_undefined.res +++ b/runtime/Js_undefined.res @@ -37,7 +37,7 @@ external getUnsafe: t<'a> => 'a = "%identity" let getExn = f => switch toOption(f) { - | None => Exn.raiseError("Js.Undefined.getExn") + | None => Stdlib_Exn.raiseError("Js.Undefined.getExn") | Some(x) => x } diff --git a/runtime/Js_weakmap.res b/runtime/Js_weakmap.res index 926ceaf841..152ecb2be6 100644 --- a/runtime/Js_weakmap.res +++ b/runtime/Js_weakmap.res @@ -1,3 +1,3 @@ /*** ES6 WeakMap API */ -type t<'k, 'v> +type t<'k, 'v> = Stdlib_WeakMap.t<'k, 'v> diff --git a/runtime/Js_weakset.res b/runtime/Js_weakset.res index e9652c4e9d..492912f2af 100644 --- a/runtime/Js_weakset.res +++ b/runtime/Js_weakset.res @@ -1,3 +1,3 @@ /*** ES6 WeakSet API */ -type t<'a> +type t<'a> = Stdlib_WeakSet.t<'a> diff --git a/runtime/JsxDOM.res b/runtime/JsxDOM.res index aca2a0570b..ea1c407d5b 100644 --- a/runtime/JsxDOM.res +++ b/runtime/JsxDOM.res @@ -209,7 +209,7 @@ type domProps = { loop?: bool, low?: int, manifest?: string /* uri */, - max?: string /* should be int or Js.Date.t */, + max?: string /* should be int or Date.t */, maxLength?: int, media?: string /* a valid media query */, mediaGroup?: string, diff --git a/runtime/Pervasives.res b/runtime/Pervasives.res index 82b2914328..d657dd782f 100644 --- a/runtime/Pervasives.res +++ b/runtime/Pervasives.res @@ -319,280 +319,3 @@ let rec \"@" = (l1, l2) => /* Miscellaneous */ type int32 = int - -/*** -Bindings to functions available in the global JavaScript scope. -*/ - -/** -An `id` representing a timeout started via `setTimeout`. - -See [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN. -*/ -type timeoutId = Js_global.timeoutId - -/** -`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`. - -See [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN. - -## Examples - -```rescript -// Log to the console after 200 milliseconds. -let timeoutId = setTimeout(() => { - Console.log("This prints in 200 ms.") -}, 200) -``` -*/ -@val -external setTimeout: (unit => unit, int) => timeoutId = "setTimeout" - -/** -`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`. - -The same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration. - -See [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN. - -## Examples - -```rescript -// Log to the console after 200 milliseconds. -let timeoutId = setTimeoutFloat(() => { - Console.log("This prints in 200 ms.") -}, 200.) -``` -*/ -@val -external setTimeoutFloat: (unit => unit, float) => timeoutId = "setTimeout" - -/** -`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed. - -See [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN. - -## Examples - -```rescript -let timeoutId = setTimeout(() => { - Console.log("This prints in 2 seconds.") -}, 2000) - -// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run. -clearTimeout(timeoutId) -``` -*/ -@val -external clearTimeout: timeoutId => unit = "clearTimeout" - -/** -An `id` representing an interval started via `setInterval`. - -See [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN. -*/ -type intervalId = Js_global.intervalId - -/** -`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds. - -See [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN. - -## Examples - -```rescript -// Log to the console ever 200 ms (200 milliseconds). -let intervalId = setInterval(() => { - Console.log("This prints every 200 ms.") -}, 200) - -let timeoutId = setTimeout(() => { - clearInterval(intervalId) -}, 500) -``` -*/ -@val -external setInterval: (unit => unit, int) => intervalId = "setInterval" - -/** -`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds. - -The same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration. - -See [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN. - -## Examples - -```rescript -// Log to the console ever 2 seconds (200 milliseconds). -let intervalId = setIntervalFloat(() => { - Console.log("This prints every 200 ms") -}, 200.) - -// Stop the interval after 500 ms -let timeoutId = setTimeoutFloat(() => { - clearInterval(intervalId) -}, 500.0) -``` -*/ -@val -external setIntervalFloat: (unit => unit, float) => intervalId = "setInterval" - -/** -`clearInterval(intervalId)` clears a scheduled interval. - -See [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN. - -## Examples - -```rescript -let intervalId = setInterval(() => { - Console.log("This prints in 100 ms") -}, 100) - -// Stop the interval after 500 ms -let timeoutId = setTimeout(() => { - clearInterval(intervalId) -}, 500) -``` -*/ -@val -external clearInterval: intervalId => unit = "clearInterval" - -/** -Encodes a URI by replacing characters in the provided string that aren't valid in a URL. - -This is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does. -If you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`. - -See [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN. - -## Examples -```rescript -Console.log(encodeURI("https://rescript-lang.org?array=[someValue]")) -// Logs "https://rescript-lang.org?array=%5BsomeValue%5D" to the console. -``` - -*/ -@val -external encodeURI: string => string = "encodeURI" - -/** -Decodes a previously encoded URI back to a regular string. - -This is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does. -If you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`. - -See [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN. - -## Examples -```rescript -Console.log(decodeURI("https://rescript-lang.org?array=%5BsomeValue%5D")) -// Logs "https://rescript-lang.org?array=[someValue]" to the console. -``` -*/ -@val -external decodeURI: string => string = "decodeURI" - -/** -Encodes a string so it can be used as part of a URI. - -See [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN. - -## Examples -```rescript -Console.log(encodeURIComponent("array=[someValue]")) -// Logs "array%3D%5BsomeValue%5D" to the console. -``` -*/ -@val -external encodeURIComponent: string => string = "encodeURIComponent" - -/** -Decodes a previously URI encoded string back to its original form. - -See [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN. - -## Examples -```rescript -Console.log(decodeURIComponent("array%3D%5BsomeValue%5D")) -// Logs "array=[someValue]" to the console. -``` -*/ -@val -external decodeURIComponent: string => string = "decodeURIComponent" - -@val external window: Dom.window = "window" -@val external document: Dom.document = "document" -@val external globalThis: {..} = "globalThis" - -external null: Js.Nullable.t<'a> = "#null" -external undefined: Js.Nullable.t<'a> = "#undefined" -external typeof: 'a => Type.t = "#typeof" - -/** -`import(value)` dynamically import a value or function from a ReScript -module. The import call will return a `promise`, resolving to the dynamically loaded -value. - -## Examples - -`Array.res` file: - -```rescript -@send external indexOf: (array<'a>, 'a) => int = "indexOf" - -let indexOfOpt = (arr, item) => - switch arr->indexOf(item) { - | -1 => None - | index => Some(index) - } -``` -In other file you can import the `indexOfOpt` value defined in `Array.res` - -```rescript -let main = async () => { - let indexOfOpt = await import(Array.indexOfOpt) - let index = indexOfOpt([1, 2], 2) - Console.log(index) -} -``` - -Compiles to: - -```javascript -async function main() { - var add = await import("./Array.mjs").then(function(m) { - return m.indexOfOpt; - }); - var index = indexOfOpt([1, 2], 2); - console.log(index); -} -``` -*/ -external import: 'a => promise<'a> = "%import" - -type null<+'a> = Js.null<'a> - -type undefined<+'a> = Js.undefined<'a> - -type nullable<+'a> = Js.nullable<'a> - -let panic = Error.panic - -/** -`assertEqual(a, b)` check if `a` is equal `b`. If not raise a panic exception - -## Examples - -```rescript -list{1, 2} -->List.tailExn -->assertEqual(list{2}) -``` -*/ -let assertEqual = (a, b) => { - if a != b { - assert(false) - } -} diff --git a/runtime/RescriptTools_Docgen.res b/runtime/RescriptTools_Docgen.res index c77e71bcbe..6dd7454747 100644 --- a/runtime/RescriptTools_Docgen.res +++ b/runtime/RescriptTools_Docgen.res @@ -102,4 +102,4 @@ type doc = { /** `decodeFromJson(json)` parse JSON generated from `restool doc` command */ -external decodeFromJson: JSON.t => doc = "%identity" +external decodeFromJson: Stdlib_JSON.t => doc = "%identity" diff --git a/runtime/RescriptTools_Docgen.resi b/runtime/RescriptTools_Docgen.resi index c5d443e71d..2c8b1d4ad1 100644 --- a/runtime/RescriptTools_Docgen.resi +++ b/runtime/RescriptTools_Docgen.resi @@ -99,4 +99,4 @@ type doc = { items: array, } -let decodeFromJson: JSON.t => doc +let decodeFromJson: Stdlib_JSON.t => doc diff --git a/runtime/Stdlib.res b/runtime/Stdlib.res new file mode 100644 index 0000000000..d376f49359 --- /dev/null +++ b/runtime/Stdlib.res @@ -0,0 +1,123 @@ +include Stdlib_Global + +module Array = Stdlib_Array +module BigInt = Stdlib_BigInt +module Console = Stdlib_Console +module DataView = Stdlib_DataView +module Date = Stdlib_Date +module Dict = Stdlib_Dict +module Exn = Stdlib_Exn +module Error = Stdlib_Error +module Float = Stdlib_Float +module Int = Stdlib_Int +module Intl = Stdlib_Intl +module JSON = Stdlib_JSON +module List = Stdlib_List +module Math = Stdlib_Math +module Null = Stdlib_Null +module Nullable = Stdlib_Nullable +module Object = Stdlib_Object +module Option = Stdlib_Option +module Ordering = Stdlib_Ordering +module Promise = Stdlib_Promise +module RegExp = Stdlib_RegExp +module Result = Stdlib_Result +module String = Stdlib_String +module Symbol = Stdlib_Symbol +module Type = Stdlib_Type + +module Iterator = Stdlib_Iterator +module AsyncIterator = Stdlib_AsyncIterator +module Map = Stdlib_Map +module WeakMap = Stdlib_WeakMap +module Set = Stdlib_Set +module WeakSet = Stdlib_WeakSet + +module ArrayBuffer = Stdlib_ArrayBuffer +module TypedArray = Stdlib_TypedArray +module Float32Array = Stdlib_Float32Array +module Float64Array = Stdlib_Float64Array +module Int8Array = Stdlib_Int8Array +module Int16Array = Stdlib_Int16Array +module Int32Array = Stdlib_Int32Array +module Uint8Array = Stdlib_Uint8Array +module Uint16Array = Stdlib_Uint16Array +module Uint32Array = Stdlib_Uint32Array +module Uint8ClampedArray = Stdlib_Uint8ClampedArray +module BigInt64Array = Stdlib_BigInt64Array +module BigUint64Array = Stdlib_BigUint64Array + +// Type aliases for convenience +type date = Date.t +type null<+'a> = Primitive_js_extern.null<'a> +type undefined<+'a> = Primitive_js_extern.undefined<'a> +type nullable<+'a> = Primitive_js_extern.nullable<'a> + +@val external window: Dom.window = "window" +@val external document: Dom.document = "document" +@val external globalThis: {..} = "globalThis" + +/** +`import(value)` dynamically import a value or function from a ReScript +module. The import call will return a `promise`, resolving to the dynamically loaded +value. + +## Examples + +`Array.res` file: + +```rescript +@send external indexOf: (array<'a>, 'a) => int = "indexOf" + +let indexOfOpt = (arr, item) => + switch arr->indexOf(item) { + | -1 => None + | index => Some(index) + } +``` +In other file you can import the `indexOfOpt` value defined in `Array.res` + +```rescript +let main = async () => { + let indexOfOpt = await import(Array.indexOfOpt) + let index = indexOfOpt([1, 2], 2) + Console.log(index) +} +``` + +Compiles to: + +```javascript +async function main() { + var add = await import("./Array.mjs").then(function(m) { + return m.indexOfOpt; + }); + var index = indexOfOpt([1, 2], 2); + console.log(index); +} +``` +*/ +external import: 'a => promise<'a> = "%import" + +let panic = Error.panic + +/** +`assertEqual(a, b)` check if `a` is equal `b`. If not raise a panic exception + +## Examples + +```rescript +list{1, 2} +->List.tailExn +->assertEqual(list{2}) +``` +*/ +let assertEqual = (a, b) => { + if a != b { + assert(false) + } +} + +external null: nullable<'a> = "#null" +external undefined: nullable<'a> = "#undefined" +external typeof: 'a => Type.t = "#typeof" diff --git a/runtime/Array.res b/runtime/Stdlib_Array.res similarity index 90% rename from runtime/Array.res rename to runtime/Stdlib_Array.res index 23ff2dc7b1..4296a92516 100644 --- a/runtime/Array.res +++ b/runtime/Stdlib_Array.res @@ -1,3 +1,5 @@ +type arrayLike<'a> + @new external makeUninitializedUnsafe: int => array<'a> = "Array" @set external truncateToLengthUnsafe: (array<'a>, int) => unit = "length" external getUnsafe: (array<'a>, int) => 'a = "%array_unsafe_get" @@ -5,10 +7,10 @@ external setUnsafe: (array<'a>, int, 'a) => unit = "%array_unsafe_set" external unsafe_get: (array<'a>, int) => 'a = "%array_unsafe_get" -@val external fromIterator: Iterator.t<'a> => array<'a> = "Array.from" -@val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from" +@val external fromIterator: Stdlib_Iterator.t<'a> => array<'a> = "Array.from" +@val external fromArrayLike: arrayLike<'a> => array<'a> = "Array.from" @val -external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b> = "Array.from" +external fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b> = "Array.from" @send external fillAll: (array<'a>, 'a) => unit = "fill" @@ -60,10 +62,10 @@ let equal = (a, b, eq) => { let rec compareFromIndex = (a, b, i, cmp, len) => if i === len { - Ordering.equal + Stdlib_Ordering.equal } else { let c = cmp(a->getUnsafe(i), b->getUnsafe(i)) - if c == Ordering.equal { + if c == Stdlib_Ordering.equal { compareFromIndex(a, b, i + 1, cmp, len) } else { c @@ -74,9 +76,9 @@ let compare = (a, b, cmp) => { let lenA = a->length let lenB = b->length lenA < lenB - ? Ordering.less + ? Stdlib_Ordering.less : lenA > lenB - ? Ordering.greater + ? Stdlib_Ordering.greater : compareFromIndex(a, b, 0, cmp, lenA) } @@ -148,8 +150,8 @@ let lastIndexOfOpt = (arr, item) => @send external sliceToEnd: (array<'a>, ~start: int) => array<'a> = "slice" @send external copy: array<'a> => array<'a> = "slice" -@send external sort: (array<'a>, ('a, 'a) => Ordering.t) => unit = "sort" -@send external toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a> = "toSorted" +@send external sort: (array<'a>, ('a, 'a) => Stdlib_Ordering.t) => unit = "sort" +@send external toSorted: (array<'a>, ('a, 'a) => Stdlib_Ordering.t) => array<'a> = "toSorted" @send external toString: array<'a> => string = "toString" @send external toLocaleString: array<'a> => string = "toLocaleString" @@ -189,9 +191,9 @@ let reduceRightWithIndex = (arr, init, f) => reduceRightWithIndex(arr, f, init) @get_index external get: (array<'a>, int) => option<'a> = "" @set_index external set: (array<'a>, int, 'a) => unit = "" -@get_index external getSymbol: (array<'a>, Symbol.t) => option<'b> = "" -@get_index external getSymbolUnsafe: (array<'a>, Symbol.t) => 'b = "" -@set_index external setSymbol: (array<'a>, Symbol.t, 'b) => unit = "" +@get_index external getSymbol: (array<'a>, Stdlib_Symbol.t) => option<'b> = "" +@get_index external getSymbolUnsafe: (array<'a>, Stdlib_Symbol.t) => 'b = "" +@set_index external setSymbol: (array<'a>, Stdlib_Symbol.t, 'b) => unit = "" let findIndexOpt = (array: array<'a>, finder: 'a => bool): option => switch findIndex(array, finder) { diff --git a/runtime/Array.resi b/runtime/Stdlib_Array.resi similarity index 97% rename from runtime/Array.resi rename to runtime/Stdlib_Array.resi index d6764c9023..a5fc024669 100644 --- a/runtime/Array.resi +++ b/runtime/Stdlib_Array.resi @@ -1,3 +1,5 @@ +type arrayLike<'a> + /** `fromIterator(iterator)` @@ -13,14 +15,14 @@ Map.fromArray([("foo", 1), ("bar", 2)]) ``` */ @val -external fromIterator: Iterator.t<'a> => array<'a> = "Array.from" +external fromIterator: Stdlib_Iterator.t<'a> => array<'a> = "Array.from" // TODO: Docs -@val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from" +@val external fromArrayLike: arrayLike<'a> => array<'a> = "Array.from" // TODO: Docs @val -external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b> = "Array.from" +external fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b> = "Array.from" /** `make(~length, init)` @@ -53,7 +55,7 @@ let fromInitializer: (~length: int, int => 'a) => array<'a> let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool -let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t +let compare: (array<'a>, array<'a>, ('a, 'a) => Stdlib_Ordering.t) => Stdlib_Ordering.t @val external isArray: 'a => bool = "Array.isArray" @@ -263,7 +265,7 @@ someArray->assertEqual([3, 2, 1]) // Original unchanged ``` */ @send -external toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a> = "toSorted" +external toSorted: (array<'a>, ('a, 'a) => Stdlib_Ordering.t) => array<'a> = "toSorted" /** `sort(array, comparator)` sorts `array` in-place using the `comparator` function. @@ -281,7 +283,7 @@ array->assertEqual([1, 2, 3]) ``` */ @send -external sort: (array<'a>, ('a, 'a) => Ordering.t) => unit = "sort" +external sort: (array<'a>, ('a, 'a) => Stdlib_Ordering.t) => unit = "sort" @variadic @send external splice: (array<'a>, ~start: int, ~remove: int, ~insert: array<'a>) => unit = "splice" @@ -953,9 +955,9 @@ array[1]->assertEqual(Some("Hello")) */ @set_index external set: (array<'a>, int, 'a) => unit = "" -@get_index external getSymbol: (array<'a>, Symbol.t) => option<'b> = "" -@get_index external getSymbolUnsafe: (array<'a>, Symbol.t) => 'b = "" -@set_index external setSymbol: (array<'a>, Symbol.t, 'b) => unit = "" +@get_index external getSymbol: (array<'a>, Stdlib_Symbol.t) => option<'b> = "" +@get_index external getSymbolUnsafe: (array<'a>, Stdlib_Symbol.t) => 'b = "" +@set_index external setSymbol: (array<'a>, Stdlib_Symbol.t, 'b) => unit = "" /** `getUnsafe(array, index)` returns the element at `index` of `array`. diff --git a/runtime/ArrayBuffer.res b/runtime/Stdlib_ArrayBuffer.res similarity index 85% rename from runtime/ArrayBuffer.res rename to runtime/Stdlib_ArrayBuffer.res index 0beb684b40..2b0cf3a36b 100644 --- a/runtime/ArrayBuffer.res +++ b/runtime/Stdlib_ArrayBuffer.res @@ -1,4 +1,4 @@ -type t = Js.TypedArray2.ArrayBuffer.t +type t @new external make: int => t = "ArrayBuffer" @get external byteLength: t => int = "byteLength" diff --git a/runtime/AsyncIterator.res b/runtime/Stdlib_AsyncIterator.res similarity index 100% rename from runtime/AsyncIterator.res rename to runtime/Stdlib_AsyncIterator.res diff --git a/runtime/AsyncIterator.resi b/runtime/Stdlib_AsyncIterator.resi similarity index 100% rename from runtime/AsyncIterator.resi rename to runtime/Stdlib_AsyncIterator.resi diff --git a/runtime/BigInt.res b/runtime/Stdlib_BigInt.res similarity index 95% rename from runtime/BigInt.res rename to runtime/Stdlib_BigInt.res index a9fca8a7df..b39efdae0d 100644 --- a/runtime/BigInt.res +++ b/runtime/Stdlib_BigInt.res @@ -47,7 +47,7 @@ See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Referen ```rescript /* prints "123" */ -Js.BigInt.toString(123n)->Js.log +BigInt.toString(123n)->Console.log ``` */ external toString: (bigint, ~radix: int=?) => string = "toString" @@ -63,14 +63,14 @@ Returns a string with a language-sensitive representation of this BigInt value. ```rescript /* prints "123" */ -Js.BigInt.toString(123n)->Js.log +BigInt.toString(123n)->Console.log ``` */ external toLocaleString: bigint => string = "toLocaleString" @val external toFloat: bigint => float = "Number" -let toInt = t => t->toFloat->Int.fromFloat +let toInt = t => t->toFloat->Stdlib_Int.fromFloat external \"+": (bigint, bigint) => bigint = "%addbigint" external \"-": (bigint, bigint) => bigint = "%subbigint" diff --git a/runtime/BigInt64Array.res b/runtime/Stdlib_BigInt64Array.res similarity index 91% rename from runtime/BigInt64Array.res rename to runtime/Stdlib_BigInt64Array.res index 4435a72108..79e6233ad9 100644 --- a/runtime/BigInt64Array.res +++ b/runtime/Stdlib_BigInt64Array.res @@ -1,6 +1,6 @@ /** The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "BigInt64Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "BigInt64Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "BigInt64Array" /** `fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "BigInt64Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "BigInt64Array" /** `fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "BigInt64Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "BigInt64Array" /** `fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array) diff --git a/runtime/BigUint64Array.res b/runtime/Stdlib_BigUint64Array.res similarity index 91% rename from runtime/BigUint64Array.res rename to runtime/Stdlib_BigUint64Array.res index d9f527d59a..10d091f2b1 100644 --- a/runtime/BigUint64Array.res +++ b/runtime/Stdlib_BigUint64Array.res @@ -1,6 +1,6 @@ /** The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,21 @@ external fromArray: array => t = "BigUint64Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "BigUint64Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "BigUint64Array" /** `fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "BigUint64Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "BigUint64Array" /** `fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "BigUint64Array" /** `fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array) diff --git a/runtime/Console.res b/runtime/Stdlib_Console.res similarity index 100% rename from runtime/Console.res rename to runtime/Stdlib_Console.res diff --git a/runtime/Console.resi b/runtime/Stdlib_Console.resi similarity index 100% rename from runtime/Console.resi rename to runtime/Stdlib_Console.resi diff --git a/runtime/DataView.res b/runtime/Stdlib_DataView.res similarity index 80% rename from runtime/DataView.res rename to runtime/Stdlib_DataView.res index 8c75a4dff1..3143b6570f 100644 --- a/runtime/DataView.res +++ b/runtime/Stdlib_DataView.res @@ -1,11 +1,12 @@ type t -@new external fromBuffer: ArrayBuffer.t => t = "DataView" -@new external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "DataView" +@new external fromBuffer: Stdlib_ArrayBuffer.t => t = "DataView" +@new external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "DataView" @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "DataView" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "DataView" -@get external buffer: t => ArrayBuffer.t = "buffer" +@get external buffer: t => Stdlib_ArrayBuffer.t = "buffer" @get external byteLength: t => int = "byteLength" @get external byteOffset: t => int = "byteOffset" diff --git a/runtime/Date.res b/runtime/Stdlib_Date.res similarity index 98% rename from runtime/Date.res rename to runtime/Stdlib_Date.res index 925afcc190..acf8edd8cd 100644 --- a/runtime/Date.res +++ b/runtime/Stdlib_Date.res @@ -1,4 +1,4 @@ -type t = Js.Date.t +type t type msSinceEpoch = float @@ -88,7 +88,7 @@ module UTC = { let equal = (a, b) => a->getTime === b->getTime -let compare = (a, b) => Float.compare(a->getTime, b->getTime) +let compare = (a, b) => Stdlib_Float.compare(a->getTime, b->getTime) // Locale @send external getFullYear: t => int = "getFullYear" diff --git a/runtime/Date.resi b/runtime/Stdlib_Date.resi similarity index 99% rename from runtime/Date.resi rename to runtime/Stdlib_Date.resi index f0d975ba1a..85d0592268 100644 --- a/runtime/Date.resi +++ b/runtime/Stdlib_Date.resi @@ -5,7 +5,7 @@ /** A type representing a JavaScript date. */ -type t = Js.Date.t +type t /** Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC). @@ -429,7 +429,7 @@ external now: unit => msSinceEpoch = "Date.now" let equal: (t, t) => bool -let compare: (t, t) => Ordering.t +let compare: (t, t) => Stdlib_Ordering.t /** `getTime(date)` diff --git a/runtime/Dict.res b/runtime/Stdlib_Dict.res similarity index 81% rename from runtime/Dict.res rename to runtime/Stdlib_Dict.res index 365d4eda0f..0c5b82372f 100644 --- a/runtime/Dict.res +++ b/runtime/Stdlib_Dict.res @@ -12,7 +12,7 @@ let delete = (dict, string) => { @obj external make: unit => dict<'a> = "" @val external fromArray: array<(string, 'a)> => dict<'a> = "Object.fromEntries" -@val external fromIterator: Iterator.t<(string, 'a)> => dict<'a> = "Object.fromEntries" +@val external fromIterator: Stdlib_Iterator.t<(string, 'a)> => dict<'a> = "Object.fromEntries" @val external toArray: dict<'a> => array<(string, 'a)> = "Object.entries" @@ -25,11 +25,11 @@ let delete = (dict, string) => { @val external copy: (@as(json`{}`) _, dict<'a>) => dict<'a> = "Object.assign" let forEach = (dict, f) => { - dict->valuesToArray->Array.forEach(value => f(value)) + dict->valuesToArray->Stdlib_Array.forEach(value => f(value)) } let forEachWithKey = (dict, f) => { - dict->toArray->Array.forEach(((key, value)) => f(value, key)) + dict->toArray->Stdlib_Array.forEach(((key, value)) => f(value, key)) } let mapValues = (dict, f) => { diff --git a/runtime/Dict.resi b/runtime/Stdlib_Dict.resi similarity index 98% rename from runtime/Dict.resi rename to runtime/Stdlib_Dict.resi index ffd5c2a377..94b5c14d52 100644 --- a/runtime/Dict.resi +++ b/runtime/Stdlib_Dict.resi @@ -113,7 +113,7 @@ iterator ``` */ @val -external fromIterator: Iterator.t<(string, 'a)> => dict<'a> = "Object.fromEntries" +external fromIterator: Stdlib_Iterator.t<(string, 'a)> => dict<'a> = "Object.fromEntries" /** `toArray(dictionary)` returns an array of all the key/value pairs of the dictionary. diff --git a/runtime/Error.res b/runtime/Stdlib_Error.res similarity index 97% rename from runtime/Error.res rename to runtime/Stdlib_Error.res index 8f16aedfff..558a1bbb60 100644 --- a/runtime/Error.res +++ b/runtime/Stdlib_Error.res @@ -1,4 +1,4 @@ -type t = Js.Exn.t +type t = Stdlib_Exn.t let fromException: exn => option = exn => switch Obj.magic(exn) { diff --git a/runtime/Error.resi b/runtime/Stdlib_Error.resi similarity index 99% rename from runtime/Error.resi rename to runtime/Stdlib_Error.resi index 8636a9c4ee..b8bf3a5585 100644 --- a/runtime/Error.resi +++ b/runtime/Stdlib_Error.resi @@ -5,7 +5,7 @@ See [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ */ /** Represents a JavaScript exception. */ -type t = Js.Exn.t +type t = Stdlib_Exn.t let fromException: exn => option diff --git a/runtime/Exn.res b/runtime/Stdlib_Exn.res similarity index 100% rename from runtime/Exn.res rename to runtime/Stdlib_Exn.res diff --git a/runtime/Exn.resi b/runtime/Stdlib_Exn.resi similarity index 97% rename from runtime/Exn.resi rename to runtime/Stdlib_Exn.resi index e8dc04855b..c8bc764535 100644 --- a/runtime/Exn.resi +++ b/runtime/Stdlib_Exn.resi @@ -40,7 +40,7 @@ let asJsExn: exn => option /** `anyToExnInternal(obj)` will take any value `obj` and wrap it -in a Js.Exn.Error if given value is not an exn already. If +in a Exn.Error if given value is not an exn already. If `obj` is an exn, it will return `obj` without any changes. This function is mostly useful for cases where you want to unify a type of a value diff --git a/runtime/Float.res b/runtime/Stdlib_Float.res similarity index 96% rename from runtime/Float.res rename to runtime/Stdlib_Float.res index 3d02c66f75..13189644b5 100644 --- a/runtime/Float.res +++ b/runtime/Stdlib_Float.res @@ -9,7 +9,7 @@ module Constants = { external equal: (float, float) => bool = "%equal" -external compare: (float, float) => Ordering.t = "%compare" +external compare: (float, float) => Stdlib_Ordering.t = "%compare" @val external isNaN: float => bool = "isNaN" @val external isFinite: float => bool = "isFinite" diff --git a/runtime/Float.resi b/runtime/Stdlib_Float.resi similarity index 99% rename from runtime/Float.resi rename to runtime/Stdlib_Float.resi index 291067f80f..2241a08aff 100644 --- a/runtime/Float.resi +++ b/runtime/Stdlib_Float.resi @@ -111,7 +111,7 @@ module Constants: { external equal: (float, float) => bool = "%equal" -external compare: (float, float) => Ordering.t = "%compare" +external compare: (float, float) => Stdlib_Ordering.t = "%compare" /** `isNaN(v)` tests if the given `v` is `NaN`. diff --git a/runtime/Float32Array.res b/runtime/Stdlib_Float32Array.res similarity index 91% rename from runtime/Float32Array.res rename to runtime/Stdlib_Float32Array.res index 6c04d070a8..ea81017f84 100644 --- a/runtime/Float32Array.res +++ b/runtime/Stdlib_Float32Array.res @@ -1,6 +1,6 @@ /** The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Float32Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Float32Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Float32Array" /** `fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Float32Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Float32Array" /** `fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Float32Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Float32Array" /** `fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array) diff --git a/runtime/Float64Array.res b/runtime/Stdlib_Float64Array.res similarity index 91% rename from runtime/Float64Array.res rename to runtime/Stdlib_Float64Array.res index 03203eb189..0d48724e9a 100644 --- a/runtime/Float64Array.res +++ b/runtime/Stdlib_Float64Array.res @@ -1,6 +1,6 @@ /** The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Float64Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Float64Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Float64Array" /** `fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Float64Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Float64Array" /** `fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Float64Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Float64Array" /** `fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array) diff --git a/runtime/Stdlib_Global.res b/runtime/Stdlib_Global.res new file mode 100644 index 0000000000..cdc03175b3 --- /dev/null +++ b/runtime/Stdlib_Global.res @@ -0,0 +1,17 @@ +type timeoutId + +@val external setTimeout: (unit => unit, int) => timeoutId = "setTimeout" +@val external setTimeoutFloat: (unit => unit, float) => timeoutId = "setTimeout" +@val external clearTimeout: timeoutId => unit = "clearTimeout" + +type intervalId + +@val external setInterval: (unit => unit, int) => intervalId = "setInterval" +@val external setIntervalFloat: (unit => unit, float) => intervalId = "setInterval" +@val external clearInterval: intervalId => unit = "clearInterval" + +@val external encodeURI: string => string = "encodeURI" +@val external decodeURI: string => string = "decodeURI" + +@val external encodeURIComponent: string => string = "encodeURIComponent" +@val external decodeURIComponent: string => string = "decodeURIComponent" diff --git a/runtime/Stdlib_Global.resi b/runtime/Stdlib_Global.resi new file mode 100644 index 0000000000..5619d08e77 --- /dev/null +++ b/runtime/Stdlib_Global.resi @@ -0,0 +1,201 @@ +/*** +Bindings to functions available in the global JavaScript scope. +*/ + +/** +An `id` representing a timeout started via `setTimeout`. + +See [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN. +*/ +type timeoutId + +/** +`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`. + +See [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN. + +## Examples + +```rescript +// Log to the console after 200 milliseconds. +let timeoutId = setTimeout(() => { + Console.log("This prints in 200 ms.") +}, 200) +``` +*/ +@val +external setTimeout: (unit => unit, int) => timeoutId = "setTimeout" + +/** +`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`. + +The same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration. + +See [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN. + +## Examples + +```rescript +// Log to the console after 200 milliseconds. +let timeoutId = setTimeoutFloat(() => { + Console.log("This prints in 200 ms.") +}, 200.) +``` +*/ +@val +external setTimeoutFloat: (unit => unit, float) => timeoutId = "setTimeout" + +/** +`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed. + +See [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN. + +## Examples + +```rescript +let timeoutId = setTimeout(() => { + Console.log("This prints in 2 seconds.") +}, 2000) + +// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run. +clearTimeout(timeoutId) +``` +*/ +@val +external clearTimeout: timeoutId => unit = "clearTimeout" + +/** +An `id` representing an interval started via `setInterval`. + +See [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN. +*/ +type intervalId + +/** +`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds. + +See [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN. + +## Examples + +```rescript +// Log to the console ever 200 ms (200 milliseconds). +let intervalId = setInterval(() => { + Console.log("This prints every 200 ms.") +}, 200) + +let timeoutId = setTimeout(() => { + clearInterval(intervalId) +}, 500) +``` +*/ +@val +external setInterval: (unit => unit, int) => intervalId = "setInterval" + +/** +`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds. + +The same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration. + +See [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN. + +## Examples + +```rescript +// Log to the console ever 2 seconds (200 milliseconds). +let intervalId = setIntervalFloat(() => { + Console.log("This prints every 200 ms") +}, 200.) + +// Stop the interval after 500 ms +let timeoutId = setTimeoutFloat(() => { + clearInterval(intervalId) +}, 500.0) +``` +*/ +@val +external setIntervalFloat: (unit => unit, float) => intervalId = "setInterval" + +/** +`clearInterval(intervalId)` clears a scheduled interval. + +See [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN. + +## Examples + +```rescript +let intervalId = setInterval(() => { + Console.log("This prints in 100 ms") +}, 100) + +// Stop the interval after 500 ms +let timeoutId = setTimeout(() => { + clearInterval(intervalId) +}, 500) +``` +*/ +@val +external clearInterval: intervalId => unit = "clearInterval" + +/** +Encodes a URI by replacing characters in the provided string that aren't valid in a URL. + +This is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does. +If you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`. + +See [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN. + +## Examples +```rescript +Console.log(encodeURI("https://rescript-lang.org?array=[someValue]")) +// Logs "https://rescript-lang.org?array=%5BsomeValue%5D" to the console. +``` + +*/ +@val +external encodeURI: string => string = "encodeURI" + +/** +Decodes a previously encoded URI back to a regular string. + +This is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does. +If you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`. + +See [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN. + +## Examples +```rescript +Console.log(decodeURI("https://rescript-lang.org?array=%5BsomeValue%5D")) +// Logs "https://rescript-lang.org?array=[someValue]" to the console. +``` +*/ +@val +external decodeURI: string => string = "decodeURI" + +/** +Encodes a string so it can be used as part of a URI. + +See [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN. + +## Examples +```rescript +Console.log(encodeURIComponent("array=[someValue]")) +// Logs "array%3D%5BsomeValue%5D" to the console. +``` +*/ +@val +external encodeURIComponent: string => string = "encodeURIComponent" + +/** +Decodes a previously URI encoded string back to its original form. + +See [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN. + +## Examples +```rescript +Console.log(decodeURIComponent("array%3D%5BsomeValue%5D")) +// Logs "array=[someValue]" to the console. +``` +*/ +@val +external decodeURIComponent: string => string = "decodeURIComponent" diff --git a/runtime/Int.res b/runtime/Stdlib_Int.res similarity index 85% rename from runtime/Int.res rename to runtime/Stdlib_Int.res index 44a7a8a0c2..ffee8b8742 100644 --- a/runtime/Int.res +++ b/runtime/Stdlib_Int.res @@ -5,7 +5,7 @@ module Constants = { external equal: (int, int) => bool = "%equal" -external compare: (int, int) => Ordering.t = "%compare" +external compare: (int, int) => Stdlib_Ordering.t = "%compare" @send external toExponential: (int, ~digits: int=?) => string = "toExponential" @deprecated("Use `toExponential` instead") @send @@ -29,11 +29,11 @@ external fromFloat: float => int = "%intoffloat" let fromString = (x, ~radix=?) => { let maybeInt = switch radix { - | Some(radix) => Float.parseInt(x, ~radix) - | None => Float.parseInt(x) + | Some(radix) => Stdlib_Float.parseInt(x, ~radix) + | None => Stdlib_Float.parseInt(x) } - if Float.isNaN(maybeInt) { + if Stdlib_Float.isNaN(maybeInt) { None } else if maybeInt > Constants.maxValue->toFloat || maybeInt < Constants.minValue->toFloat { None @@ -61,7 +61,8 @@ let range = (start, end, ~options: rangeOptions={}) => { let step = switch options.step { | None => isInverted ? -1 : 1 - | Some(0) if start !== end => Error.raise(Error.RangeError.make("Incorrect range arguments")) + | Some(0) if start !== end => + Stdlib_Error.raise(Stdlib_Error.RangeError.make("Incorrect range arguments")) | Some(n) => n } @@ -72,10 +73,10 @@ let range = (start, end, ~options: rangeOptions={}) => { } else { let range = isInverted ? start - end : end - start let range = options.inclusive === Some(true) ? range + 1 : range - ceil(Float.fromInt(range) /. Float.fromInt(abs(step)))->Float.toInt + ceil(Stdlib_Float.fromInt(range) /. Stdlib_Float.fromInt(abs(step)))->Stdlib_Float.toInt } - Array.fromInitializer(~length, i => start + i * step) + Stdlib_Array.fromInitializer(~length, i => start + i * step) } @deprecated("Use `range` instead") @send diff --git a/runtime/Int.resi b/runtime/Stdlib_Int.resi similarity index 99% rename from runtime/Int.resi rename to runtime/Stdlib_Int.resi index 9e6f48f160..9d4b5f1849 100644 --- a/runtime/Int.resi +++ b/runtime/Stdlib_Int.resi @@ -58,7 +58,7 @@ module Constants: { external equal: (int, int) => bool = "%equal" -external compare: (int, int) => Ordering.t = "%compare" +external compare: (int, int) => Stdlib_Ordering.t = "%compare" /** `toExponential(n, ~digits=?)` return a `string` representing the given value in diff --git a/runtime/Int16Array.res b/runtime/Stdlib_Int16Array.res similarity index 91% rename from runtime/Int16Array.res rename to runtime/Stdlib_Int16Array.res index 8fe25cf2ae..02a7101604 100644 --- a/runtime/Int16Array.res +++ b/runtime/Stdlib_Int16Array.res @@ -1,6 +1,6 @@ /** The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Int16Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Int16Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Int16Array" /** `fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Int16Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int16Array" /** `fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Int16Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Int16Array" /** `fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array) diff --git a/runtime/Int32Array.res b/runtime/Stdlib_Int32Array.res similarity index 91% rename from runtime/Int32Array.res rename to runtime/Stdlib_Int32Array.res index febba5a2c7..9c14ac358f 100644 --- a/runtime/Int32Array.res +++ b/runtime/Stdlib_Int32Array.res @@ -1,6 +1,6 @@ /** The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Int32Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Int32Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Int32Array" /** `fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Int32Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int32Array" /** `fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Int32Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Int32Array" /** `fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array) diff --git a/runtime/Int8Array.res b/runtime/Stdlib_Int8Array.res similarity index 91% rename from runtime/Int8Array.res rename to runtime/Stdlib_Int8Array.res index 3c8e14ba8b..df120a6340 100644 --- a/runtime/Int8Array.res +++ b/runtime/Stdlib_Int8Array.res @@ -1,6 +1,6 @@ /** The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Int8Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Int8Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Int8Array" /** `fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Int8Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int8Array" /** `fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Int8Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Int8Array" /** `fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array) diff --git a/runtime/Stdlib_Intl.res b/runtime/Stdlib_Intl.res new file mode 100644 index 0000000000..1b6d72794b --- /dev/null +++ b/runtime/Stdlib_Intl.res @@ -0,0 +1,25 @@ +module Common = Stdlib_Intl_Common +module Collator = Stdlib_Intl_Collator +module DateTimeFormat = Stdlib_Intl_DateTimeFormat +module ListFormat = Stdlib_Intl_ListFormat +module Locale = Stdlib_Intl_Locale +module NumberFormat = Stdlib_Intl_NumberFormat +module PluralRules = Stdlib_Intl_PluralRules +module RelativeTimeFormat = Stdlib_Intl_RelativeTimeFormat +module Segmenter = Stdlib_Intl_Segmenter +module Segments = Stdlib_Intl_Segments + +/** +@throws RangeError +*/ +external getCanonicalLocalesExn: string => array = "Intl.getCanonicalLocales" + +/** +@throws RangeError +*/ +external getCanonicalLocalesManyExn: array => array = "Intl.getCanonicalLocales" + +/** +@throws RangeError +*/ +external supportedValuesOfExn: string => array = "Intl.supportedValuesOf" diff --git a/runtime/Intl_Collator.res b/runtime/Stdlib_Intl_Collator.res similarity index 80% rename from runtime/Intl_Collator.res rename to runtime/Stdlib_Intl_Collator.res index 352f6252b4..c3def972ad 100644 --- a/runtime/Intl_Collator.res +++ b/runtime/Stdlib_Intl_Collator.res @@ -5,7 +5,7 @@ type sensitivity = [#base | #accent | #case | #variant] type caseFirst = [#upper | #lower | #"false"] type options = { - localeMatcher?: Intl_Common.localeMatcher, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, usage?: usage, sensitivity?: sensitivity, ignorePunctuation?: bool, @@ -18,12 +18,12 @@ type resolvedOptions = { usage: usage, sensitivity: sensitivity, ignorePunctuation: bool, - collation: [Intl_Common.collation | #default], + collation: [Stdlib_Intl_Common.collation | #default], numeric?: bool, caseFirst?: caseFirst, } -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} @new external make: (~locales: array=?, ~options: options=?) => t = "Intl.Collator" diff --git a/runtime/Intl_Common.res b/runtime/Stdlib_Intl_Common.res similarity index 100% rename from runtime/Intl_Common.res rename to runtime/Stdlib_Intl_Common.res diff --git a/runtime/Intl_DateTimeFormat.res b/runtime/Stdlib_Intl_DateTimeFormat.res similarity index 78% rename from runtime/Intl_DateTimeFormat.res rename to runtime/Stdlib_Intl_DateTimeFormat.res index 12738b5e0d..445ead35d6 100644 --- a/runtime/Intl_DateTimeFormat.res +++ b/runtime/Stdlib_Intl_DateTimeFormat.res @@ -32,10 +32,10 @@ type fractionalSecondDigits = [#0 | #1 | #2 | #3] type options = { dateStyle?: dateStyle, // can be used with timeStyle, but not other options timeStyle?: timeStyle, // can be used with dateStyle, but not other options - calendar?: Intl_Common.calendar, + calendar?: Stdlib_Intl_Common.calendar, dayPeriod?: dayPeriod, // only has an effect if a 12-hour clock is used - numberingSystem?: Intl_Common.numberingSystem, - localeMatcher?: Intl_Common.localeMatcher, + numberingSystem?: Stdlib_Intl_Common.numberingSystem, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, timeZone?: string, hour12?: bool, hourCycle?: hourCycle, @@ -66,15 +66,15 @@ type resolvedOptions = { second?: second, fractionalSecondDigits?: fractionalSecondDigits, timeZoneName?: timeZoneName, - calendar: Intl_Common.calendar, + calendar: Stdlib_Intl_Common.calendar, hour12: bool, hourCycle: hourCycle, locale: string, - numberingSystem: Intl_Common.numberingSystem, + numberingSystem: Stdlib_Intl_Common.numberingSystem, timeZone: string, } -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} type dateTimeComponent = [ | #day @@ -113,13 +113,17 @@ external supportedLocalesOf: (array, ~options: supportedLocalesOptions=? @send external resolvedOptions: t => resolvedOptions = "resolvedOptions" -@send external format: (t, Date.t) => string = "format" +@send external format: (t, Stdlib_Date.t) => string = "format" @send -external formatToParts: (t, Date.t) => array = "formatToParts" +external formatToParts: (t, Stdlib_Date.t) => array = "formatToParts" @send -external formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string = "formatRange" +external formatRange: (t, ~startDate: Stdlib_Date.t, ~endDate: Stdlib_Date.t) => string = + "formatRange" @send -external formatRangeToParts: (t, ~startDate: Date.t, ~endDate: Date.t) => array = - "formatRangeToParts" +external formatRangeToParts: ( + t, + ~startDate: Stdlib_Date.t, + ~endDate: Stdlib_Date.t, +) => array = "formatRangeToParts" diff --git a/runtime/Intl_ListFormat.res b/runtime/Stdlib_Intl_ListFormat.res similarity index 86% rename from runtime/Intl_ListFormat.res rename to runtime/Stdlib_Intl_ListFormat.res index 0de3d99917..bbc84d8aa7 100644 --- a/runtime/Intl_ListFormat.res +++ b/runtime/Stdlib_Intl_ListFormat.res @@ -12,7 +12,7 @@ type style = [ ] type options = { - localeMatcher?: Intl_Common.localeMatcher, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, \"type"?: listType, style?: style, } @@ -33,7 +33,7 @@ type resolvedOptions = { \"type": listType, } -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} @new external make: (~locales: array=?, ~options: options=?) => t = "Intl.ListFormat" diff --git a/runtime/Intl_Locale.res b/runtime/Stdlib_Intl_Locale.res similarity index 86% rename from runtime/Intl_Locale.res rename to runtime/Stdlib_Intl_Locale.res index de82a0aa1c..96363f5935 100644 --- a/runtime/Intl_Locale.res +++ b/runtime/Stdlib_Intl_Locale.res @@ -2,11 +2,11 @@ type t type options = { baseName?: string, - calendar?: Intl_Common.calendar, - collation?: Intl_Common.collation, + calendar?: Stdlib_Intl_Common.calendar, + collation?: Stdlib_Intl_Common.collation, hourCycle?: [#h11 | #h12 | #h23 | #h24], caseFirst?: [#upper | #lower | #"false"], - numberingSystem?: Intl_Common.numberingSystem, + numberingSystem?: Stdlib_Intl_Common.numberingSystem, numeric?: bool, language?: string, script?: string, diff --git a/runtime/Intl_NumberFormat.res b/runtime/Stdlib_Intl_NumberFormat.res similarity index 84% rename from runtime/Intl_NumberFormat.res rename to runtime/Stdlib_Intl_NumberFormat.res index e6262ea706..5061d5a193 100644 --- a/runtime/Intl_NumberFormat.res +++ b/runtime/Stdlib_Intl_NumberFormat.res @@ -1,4 +1,4 @@ -module Grouping = Intl_NumberFormat_Grouping +module Grouping = Stdlib_Intl_NumberFormat_Grouping type t @@ -72,11 +72,11 @@ type trailingZeroDisplay = [#auto | #stripIfInteger | #lessPrecision] type options = { compactDisplay?: compactDisplay, - numberingSystem?: Intl_Common.numberingSystem, + numberingSystem?: Stdlib_Intl_Common.numberingSystem, currency?: currency, currencyDisplay?: currencyDisplay, currencySign?: currencySign, - localeMatcher?: Intl_Common.localeMatcher, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, notation?: notation, signDisplay?: signDisplay, style?: style, @@ -94,12 +94,12 @@ type options = { */ trailingZeroDisplay?: trailingZeroDisplay, // use either this group - minimumIntegerDigits?: Intl_Common.oneTo21, - minimumFractionDigits?: Intl_Common.zeroTo20, - maximumFractionDigits?: Intl_Common.zeroTo20, + minimumIntegerDigits?: Stdlib_Intl_Common.oneTo21, + minimumFractionDigits?: Stdlib_Intl_Common.zeroTo20, + maximumFractionDigits?: Stdlib_Intl_Common.zeroTo20, // OR these - minimumSignificantDigits?: Intl_Common.oneTo21, - maximumSignificantDigits?: Intl_Common.oneTo21, + minimumSignificantDigits?: Stdlib_Intl_Common.oneTo21, + maximumSignificantDigits?: Stdlib_Intl_Common.oneTo21, } type resolvedOptions = { @@ -116,22 +116,22 @@ type resolvedOptions = { roundingPriority?: roundingPriority, // not available in firefox v110 roundingIncrement?: roundingIncrement, // not available in firefox v110 // either this group - minimumIntegerDigits?: Intl_Common.oneTo21, - minimumFractionDigits?: Intl_Common.zeroTo20, - maximumFractionDigits?: Intl_Common.zeroTo20, + minimumIntegerDigits?: Stdlib_Intl_Common.oneTo21, + minimumFractionDigits?: Stdlib_Intl_Common.zeroTo20, + maximumFractionDigits?: Stdlib_Intl_Common.zeroTo20, // OR these - minimumSignificantDigits?: Intl_Common.oneTo21, - maximumSignificantDigits?: Intl_Common.oneTo21, + minimumSignificantDigits?: Stdlib_Intl_Common.oneTo21, + maximumSignificantDigits?: Stdlib_Intl_Common.oneTo21, // always present locale: string, notation: notation, - numberingSystem: Intl_Common.numberingSystem, + numberingSystem: Stdlib_Intl_Common.numberingSystem, signDisplay: signDisplay, style: style, useGrouping: Grouping.t, } -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} type numberFormatPartType = [ | #compact diff --git a/runtime/Intl_NumberFormat_Grouping.res b/runtime/Stdlib_Intl_NumberFormat_Grouping.res similarity index 88% rename from runtime/Intl_NumberFormat_Grouping.res rename to runtime/Stdlib_Intl_NumberFormat_Grouping.res index 600b06ba1e..12dc872108 100644 --- a/runtime/Intl_NumberFormat_Grouping.res +++ b/runtime/Stdlib_Intl_NumberFormat_Grouping.res @@ -6,7 +6,7 @@ external fromBool: bool => t = "%identity" external fromString: [#always | #auto | #min2] => t = "%identity" let parseJsValue = value => - switch Type.Classify.classify(value) { + switch Stdlib_Type.Classify.classify(value) { | String("always") => Some(#always) | String("auto") => Some(#auto) | String("min2") => Some(#min2) diff --git a/runtime/Intl_PluralRules.res b/runtime/Stdlib_Intl_PluralRules.res similarity index 63% rename from runtime/Intl_PluralRules.res rename to runtime/Stdlib_Intl_PluralRules.res index 9da532bf81..943235f411 100644 --- a/runtime/Intl_PluralRules.res +++ b/runtime/Stdlib_Intl_PluralRules.res @@ -3,15 +3,15 @@ type t type localeType = [#cardinal | #ordinal] type options = { - localeMatcher?: Intl_Common.localeMatcher, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, \"type"?: localeType, // use either this group - minimumIntegerDigits?: Intl_Common.oneTo21, - minimumFractionDigits?: Intl_Common.zeroTo20, - maximumFractionDigits?: Intl_Common.zeroTo20, + minimumIntegerDigits?: Stdlib_Intl_Common.oneTo21, + minimumFractionDigits?: Stdlib_Intl_Common.zeroTo20, + maximumFractionDigits?: Stdlib_Intl_Common.zeroTo20, // OR this group - minimumSignificantDigits?: Intl_Common.oneTo21, - maximumSignificantDigits?: Intl_Common.oneTo21, + minimumSignificantDigits?: Stdlib_Intl_Common.oneTo21, + maximumSignificantDigits?: Stdlib_Intl_Common.oneTo21, } type pluralCategories = [ @@ -28,15 +28,15 @@ type resolvedOptions = { pluralCategories: array, \"type": localeType, // either this group - minimumIntegerDigits?: Intl_Common.oneTo21, - minimumFractionDigits?: Intl_Common.zeroTo20, - maximumFractionDigits?: Intl_Common.zeroTo20, + minimumIntegerDigits?: Stdlib_Intl_Common.oneTo21, + minimumFractionDigits?: Stdlib_Intl_Common.zeroTo20, + maximumFractionDigits?: Stdlib_Intl_Common.zeroTo20, // OR this group - minimumSignificantDigits?: Intl_Common.oneTo21, - maximumSignificantDigits?: Intl_Common.oneTo21, + minimumSignificantDigits?: Stdlib_Intl_Common.oneTo21, + maximumSignificantDigits?: Stdlib_Intl_Common.oneTo21, } -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} @new external make: (~locales: array=?, ~options: options=?) => t = "Intl.PluralRules" diff --git a/runtime/Intl_RelativeTimeFormat.res b/runtime/Stdlib_Intl_RelativeTimeFormat.res similarity index 87% rename from runtime/Intl_RelativeTimeFormat.res rename to runtime/Stdlib_Intl_RelativeTimeFormat.res index 1d53db642d..d0f5de16a8 100644 --- a/runtime/Intl_RelativeTimeFormat.res +++ b/runtime/Stdlib_Intl_RelativeTimeFormat.res @@ -5,12 +5,12 @@ type style = [#long | #short | #narrow] type timeUnit = [#year | #quarter | #month | #week | #day | #hour | #minute | #second] type options = { - localeMatcher?: Intl_Common.localeMatcher, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, numeric?: numeric, style?: style, } -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} type resolvedOptions = { locale: string, diff --git a/runtime/Intl_Segmenter.res b/runtime/Stdlib_Intl_Segmenter.res similarity index 74% rename from runtime/Intl_Segmenter.res rename to runtime/Stdlib_Intl_Segmenter.res index cd5306b962..357d489122 100644 --- a/runtime/Intl_Segmenter.res +++ b/runtime/Stdlib_Intl_Segmenter.res @@ -6,7 +6,7 @@ type t type granularity = [#grapheme | #word | #sentence] type options = { - localeMatcher?: Intl_Common.localeMatcher, + localeMatcher?: Stdlib_Intl_Common.localeMatcher, granularity?: granularity, } @@ -21,7 +21,7 @@ type pluralCategories = [ type resolvedOptions = {locale: string, granularity: granularity} -type supportedLocalesOptions = {localeMatcher: Intl_Common.localeMatcher} +type supportedLocalesOptions = {localeMatcher: Stdlib_Intl_Common.localeMatcher} @new external make: (~locales: array=?, ~options: options=?) => t = "Intl.Segmenter" @@ -31,4 +31,4 @@ external supportedLocalesOf: (array, ~options: supportedLocalesOptions=? @send external resolvedOptions: t => resolvedOptions = "resolvedOptions" -@send external segment: (t, string) => Intl_Segments.t = "segment" +@send external segment: (t, string) => Stdlib_Intl_Segments.t = "segment" diff --git a/runtime/Intl_Segments.res b/runtime/Stdlib_Intl_Segments.res similarity index 100% rename from runtime/Intl_Segments.res rename to runtime/Stdlib_Intl_Segments.res diff --git a/runtime/Iterator.res b/runtime/Stdlib_Iterator.res similarity index 100% rename from runtime/Iterator.res rename to runtime/Stdlib_Iterator.res diff --git a/runtime/Iterator.resi b/runtime/Stdlib_Iterator.resi similarity index 100% rename from runtime/Iterator.resi rename to runtime/Stdlib_Iterator.resi diff --git a/runtime/JSON.res b/runtime/Stdlib_JSON.res similarity index 81% rename from runtime/JSON.res rename to runtime/Stdlib_JSON.res index f31d94be14..67c9213d9d 100644 --- a/runtime/JSON.res +++ b/runtime/Stdlib_JSON.res @@ -1,5 +1,5 @@ @unboxed -type rec t = Js.Json.t = +type rec t = | Boolean(bool) | @as(null) Null | String(string) @@ -42,6 +42,13 @@ external stringifyAnyWithFilter: ('a, array) => string = "JSON.stringify external stringifyAnyWithFilterAndIndent: ('a, array, int) => string = "JSON.stringify" module Classify = { + @val external _internalClass: 'a => string = "Object.prototype.toString.call" + external _asBool: 'a => bool = "%identity" + external _asString: 'a => string = "%identity" + external _asFloat: 'a => float = "%identity" + external _asArray: 'a => array = "%identity" + external _asDict: 'a => dict = "%identity" + type t = | Bool(bool) | Null @@ -50,13 +57,6 @@ module Classify = { | Object(dict) | Array(array) - @val external _internalClass: 'a => string = "Object.prototype.toString.call" - external _asBool: 'a => bool = "%identity" - external _asString: 'a => string = "%identity" - external _asFloat: 'a => float = "%identity" - external _asArray: 'a => array = "%identity" - external _asDict: 'a => dict = "%identity" - let classify = value => { switch _internalClass(value) { | "[object Boolean]" => Bool(_asBool(value)) @@ -80,15 +80,22 @@ module Encode = { } module Decode = { - let bool = (json: t) => Type.typeof(json) === #boolean ? Some((Obj.magic(json): bool)) : None - let null = (json: t) => Obj.magic(json) === Null.null ? Some(Null.null) : None - let string = (json: t) => Type.typeof(json) === #string ? Some((Obj.magic(json): string)) : None - let float = (json: t) => Type.typeof(json) === #number ? Some((Obj.magic(json): float)) : None + let bool = (json: t) => + Stdlib_Type.typeof(json) === #boolean ? Some((Obj.magic(json): bool)) : None + let null = (json: t) => Obj.magic(json) === Stdlib_Null.null ? Some(Stdlib_Null.null) : None + let string = (json: t) => + Stdlib_Type.typeof(json) === #string ? Some((Obj.magic(json): string)) : None + let float = (json: t) => + Stdlib_Type.typeof(json) === #number ? Some((Obj.magic(json): float)) : None let object = (json: t) => - if Type.typeof(json) === #object && !Array.isArray(json) && !(Obj.magic(json) === Null.null) { + if ( + Stdlib_Type.typeof(json) === #object && + !Stdlib_Array.isArray(json) && + !(Obj.magic(json) === Stdlib_Null.null) + ) { Some((Obj.magic(json): dict)) } else { None } - let array = (json: t) => Array.isArray(json) ? Some((Obj.magic(json): array)) : None + let array = (json: t) => Stdlib_Array.isArray(json) ? Some((Obj.magic(json): array)) : None } diff --git a/runtime/JSON.resi b/runtime/Stdlib_JSON.resi similarity index 99% rename from runtime/JSON.resi rename to runtime/Stdlib_JSON.resi index 8d9e8b0494..096a389709 100644 --- a/runtime/JSON.resi +++ b/runtime/Stdlib_JSON.resi @@ -6,7 +6,7 @@ Functions for interacting with JSON. A type representing a JSON object. */ @unboxed -type rec t = Js.Json.t = +type rec t = | Boolean(bool) | @as(null) Null | String(string) @@ -739,7 +739,7 @@ module Decode: { // None ``` */ - let null: t => option> + let null: t => option> /** Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`. diff --git a/runtime/List.res b/runtime/Stdlib_List.res similarity index 93% rename from runtime/List.res rename to runtime/Stdlib_List.res index 3edf67117f..81dd91c8e9 100644 --- a/runtime/List.res +++ b/runtime/Stdlib_List.res @@ -69,17 +69,17 @@ module A = { let reduceReverseU = (a, x, f) => { let r = ref(x) - for i in Array.length(a) - 1 downto 0 { - r.contents = f(r.contents, Array.getUnsafe(a, i)) + for i in Stdlib_Array.length(a) - 1 downto 0 { + r.contents = f(r.contents, Stdlib_Array.getUnsafe(a, i)) } r.contents } let reduceReverse2U = (a, b, x, f) => { let r = ref(x) - let len = min(Array.length(a), Array.length(b)) + let len = min(Stdlib_Array.length(a), Stdlib_Array.length(b)) for i in len - 1 downto 0 { - r.contents = f(r.contents, Array.getUnsafe(a, i), Array.getUnsafe(b, i)) + r.contents = f(r.contents, Stdlib_Array.getUnsafe(a, i), Stdlib_Array.getUnsafe(b, i)) } r.contents } @@ -467,7 +467,7 @@ let rec fillAux = (arr, i, x) => switch x { | list{} => () | list{h, ...t} => - Array.setUnsafe(arr, i, h) + Stdlib_Array.setUnsafe(arr, i, h) fillAux(arr, i + 1, t) } @@ -475,10 +475,10 @@ let rec fromArrayAux = (a, i, res) => if i < 0 { res } else { - fromArrayAux(a, i - 1, list{Array.getUnsafe(a, i), ...res}) + fromArrayAux(a, i - 1, list{Stdlib_Array.getUnsafe(a, i), ...res}) } -let fromArray = a => fromArrayAux(a, Array.length(a) - 1, list{}) +let fromArray = a => fromArrayAux(a, Stdlib_Array.length(a) - 1, list{}) let toArray = (x: t<_>) => { let len = length(x) @@ -489,30 +489,10 @@ let toArray = (x: t<_>) => { let toShuffled = xs => { let v = toArray(xs) - Array.shuffle(v) + Stdlib_Array.shuffle(v) fromArray(v) } -/* let rec fillAuxMap arr i x f = - match x with - | [] -> () - | h::t -> - A.setUnsafe arr i (f h [@bs]) ; - fillAuxMap arr (i + 1) t f */ - -/* module J = Js_json */ -/* type json = J.t */ -/* let toJson x f = */ -/* let len = length x in */ -/* let arr = Belt_Array.makeUninitializedUnsafe len in */ -/* fillAuxMap arr 0 x f; */ -/* J.array arr */ - -/* TODO: best practice about raising excpetion - 1. raise OCaml exception, no stacktrace - 2. raise JS exception, how to pattern match -*/ - let rec reverseConcat = (l1, l2) => switch l1 { | list{} => l2 @@ -542,10 +522,10 @@ let concatMany = xs => | [] => list{} | [x] => x | _ => - let len = Array.length(xs) - let v = ref(Array.getUnsafe(xs, len - 1)) + let len = Stdlib_Array.length(xs) + let v = ref(Stdlib_Array.getUnsafe(xs, len - 1)) for i in len - 2 downto 0 { - v.contents = concat(Array.getUnsafe(xs, i), v.contents) + v.contents = concat(Stdlib_Array.getUnsafe(xs, i), v.contents) } v.contents } @@ -663,20 +643,20 @@ let rec every2 = (l1, l2, p) => let rec compareLength = (l1, l2) => switch (l1, l2) { - | (list{}, list{}) => Ordering.equal - | (_, list{}) => Ordering.greater - | (list{}, _) => Ordering.less + | (list{}, list{}) => Stdlib_Ordering.equal + | (_, list{}) => Stdlib_Ordering.greater + | (list{}, _) => Stdlib_Ordering.less | (list{_, ...l1s}, list{_, ...l2s}) => compareLength(l1s, l2s) } let rec compare = (l1, l2, p) => switch (l1, l2) { - | (list{}, list{}) => Ordering.equal - | (_, list{}) => Ordering.greater - | (list{}, _) => Ordering.less + | (list{}, list{}) => Stdlib_Ordering.equal + | (_, list{}) => Stdlib_Ordering.greater + | (list{}, _) => Stdlib_Ordering.less | (list{a1, ...l1}, list{a2, ...l2}) => let c = p(a1, a2) - if c == Ordering.equal { + if c == Stdlib_Ordering.equal { compare(l1, l2, p) } else { c @@ -761,7 +741,7 @@ let setAssoc = (xs, x, k, eq) => let sort = (xs, cmp) => { let arr = toArray(xs) - Array.sort(arr, cmp) + Stdlib_Array.sort(arr, cmp) fromArray(arr) } diff --git a/runtime/List.resi b/runtime/Stdlib_List.resi similarity index 98% rename from runtime/List.resi rename to runtime/Stdlib_List.resi index 35aeb291f0..f0b0e1bd47 100644 --- a/runtime/List.resi +++ b/runtime/Stdlib_List.resi @@ -375,11 +375,6 @@ List.toArray(list{1, 2, 3}) // [1, 2, 3] */ let toArray: t<'a> => array<'a> -/* type json = Js_json.t */ - -/* val toJson : 'a t -> ('a -> json [@bs]) -> json */ -/* val fromJson : json -> (json -> 'a [@bs]) -> 'a t */ - /** `reverse(list)` returns a new list whose elements are those of `list` in reversed order. @@ -640,7 +635,7 @@ List.compareLength(list{1, 2, 3}, list{4, 5, 6}) // 0. List.compareLength(list{1, 2, 3, 4}, list{5, 6}) // 1. ``` */ -let compareLength: (t<'a>, t<'a>) => Ordering.t +let compareLength: (t<'a>, t<'a>) => Stdlib_Ordering.t /** `compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative @@ -667,7 +662,7 @@ List.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) // 0. for Array, we compare the length first and, only if the lengths are equal, elements one by one. For lists, we just compare elements one by one. */ -let compare: (t<'a>, t<'a>, ('a, 'a) => Ordering.t) => Ordering.t +let compare: (t<'a>, t<'a>, ('a, 'a) => Stdlib_Ordering.t) => Stdlib_Ordering.t /** `equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for @@ -884,4 +879,4 @@ let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)> List.sort(list{5, 4, 9, 3, 7}, Int.compare) // list{3, 4, 5, 7, 9} ``` */ -let sort: (t<'a>, ('a, 'a) => Ordering.t) => t<'a> +let sort: (t<'a>, ('a, 'a) => Stdlib_Ordering.t) => t<'a> diff --git a/runtime/Map.res b/runtime/Stdlib_Map.res similarity index 65% rename from runtime/Map.res rename to runtime/Stdlib_Map.res index a6fa75344c..a83ef4879a 100644 --- a/runtime/Map.res +++ b/runtime/Stdlib_Map.res @@ -1,8 +1,8 @@ -type t<'k, 'v> = Js.Map.t<'k, 'v> +type t<'k, 'v> @new external make: unit => t<'k, 'v> = "Map" @new external fromArray: array<('k, 'v)> => t<'k, 'v> = "Map" -@new external fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v> = "Map" +@new external fromIterator: Stdlib_Iterator.t<('k, 'v)> => t<'k, 'v> = "Map" @get external size: t<'k, 'v> => int = "size" @@ -16,6 +16,6 @@ type t<'k, 'v> = Js.Map.t<'k, 'v> @send external set: (t<'k, 'v>, 'k, 'v) => unit = "set" @send external delete: (t<'k, 'v>, 'k) => bool = "delete" -@send external keys: t<'k, 'v> => Iterator.t<'k> = "keys" -@send external values: t<'k, 'v> => Iterator.t<'v> = "values" -@send external entries: t<'k, 'v> => Iterator.t<('k, 'v)> = "entries" +@send external keys: t<'k, 'v> => Stdlib_Iterator.t<'k> = "keys" +@send external values: t<'k, 'v> => Stdlib_Iterator.t<'v> = "values" +@send external entries: t<'k, 'v> => Stdlib_Iterator.t<('k, 'v)> = "entries" diff --git a/runtime/Map.resi b/runtime/Stdlib_Map.resi similarity index 95% rename from runtime/Map.resi rename to runtime/Stdlib_Map.resi index a4060d6615..cee8853852 100644 --- a/runtime/Map.resi +++ b/runtime/Stdlib_Map.resi @@ -7,7 +7,7 @@ See [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Gl /** Type representing an instance of `Map`. */ -type t<'k, 'v> = Js.Map.t<'k, 'v> +type t<'k, 'v> /** Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values. @@ -78,7 +78,7 @@ iterator ``` */ @new -external fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v> = "Map" +external fromIterator: Stdlib_Iterator.t<('k, 'v)> => t<'k, 'v> = "Map" /** Returns the size, the number of key/value pairs, of the map. @@ -231,7 +231,7 @@ Console.log(map->Map.keys->Iterator.toArray) ``` */ @send -external keys: t<'k, 'v> => Iterator.t<'k> = "keys" +external keys: t<'k, 'v> => Stdlib_Iterator.t<'k> = "keys" /** Returns an iterator that holds all values of the map. @@ -253,7 +253,7 @@ Console.log(map->Map.values->Iterator.toArray) ``` */ @send -external values: t<'k, 'v> => Iterator.t<'v> = "values" +external values: t<'k, 'v> => Stdlib_Iterator.t<'v> = "values" /** Returns an iterator that holds all entries of the map. @@ -276,4 +276,4 @@ Console.log(map->Map.entries->Iterator.toArray) ``` */ @send -external entries: t<'k, 'v> => Iterator.t<('k, 'v)> = "entries" +external entries: t<'k, 'v> => Stdlib_Iterator.t<('k, 'v)> = "entries" diff --git a/runtime/Math.res b/runtime/Stdlib_Math.res similarity index 92% rename from runtime/Math.res rename to runtime/Stdlib_Math.res index 11d17501d1..58e01e70fd 100644 --- a/runtime/Math.res +++ b/runtime/Stdlib_Math.res @@ -56,7 +56,8 @@ module Int = { @variadic @val external maxMany: array => int = "Math.max" @val external pow: (int, ~exp: int) => int = "Math.pow" @val external sign: int => int = "Math.sign" - let floor: float => int = f => f->floor->Float.toInt - let ceil: float => int = f => f->ceil->Float.toInt - let random: (int, int) => int = (min, max) => floor(random() *. Int.toFloat(max - min)) + min + let floor: float => int = f => f->floor->Stdlib_Float.toInt + let ceil: float => int = f => f->ceil->Stdlib_Float.toInt + let random: (int, int) => int = (min, max) => + floor(random() *. Stdlib_Int.toFloat(max - min)) + min } diff --git a/runtime/Math.resi b/runtime/Stdlib_Math.resi similarity index 100% rename from runtime/Math.resi rename to runtime/Stdlib_Math.resi diff --git a/runtime/Null.res b/runtime/Stdlib_Null.res similarity index 79% rename from runtime/Null.res rename to runtime/Stdlib_Null.res index 2bbb9a2ab5..8ebc877df7 100644 --- a/runtime/Null.res +++ b/runtime/Stdlib_Null.res @@ -1,9 +1,9 @@ @unboxed -type t<'a> = Js.Null.t<'a> = +type t<+'a> = Primitive_js_extern.null<'a> = | Value('a) | @as(null) Null -external asNullable: t<'a> => Nullable.t<'a> = "%identity" +external asNullable: t<'a> => Stdlib_Nullable.t<'a> = "%identity" external null: t<'a> = "#null" @@ -17,9 +17,9 @@ let fromOption: option<'a> => t<'a> = option => | None => null } -let equal = (a, b, eq) => Option.equal(a->toOption, b->toOption, eq) +let equal = (a, b, eq) => Stdlib_Option.equal(a->toOption, b->toOption, eq) -let compare = (a, b, cmp) => Option.compare(a->toOption, b->toOption, cmp) +let compare = (a, b, cmp) => Stdlib_Option.compare(a->toOption, b->toOption, cmp) let getOr = (value, default) => switch value->toOption { diff --git a/runtime/Null.resi b/runtime/Stdlib_Null.resi similarity index 95% rename from runtime/Null.resi rename to runtime/Stdlib_Null.resi index 4758c76d8c..6b5e96781e 100644 --- a/runtime/Null.resi +++ b/runtime/Stdlib_Null.resi @@ -8,7 +8,7 @@ If you also need to cover `undefined`, check out `Nullable` instead. A type representing a value that can be either `'a` or `null`. */ @unboxed -type t<'a> = Js.Null.t<'a> = +type t<+'a> = Primitive_js_extern.null<'a> = | Value('a) | @as(null) Null @@ -21,7 +21,7 @@ let nullValue = Null.make("Hello") let asNullable = nullValue->Null.asNullable // Nullable.t ``` */ -external asNullable: t<'a> => Nullable.t<'a> = "%identity" +external asNullable: t<'a> => Stdlib_Nullable.t<'a> = "%identity" /** The value `null`. @@ -49,7 +49,7 @@ external make: 'a => t<'a> = "%identity" let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool -let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t +let compare: (t<'a>, t<'b>, ('a, 'b) => Stdlib_Ordering.t) => Stdlib_Ordering.t /** Converts a nullable value into an option, so it can be pattern matched on. diff --git a/runtime/Nullable.res b/runtime/Stdlib_Nullable.res similarity index 85% rename from runtime/Nullable.res rename to runtime/Stdlib_Nullable.res index aa08bcb68b..4d394cf5bb 100644 --- a/runtime/Nullable.res +++ b/runtime/Stdlib_Nullable.res @@ -1,5 +1,5 @@ @unboxed -type t<'a> = Js.Nullable.t<'a> = +type t<'a> = Primitive_js_extern.nullable<'a> = | Value('a) | @as(null) Null | @as(undefined) Undefined @@ -20,9 +20,9 @@ let fromOption: option<'a> => t<'a> = option => | None => undefined } -let equal = (a, b, eq) => Option.equal(a->toOption, b->toOption, eq) +let equal = (a, b, eq) => Stdlib_Option.equal(a->toOption, b->toOption, eq) -let compare = (a, b, cmp) => Option.compare(a->toOption, b->toOption, cmp) +let compare = (a, b, cmp) => Stdlib_Option.compare(a->toOption, b->toOption, cmp) let getOr = (value, default) => switch value->toOption { diff --git a/runtime/Nullable.resi b/runtime/Stdlib_Nullable.resi similarity index 97% rename from runtime/Nullable.resi rename to runtime/Stdlib_Nullable.resi index d03c4532a7..154feb4d5e 100644 --- a/runtime/Nullable.resi +++ b/runtime/Stdlib_Nullable.resi @@ -9,7 +9,7 @@ Type representing a nullable value. A nullable value can be the value `'a`, `null` or `undefined`. */ @unboxed -type t<'a> = Js.Nullable.t<'a> = +type t<'a> = Primitive_js_extern.nullable<'a> = | Value('a) | @as(null) Null | @as(undefined) Undefined @@ -82,7 +82,7 @@ external make: 'a => t<'a> = "%identity" let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool -let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t +let compare: (t<'a>, t<'b>, ('a, 'b) => Stdlib_Ordering.t) => Stdlib_Ordering.t /** Converts a nullable value into an option, so it can be pattern matched on. diff --git a/runtime/Object.res b/runtime/Stdlib_Object.res similarity index 98% rename from runtime/Object.res rename to runtime/Stdlib_Object.res index 6646088c0a..c8dd44ea05 100644 --- a/runtime/Object.res +++ b/runtime/Stdlib_Object.res @@ -123,9 +123,9 @@ x->Object.getSymbol(fruit) // Some("banana") ``` */ @get_index -external getSymbol: ({..}, Symbol.t) => option<'a> = "" +external getSymbol: ({..}, Stdlib_Symbol.t) => option<'a> = "" -@get_index external getSymbolUnsafe: ({..}, Symbol.t) => 'a = "" +@get_index external getSymbolUnsafe: ({..}, Stdlib_Symbol.t) => 'a = "" /** `set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties) @@ -141,7 +141,7 @@ external getSymbol: ({..}, Symbol.t) => option<'a> = "" @set_index external set: ({..}, string, 'a) => unit = "" -@set_index external setSymbol: ({..}, Symbol.t, 'a) => unit = "" +@set_index external setSymbol: ({..}, Stdlib_Symbol.t, 'a) => unit = "" /** `keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys) diff --git a/runtime/Option.res b/runtime/Stdlib_Option.res similarity index 91% rename from runtime/Option.res rename to runtime/Stdlib_Option.res index 6f4cafb477..c8d84d3574 100644 --- a/runtime/Option.res +++ b/runtime/Stdlib_Option.res @@ -38,7 +38,7 @@ let getExn = (x, ~message=?) => switch x { | Some(x) => x | None => - Error.panic( + Stdlib_Error.panic( switch message { | None => "Option.getExn called for None value" | Some(message) => message @@ -100,20 +100,20 @@ let equal = (a, b, eq) => let compare = (a, b, cmp) => switch (a, b) { | (Some(a), Some(b)) => cmp(a, b) - | (None, Some(_)) => Ordering.less - | (Some(_), None) => Ordering.greater - | (None, None) => Ordering.equal + | (None, Some(_)) => Stdlib_Ordering.less + | (Some(_), None) => Stdlib_Ordering.greater + | (None, None) => Stdlib_Ordering.equal } let all = options => { let acc = [] let hasNone = ref(false) let index = ref(0) - while hasNone.contents == false && index.contents < options->Array.length { - switch options->Array.getUnsafe(index.contents) { + while hasNone.contents == false && index.contents < options->Stdlib_Array.length { + switch options->Stdlib_Array.getUnsafe(index.contents) { | None => hasNone.contents = true | Some(value) => - acc->Array.push(value) + acc->Stdlib_Array.push(value) index.contents = index.contents + 1 } } diff --git a/runtime/Option.resi b/runtime/Stdlib_Option.resi similarity index 98% rename from runtime/Option.resi rename to runtime/Stdlib_Option.resi index 3f04e48ff4..e205983cff 100644 --- a/runtime/Option.resi +++ b/runtime/Stdlib_Option.resi @@ -260,7 +260,7 @@ Option.compare(Some(14), None, clockCompare) // 1. Option.compare(None, None, clockCompare) // 0. ``` */ -let compare: (option<'a>, option<'b>, ('a, 'b) => Ordering.t) => Ordering.t +let compare: (option<'a>, option<'b>, ('a, 'b) => Stdlib_Ordering.t) => Stdlib_Ordering.t /** `all(options)` returns an option of array if all options are Some, otherwise returns None. diff --git a/runtime/Ordering.res b/runtime/Stdlib_Ordering.res similarity index 100% rename from runtime/Ordering.res rename to runtime/Stdlib_Ordering.res diff --git a/runtime/Promise.res b/runtime/Stdlib_Promise.res similarity index 98% rename from runtime/Promise.res rename to runtime/Stdlib_Promise.res index 8a4418d2fd..9b9484a0bc 100644 --- a/runtime/Promise.res +++ b/runtime/Stdlib_Promise.res @@ -99,7 +99,7 @@ external _catch: (t<'a>, exn => t<'a>) => t<'a> = "catch" let catch = (promise: promise<'a>, callback: exn => promise<'a>): promise<'a> => { _catch(promise, err => { - callback(Js.Exn.anyToExnInternal(err)) + callback(Stdlib_Exn.anyToExnInternal(err)) }) } diff --git a/runtime/Promise.resi b/runtime/Stdlib_Promise.resi similarity index 100% rename from runtime/Promise.resi rename to runtime/Stdlib_Promise.resi diff --git a/runtime/RegExp.res b/runtime/Stdlib_RegExp.res similarity index 98% rename from runtime/RegExp.res rename to runtime/Stdlib_RegExp.res index 9f19af81ab..3eb1aaaa2e 100644 --- a/runtime/RegExp.res +++ b/runtime/Stdlib_RegExp.res @@ -1,4 +1,4 @@ -type t = Js.Re.t +type t module Result = { type t = array> diff --git a/runtime/RegExp.resi b/runtime/Stdlib_RegExp.resi similarity index 99% rename from runtime/RegExp.resi rename to runtime/Stdlib_RegExp.resi index 3e12daef52..39d7364957 100644 --- a/runtime/RegExp.resi +++ b/runtime/Stdlib_RegExp.resi @@ -7,7 +7,7 @@ See [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference /** Type representing an instantiated `RegExp`. */ -type t = Js.Re.t +type t module Result: { /** diff --git a/runtime/Result.res b/runtime/Stdlib_Result.res similarity index 93% rename from runtime/Result.res rename to runtime/Stdlib_Result.res index 158a6c7612..8f0ce15186 100644 --- a/runtime/Result.res +++ b/runtime/Stdlib_Result.res @@ -79,9 +79,9 @@ let equal = (a, b, f) => let compare = (a, b, f) => switch (a, b) { | (Ok(a), Ok(b)) => f(a, b) - | (Error(_), Ok(_)) => Ordering.less - | (Ok(_), Error(_)) => Ordering.greater - | (Error(_), Error(_)) => Ordering.equal + | (Error(_), Ok(_)) => Stdlib_Ordering.less + | (Ok(_), Error(_)) => Stdlib_Ordering.greater + | (Error(_), Error(_)) => Stdlib_Ordering.equal } let forEach = (r, f) => @@ -100,11 +100,11 @@ let all = results => { let acc = [] let returnValue = ref(None) let index = ref(0) - while returnValue.contents == None && index.contents < results->Array.length { - switch results->Array.getUnsafe(index.contents) { + while returnValue.contents == None && index.contents < results->Stdlib_Array.length { + switch results->Stdlib_Array.getUnsafe(index.contents) { | Error(_) as err => returnValue.contents = Some(err) | Ok(value) => - acc->Array.push(value) + acc->Stdlib_Array.push(value) index.contents = index.contents + 1 } } diff --git a/runtime/Result.resi b/runtime/Stdlib_Result.resi similarity index 98% rename from runtime/Result.resi rename to runtime/Stdlib_Result.resi index f63a167dc0..cd81e68df4 100644 --- a/runtime/Result.resi +++ b/runtime/Stdlib_Result.resi @@ -208,7 +208,7 @@ Result.compare(Error("x"), Ok(57), mod10cmp) == (-1.) Result.compare(Error("x"), Error("y"), mod10cmp) == 0. ``` */ -let compare: (result<'a, 'c>, result<'b, 'd>, ('a, 'b) => Ordering.t) => Ordering.t +let compare: (result<'a, 'c>, result<'b, 'd>, ('a, 'b) => Stdlib_Ordering.t) => Stdlib_Ordering.t /** `forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens. diff --git a/runtime/Set.res b/runtime/Stdlib_Set.res similarity index 86% rename from runtime/Set.res rename to runtime/Stdlib_Set.res index 00de67d662..9fd756fc6b 100644 --- a/runtime/Set.res +++ b/runtime/Stdlib_Set.res @@ -1,8 +1,8 @@ -type t<'a> = Js.Set.t<'a> +type t<'a> @new external make: unit => t<'a> = "Set" @new external fromArray: array<'a> => t<'a> = "Set" -@new external fromIterator: Iterator.t<'a> => t<'a> = "Set" +@new external fromIterator: Stdlib_Iterator.t<'a> => t<'a> = "Set" @get external size: t<'a> => int = "size" @@ -14,7 +14,7 @@ type t<'a> = Js.Set.t<'a> @send external forEach: (t<'a>, 'a => unit) => unit = "forEach" -@send external values: t<'a> => Iterator.t<'a> = "values" +@send external values: t<'a> => Stdlib_Iterator.t<'a> = "values" @send external difference: (t<'a>, t<'a>) => t<'a> = "difference" @send external intersection: (t<'a>, t<'a>) => t<'a> = "intersection" diff --git a/runtime/Set.resi b/runtime/Stdlib_Set.resi similarity index 98% rename from runtime/Set.resi rename to runtime/Stdlib_Set.resi index b61b699074..506bcf6d49 100644 --- a/runtime/Set.resi +++ b/runtime/Stdlib_Set.resi @@ -7,7 +7,7 @@ See [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Gl /** Type representing an instance of `Set`. */ -type t<'a> = Js.Set.t<'a> +type t<'a> /** Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values. @@ -73,7 +73,7 @@ iterator ``` */ @new -external fromIterator: Iterator.t<'a> => t<'a> = "Set" +external fromIterator: Stdlib_Iterator.t<'a> => t<'a> = "Set" /** Returns the size, the number of unique values, of the set. @@ -206,7 +206,7 @@ Console.log(set->Set.values->Iterator.toArray) ``` */ @send -external values: t<'a> => Iterator.t<'a> = "values" +external values: t<'a> => Stdlib_Iterator.t<'a> = "values" /** Returns a new set with the values of the set that are not in the other set. diff --git a/runtime/String.res b/runtime/Stdlib_String.res similarity index 82% rename from runtime/String.res rename to runtime/Stdlib_String.res index cab2376a60..18f8de1267 100644 --- a/runtime/String.res +++ b/runtime/Stdlib_String.res @@ -8,7 +8,7 @@ external equal: (string, string) => bool = "%equal" -external compare: (string, string) => Ordering.t = "%compare" +external compare: (string, string) => Stdlib_Ordering.t = "%compare" @get external length: string => int = "length" @get_index external get: (string, int) => option = "" @@ -44,7 +44,7 @@ let lastIndexOfOpt = (s, search) => @send external lastIndexOfFrom: (string, string, int) => int = "lastIndexOf" @return(nullable) @send -external match: (string, RegExp.t) => option = "match" +external match: (string, Stdlib_RegExp.t) => option = "match" type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD] @send external normalize: string => string = "normalize" @@ -53,35 +53,35 @@ type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD] @send external repeat: (string, int) => string = "repeat" @send external replace: (string, string, string) => string = "replace" -@send external replaceRegExp: (string, RegExp.t, string) => string = "replace" +@send external replaceRegExp: (string, Stdlib_RegExp.t, string) => string = "replace" @send external replaceAll: (string, string, string) => string = "replaceAll" -@send external replaceAllRegExp: (string, RegExp.t, string) => string = "replaceAll" +@send external replaceAllRegExp: (string, Stdlib_RegExp.t, string) => string = "replaceAll" @send external unsafeReplaceRegExpBy0: ( string, - RegExp.t, + Stdlib_RegExp.t, (~match: string, ~offset: int, ~input: string) => string, ) => string = "replace" @send external unsafeReplaceRegExpBy1: ( string, - RegExp.t, + Stdlib_RegExp.t, (~match: string, ~group1: string, ~offset: int, ~input: string) => string, ) => string = "replace" @send external unsafeReplaceRegExpBy2: ( string, - RegExp.t, + Stdlib_RegExp.t, (~match: string, ~group1: string, ~group2: string, ~offset: int, ~input: string) => string, ) => string = "replace" @send external unsafeReplaceRegExpBy3: ( string, - RegExp.t, + Stdlib_RegExp.t, ( ~match: string, ~group1: string, @@ -92,7 +92,7 @@ external unsafeReplaceRegExpBy3: ( ) => string, ) => string = "replace" -@send external search: (string, RegExp.t) => int = "search" +@send external search: (string, Stdlib_RegExp.t) => int = "search" let searchOpt = (s, re) => switch search(s, re) { | -1 => None @@ -104,9 +104,10 @@ let searchOpt = (s, re) => @send external split: (string, string) => array = "split" @send external splitAtMost: (string, string, ~limit: int) => array = "split" -@send external splitByRegExp: (string, RegExp.t) => array> = "split" +@send external splitByRegExp: (string, Stdlib_RegExp.t) => array> = "split" @send -external splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array> = "split" +external splitByRegExpAtMost: (string, Stdlib_RegExp.t, ~limit: int) => array> = + "split" @send external startsWith: (string, string) => bool = "startsWith" @send external startsWithFrom: (string, string, int) => bool = "startsWith" @@ -126,8 +127,8 @@ external splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array string = "padStart" @send external padEnd: (string, int, string) => string = "padEnd" -@get_index external getSymbol: (string, Symbol.t) => option<'a> = "" -@get_index external getSymbolUnsafe: (string, Symbol.t) => 'a = "" -@set_index external setSymbol: (string, Symbol.t, 'a) => unit = "" +@get_index external getSymbol: (string, Stdlib_Symbol.t) => option<'a> = "" +@get_index external getSymbolUnsafe: (string, Stdlib_Symbol.t) => 'a = "" +@set_index external setSymbol: (string, Stdlib_Symbol.t, 'a) => unit = "" @send external localeCompare: (string, string) => float = "localeCompare" diff --git a/runtime/String.resi b/runtime/Stdlib_String.resi similarity index 97% rename from runtime/String.resi rename to runtime/Stdlib_String.resi index 23537a1029..e769529662 100644 --- a/runtime/String.resi +++ b/runtime/Stdlib_String.resi @@ -120,7 +120,7 @@ external fromCodePointMany: array => string = "String.fromCodePoint" external equal: (string, string) => bool = "%equal" -external compare: (string, string) => Ordering.t = "%compare" +external compare: (string, string) => Stdlib_Ordering.t = "%compare" /** `length(str)` returns the length of the given `string`. @@ -439,7 +439,7 @@ String.match("The large container.", %re("/b[aeiou]g/")) == None */ @return(nullable) @send -external match: (string, RegExp.t) => option = "match" +external match: (string, Stdlib_RegExp.t) => option = "match" /** `normalize(str)` returns the normalized Unicode string using Normalization Form @@ -538,7 +538,7 @@ String.replaceRegExp("Juan Fulano", %re("/(\w+) (\w+)/"), "$2, $1") == "Fulano, ``` */ @send -external replaceRegExp: (string, RegExp.t, string) => string = "replace" +external replaceRegExp: (string, Stdlib_RegExp.t, string) => string = "replace" /** `replaceAll(str, substr, newSubstr)` returns a new `string` which is @@ -571,7 +571,7 @@ String.replaceAllRegExp("aabbcc", %re("/b/g"), ".") == "aa..cc" ``` */ @send -external replaceAllRegExp: (string, RegExp.t, string) => string = "replaceAll" +external replaceAllRegExp: (string, Stdlib_RegExp.t, string) => string = "replaceAll" /** `unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all @@ -593,7 +593,7 @@ String.unsafeReplaceRegExpBy0(str, re, matchFn) == "bEAUtIfUl vOwEls" @send external unsafeReplaceRegExpBy0: ( string, - RegExp.t, + Stdlib_RegExp.t, (~match: string, ~offset: int, ~input: string) => string, ) => string = "replace" @@ -616,7 +616,7 @@ String.unsafeReplaceRegExpBy1(str, re, matchFn) == "Jony is 41" @send external unsafeReplaceRegExpBy1: ( string, - RegExp.t, + Stdlib_RegExp.t, (~match: string, ~group1: string, ~offset: int, ~input: string) => string, ) => string = "replace" @@ -642,7 +642,7 @@ String.unsafeReplaceRegExpBy2(str, re, matchFn) == "42" @send external unsafeReplaceRegExpBy2: ( string, - RegExp.t, + Stdlib_RegExp.t, (~match: string, ~group1: string, ~group2: string, ~offset: int, ~input: string) => string, ) => string = "replace" @@ -654,7 +654,7 @@ See [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R @send external unsafeReplaceRegExpBy3: ( string, - RegExp.t, + Stdlib_RegExp.t, ( ~match: string, ~group1: string, @@ -678,7 +678,7 @@ String.search("no numbers", %re("/\d+/")) == -1 ``` */ @send -external search: (string, RegExp.t) => int = "search" +external search: (string, Stdlib_RegExp.t) => int = "search" /** `searchOpt(str, regexp)`. Like `search`, but return an `option`. @@ -690,7 +690,7 @@ String.searchOpt("testing 1 2 3", %re("/\d+/")) == Some(8) String.searchOpt("no numbers", %re("/\d+/")) == None ``` */ -let searchOpt: (string, RegExp.t) => option +let searchOpt: (string, Stdlib_RegExp.t) => option /** `slice(str, ~start, ~end)` returns the substring of `str` starting at @@ -778,7 +778,7 @@ String.splitByRegExp("Jan,Feb,Mar", %re("/,/")) == [Some("Jan"), Some("Feb"), So ``` */ @send -external splitByRegExp: (string, RegExp.t) => array> = "split" +external splitByRegExp: (string, Stdlib_RegExp.t) => array> = "split" /** `splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every @@ -798,7 +798,8 @@ String.splitByRegExpAtMost("Hello World. How are you doing?", %re("/ /"), ~limit ``` */ @send -external splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array> = "split" +external splitByRegExpAtMost: (string, Stdlib_RegExp.t, ~limit: int) => array> = + "split" /** `startsWith(str, substr)` returns `true` if the `str` starts with `substr`, @@ -1000,9 +1001,9 @@ String.padEnd("abc", 1, "") == "abc" external padEnd: (string, int, string) => string = "padEnd" // TODO: add docs -@get_index external getSymbol: (string, Symbol.t) => option<'a> = "" -@get_index external getSymbolUnsafe: (string, Symbol.t) => 'a = "" -@set_index external setSymbol: (string, Symbol.t, 'a) => unit = "" +@get_index external getSymbol: (string, Stdlib_Symbol.t) => option<'a> = "" +@get_index external getSymbolUnsafe: (string, Stdlib_Symbol.t) => 'a = "" +@set_index external setSymbol: (string, Stdlib_Symbol.t, 'a) => unit = "" /** `localeCompare(referenceStr, compareStr)` returns a float than indicatings diff --git a/runtime/Symbol.res b/runtime/Stdlib_Symbol.res similarity index 96% rename from runtime/Symbol.res rename to runtime/Stdlib_Symbol.res index 8b4c1b218d..1dc2b9b6b2 100644 --- a/runtime/Symbol.res +++ b/runtime/Stdlib_Symbol.res @@ -1,4 +1,4 @@ -type t = Js.Types.symbol +type t @val external make: string => t = "Symbol" @val external getFor: string => t = "Symbol.for" diff --git a/runtime/Type.res b/runtime/Stdlib_Type.res similarity index 89% rename from runtime/Type.res rename to runtime/Stdlib_Type.res index d29bb28c78..6c2a381d63 100644 --- a/runtime/Type.res +++ b/runtime/Stdlib_Type.res @@ -3,8 +3,8 @@ type t = [#undefined | #object | #boolean | #number | #bigint | #string | #symbo external typeof: 'a => t = "#typeof" module Classify = { - type function = Js.Types.function_val - type object = Js.Types.obj_val + type function + type object type t = | Bool(bool) @@ -14,7 +14,7 @@ module Classify = { | Number(float) | Object(object) | Function(function) - | Symbol(Symbol.t) + | Symbol(Stdlib_Symbol.t) | BigInt(bigint) @val external _internalClass: 'a => string = "Object.prototype.toString.call" @@ -23,7 +23,7 @@ module Classify = { external _asFloat: 'a => float = "%identity" external _asObject: 'a => object = "%identity" external _asFunction: 'a => function = "%identity" - external _asSymbol: 'a => Symbol.t = "%identity" + external _asSymbol: 'a => Stdlib_Symbol.t = "%identity" external _asBigInt: 'a => bigint = "%identity" let classify = value => { diff --git a/runtime/Type.resi b/runtime/Stdlib_Type.resi similarity index 98% rename from runtime/Type.resi rename to runtime/Stdlib_Type.resi index ee6519b653..19de09bddf 100644 --- a/runtime/Type.resi +++ b/runtime/Stdlib_Type.resi @@ -58,7 +58,7 @@ module Classify: { | Number(float) | Object(object) | Function(function) - | Symbol(Symbol.t) + | Symbol(Stdlib_Symbol.t) | BigInt(bigint) /** diff --git a/runtime/TypedArray.res b/runtime/Stdlib_TypedArray.res similarity index 93% rename from runtime/TypedArray.res rename to runtime/Stdlib_TypedArray.res index 35ccbc4fa3..187adfeca1 100644 --- a/runtime/TypedArray.res +++ b/runtime/Stdlib_TypedArray.res @@ -3,7 +3,7 @@ type t<'a> @get_index external get: (t<'a>, int) => option<'a> = "" @set_index external set: (t<'a>, int, 'a) => unit = "" -@get external buffer: t<'a> => ArrayBuffer.t = "buffer" +@get external buffer: t<'a> => Stdlib_ArrayBuffer.t = "buffer" @get external byteLength: t<'a> => int = "byteLength" @get external byteOffset: t<'a> => int = "byteOffset" @@ -24,8 +24,8 @@ external copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int) => array<'a> @send external reverse: t<'a> => unit = "reverse" @send external toReversed: t<'a> => t<'a> = "toReversed" -@send external sort: (t<'a>, ('a, 'a) => Ordering.t) => unit = "sort" -@send external toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a> = "toSorted" +@send external sort: (t<'a>, ('a, 'a) => Stdlib_Ordering.t) => unit = "sort" +@send external toSorted: (t<'a>, ('a, 'a) => Stdlib_Ordering.t) => t<'a> = "toSorted" @send external with: (t<'a>, int, 'a) => t<'a> = "with" diff --git a/runtime/Uint16Array.res b/runtime/Stdlib_Uint16Array.res similarity index 91% rename from runtime/Uint16Array.res rename to runtime/Stdlib_Uint16Array.res index 115caf8a2f..66373ab703 100644 --- a/runtime/Uint16Array.res +++ b/runtime/Stdlib_Uint16Array.res @@ -1,6 +1,6 @@ /** The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Uint16Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Uint16Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Uint16Array" /** `fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Uint16Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Uint16Array" /** `fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Uint16Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Uint16Array" /** `fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array) diff --git a/runtime/Uint32Array.res b/runtime/Stdlib_Uint32Array.res similarity index 91% rename from runtime/Uint32Array.res rename to runtime/Stdlib_Uint32Array.res index ba6693054a..b58014cc5c 100644 --- a/runtime/Uint32Array.res +++ b/runtime/Stdlib_Uint32Array.res @@ -1,6 +1,6 @@ /** The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Uint32Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Uint32Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Uint32Array" /** `fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Uint32Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Uint32Array" /** `fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Uint32Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Uint32Array" /** `fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array) diff --git a/runtime/Uint8Array.res b/runtime/Stdlib_Uint8Array.res similarity index 91% rename from runtime/Uint8Array.res rename to runtime/Stdlib_Uint8Array.res index 2233a039b3..d56225118b 100644 --- a/runtime/Uint8Array.res +++ b/runtime/Stdlib_Uint8Array.res @@ -1,6 +1,6 @@ /** The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,22 @@ external fromArray: array => t = "Uint8Array" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Uint8Array" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Uint8Array" /** `fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Uint8Array" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Uint8Array" /** `fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Uint8Array" +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = + "Uint8Array" /** `fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array) diff --git a/runtime/Uint8ClampedArray.res b/runtime/Stdlib_Uint8ClampedArray.res similarity index 91% rename from runtime/Uint8ClampedArray.res rename to runtime/Stdlib_Uint8ClampedArray.res index 633dd4ca18..9e280bc761 100644 --- a/runtime/Uint8ClampedArray.res +++ b/runtime/Stdlib_Uint8ClampedArray.res @@ -1,6 +1,6 @@ /** The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) */ -type t = TypedArray.t +type t = Stdlib_TypedArray.t module Constants = { /**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT) @@ -19,21 +19,21 @@ external fromArray: array => t = "Uint8ClampedArray" **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBuffer: ArrayBuffer.t => t = "Uint8ClampedArray" +external fromBuffer: Stdlib_ArrayBuffer.t => t = "Uint8ClampedArray" /** `fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "Uint8ClampedArray" +external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Uint8ClampedArray" /** `fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray) **Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds. */ @new -external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = +external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "Uint8ClampedArray" /** `fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray) diff --git a/runtime/WeakMap.res b/runtime/Stdlib_WeakMap.res similarity index 88% rename from runtime/WeakMap.res rename to runtime/Stdlib_WeakMap.res index 4bc91810da..42dde986a3 100644 --- a/runtime/WeakMap.res +++ b/runtime/Stdlib_WeakMap.res @@ -1,4 +1,4 @@ -type t<'k, 'v> = Js.WeakMap.t<'k, 'v> +type t<'k, 'v> @new external make: unit => t<'k, 'v> = "WeakMap" diff --git a/runtime/WeakSet.res b/runtime/Stdlib_WeakSet.res similarity index 86% rename from runtime/WeakSet.res rename to runtime/Stdlib_WeakSet.res index 851329c80d..b8c17e946b 100644 --- a/runtime/WeakSet.res +++ b/runtime/Stdlib_WeakSet.res @@ -1,4 +1,4 @@ -type t<'a> = Js.WeakSet.t<'a> +type t<'a> @new external make: unit => t<'a> = "WeakSet" diff --git a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt index 0f3b3ca01e..05f269144a 100644 --- a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt +++ b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt @@ -2,7 +2,8 @@ Complete src/GenericJsxCompletion.res 0:8 posCursor:[0:8] posNoWhite:[0:6] Found expr:[0:4->0:7] JSX 0:7] > _children:None Completable: Cjsx([div], "", []) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path GenericJsx.Elements.props [{ "label": "testing", @@ -28,7 +29,8 @@ Complete src/GenericJsxCompletion.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:4->3:18] JSX 3:7] testing[3:8->3:15]=...[3:16->3:18]> _children:None Completable: Cexpression CJsxPropValue [div] testing->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] testing Path GenericJsx.Elements.props [{ @@ -55,11 +57,12 @@ posCursor:[14:21] posNoWhite:[14:20] Found expr:[13:4->22:10] posCursor:[14:21] posNoWhite:[14:20] Found expr:[14:7->22:10] posCursor:[14:21] posNoWhite:[14:20] Found expr:[14:7->14:21] Completable: Cpath Value[someString]->st <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString -Path String.st +Path Stdlib.String.st [{ "label": "GenericJsx.string", "kind": 12, @@ -101,12 +104,12 @@ posCursor:[20:24] posNoWhite:[20:23] Found expr:[20:10->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[20:10->20:24] Completable: Cpath Value[someString]->st <> Raw opens: 1 GenericJsx.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 GenericJsx +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib GenericJsx ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString -Path String.st +Path Stdlib.String.st [{ "label": "string", "kind": 12, diff --git a/tests/analysis_tests/tests-incremental-typechecking/package-lock.json b/tests/analysis_tests/tests-incremental-typechecking/package-lock.json index 1f4807c3ef..fae19879c4 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/package-lock.json +++ b/tests/analysis_tests/tests-incremental-typechecking/package-lock.json @@ -10,7 +10,7 @@ }, "../../..": { "name": "rescript", - "version": "12.0.0-alpha.8", + "version": "12.0.0-alpha.9", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "bin": { diff --git a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt index f8ec1d135a..bab658f9b9 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt +++ b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt @@ -4,14 +4,15 @@ Pexp_construct Js Json Array:[0:8->0:21] [0:21->0:23] Completable: Cexpression CTypeAtPos()->variantPayload::Array($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTypeAtPos() [{ "label": "[]", "kind": 12, "tags": [], "detail": "t", - "documentation": {"kind": "markdown", "value": " The JSON data structure \n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)\n```"}, + "documentation": {"kind": "markdown", "value": " \nA type representing a JSON object.\n\n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)\n```"}, "sortText": "A", "insertText": "[$0]", "insertTextFormat": 2 diff --git a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt index 670bfc7bc2..585f53f395 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt +++ b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt @@ -3,7 +3,8 @@ posCursor:[4:24] posNoWhite:[4:23] Found expr:[4:8->4:25] Pexp_construct WithVariant One:[4:8->4:23] [4:23->4:25] Completable: Cexpression CTypeAtPos()->variantPayload::One($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTypeAtPos() [{ "label": "{}", diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt b/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt index 7b5b08f55d..99902b72a5 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt +++ b/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt @@ -2755,11 +2755,9 @@ File References DeadTest.res:121:1-40 theSideEffectIsLogging is never used and could have side effects - Warning Dead Value + Warning Dead Value With Side Effects DeadTest.res:123:1-54 - stringLengthNoSideEffects is never used - <-- line 123 - @dead("stringLengthNoSideEffects") let stringLengthNoSideEffects = String.length("sdkdl") + stringLengthNoSideEffects is never used and could have side effects Warning Dead Type DeadTest.res:151:12-17 @@ -4249,4 +4247,4 @@ File References <-- line 96 type variant1Object = | @dead("variant1Object.R") R(payload) - Analysis reported 302 issues (Incorrect Dead Annotation:1, Warning Dead Exception:2, Warning Dead Module:21, Warning Dead Type:87, Warning Dead Value:174, Warning Dead Value With Side Effects:1, Warning Redundant Optional Argument:5, Warning Unused Argument:11) + Analysis reported 302 issues (Incorrect Dead Annotation:1, Warning Dead Exception:2, Warning Dead Module:21, Warning Dead Type:87, Warning Dead Value:173, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:5, Warning Unused Argument:11) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/package-lock.json b/tests/analysis_tests/tests-reanalyze/deadcode/package-lock.json index 604c1602a7..f74abaab47 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/package-lock.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode/package-lock.json @@ -16,7 +16,7 @@ }, "../../../..": { "name": "rescript", - "version": "12.0.0-alpha.8", + "version": "12.0.0-alpha.9", "dev": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", diff --git a/tests/analysis_tests/tests-reanalyze/termination/package-lock.json b/tests/analysis_tests/tests-reanalyze/termination/package-lock.json index fd0cd95e7d..419af45336 100644 --- a/tests/analysis_tests/tests-reanalyze/termination/package-lock.json +++ b/tests/analysis_tests/tests-reanalyze/termination/package-lock.json @@ -12,8 +12,7 @@ } }, "../../../..": { - "name": "rescript", - "version": "12.0.0-alpha.8", + "version": "12.0.0-alpha.9", "dev": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", diff --git a/tests/analysis_tests/tests/package-lock.json b/tests/analysis_tests/tests/package-lock.json index 1f0d8fa0ca..78c67ca53e 100644 --- a/tests/analysis_tests/tests/package-lock.json +++ b/tests/analysis_tests/tests/package-lock.json @@ -34,7 +34,7 @@ }, "../../..": { "name": "rescript", - "version": "12.0.0-alpha.8", + "version": "12.0.0-alpha.9", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "bin": { diff --git a/tests/analysis_tests/tests/bsconfig.json b/tests/analysis_tests/tests/rescript.json similarity index 100% rename from tests/analysis_tests/tests/bsconfig.json rename to tests/analysis_tests/tests/rescript.json diff --git a/tests/analysis_tests/tests/src/expected/Auto.res.txt b/tests/analysis_tests/tests/src/expected/Auto.res.txt index 75383fb52e..9963f93284 100644 --- a/tests/analysis_tests/tests/src/expected/Auto.res.txt +++ b/tests/analysis_tests/tests/src/expected/Auto.res.txt @@ -1,3 +1,3 @@ Hover src/Auto.res 2:13 -{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, List.t<'a>) => List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22List.res%22%2C34%2C0%5D)\n"}} +{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, Stdlib.List.t<'a>) => Stdlib.List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype Stdlib.List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Stdlib_List.resi%22%2C34%2C0%5D)\n"}} diff --git a/tests/analysis_tests/tests/src/expected/BrokenParserCases.res.txt b/tests/analysis_tests/tests/src/expected/BrokenParserCases.res.txt index 821b3b35f8..9a1b5290d7 100644 --- a/tests/analysis_tests/tests/src/expected/BrokenParserCases.res.txt +++ b/tests/analysis_tests/tests/src/expected/BrokenParserCases.res.txt @@ -2,7 +2,8 @@ Complete src/BrokenParserCases.res 2:24 posCursor:[2:24] posNoWhite:[2:23] Found expr:[2:11->2:30] Pexp_apply ...[2:11->2:17] (~isOff2:19->2:24=...[2:27->2:29]) Completable: CnamedArg(Value[someFn], isOff, [isOff]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFn] Path someFn [] @@ -10,7 +11,8 @@ Path someFn Complete src/BrokenParserCases.res 6:17 posCursor:[6:17] posNoWhite:[6:16] Found pattern:[6:16->6:19] Completable: Cpattern Value[s]=t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [] @@ -20,7 +22,8 @@ posCursor:[10:29] posNoWhite:[10:27] Found pattern:[10:24->10:39] posCursor:[10:29] posNoWhite:[10:27] Found pattern:[10:24->10:28] Ppat_construct None:[10:24->10:28] Completable: Cpath Value[None] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[None] Path None [] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt index d81addd6eb..e983edc102 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt @@ -1,7 +1,8 @@ Complete src/CompletePrioritize1.res 6:6 posCursor:[6:6] posNoWhite:[6:5] Found expr:[6:3->0:-1] Completable: Cpath Value[a]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[a]-> ContextPath Value[a] Path a diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt index 0e9aaa3e64..7d49d20ef3 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt @@ -1,7 +1,8 @@ Complete src/CompletePrioritize2.res 9:7 posCursor:[9:7] posNoWhite:[9:6] Found expr:[9:3->0:-1] Completable: Cpath Value[ax]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[ax]-> ContextPath Value[ax] Path ax @@ -19,7 +20,8 @@ Complete src/CompletePrioritize2.res 12:5 posCursor:[12:5] posNoWhite:[12:4] Found expr:[12:3->12:5] Pexp_ident ax:[12:3->12:5] Completable: Cpath Value[ax] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[ax] Path ax [{ diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index 3a55155f10..c388dfad00 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -2,7 +2,8 @@ Complete src/Completion.res 1:11 posCursor:[1:11] posNoWhite:[1:10] Found expr:[1:3->1:11] Pexp_ident MyList.m:[1:3->1:11] Completable: Cpath Value[MyList, m] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[MyList, m] Path MyList.m [{ @@ -41,7 +42,8 @@ Complete src/Completion.res 3:9 posCursor:[3:9] posNoWhite:[3:8] Found expr:[3:3->3:9] Pexp_ident Array.:[3:3->3:9] Completable: Cpath Value[Array, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Array, ""] Path Array. [{ @@ -114,13 +116,13 @@ Path Array. "label": "getSymbol", "kind": 12, "tags": [], - "detail": "(array<'a>, Symbol.t) => option<'b>", + "detail": "(array<'a>, Stdlib_Symbol.t) => option<'b>", "documentation": null }, { "label": "getSymbolUnsafe", "kind": 12, "tags": [], - "detail": "(array<'a>, Symbol.t) => 'b", + "detail": "(array<'a>, Stdlib_Symbol.t) => 'b", "documentation": null }, { "label": "findIndexOpt", @@ -216,7 +218,7 @@ Path Array. "label": "sort", "kind": 12, "tags": [], - "detail": "(array<'a>, ('a, 'a) => Ordering.t) => unit", + "detail": "(array<'a>, ('a, 'a) => Stdlib_Ordering.t) => unit", "documentation": {"kind": "markdown", "value": "\n`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray->assertEqual([1, 2, 3])\n```\n"} }, { "label": "length", @@ -324,7 +326,7 @@ Path Array. "label": "compare", "kind": 12, "tags": [], - "detail": "(array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t", + "detail": "(\n array<'a>,\n array<'a>,\n ('a, 'a) => Stdlib_Ordering.t,\n) => Stdlib_Ordering.t", "documentation": null }, { "label": "join", @@ -372,7 +374,7 @@ Path Array. "label": "fromArrayLikeWithMap", "kind": 12, "tags": [], - "detail": "(Js.Array2.array_like<'a>, 'a => 'b) => array<'b>", + "detail": "(arrayLike<'a>, 'a => 'b) => array<'b>", "documentation": null }, { "label": "fillAll", @@ -402,7 +404,7 @@ Path Array. "label": "setSymbol", "kind": 12, "tags": [], - "detail": "(array<'a>, Symbol.t, 'b) => unit", + "detail": "(array<'a>, Stdlib_Symbol.t, 'b) => unit", "documentation": null }, { "label": "equal", @@ -456,7 +458,7 @@ Path Array. "label": "toSorted", "kind": 12, "tags": [], - "detail": "(array<'a>, ('a, 'a) => Ordering.t) => array<'a>", + "detail": "(array<'a>, ('a, 'a) => Stdlib_Ordering.t) => array<'a>", "documentation": {"kind": "markdown", "value": "\n`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray\n->Array.toSorted(Int.compare)\n->assertEqual([1, 2, 3])\n\nsomeArray->assertEqual([3, 2, 1]) // Original unchanged\n```\n"} }, { "label": "reduceWithIndex", @@ -516,7 +518,7 @@ Path Array. "label": "fromIterator", "kind": 12, "tags": [], - "detail": "Iterator.t<'a> => array<'a>", + "detail": "Stdlib_Iterator.t<'a> => array<'a>", "documentation": {"kind": "markdown", "value": "\n`fromIterator(iterator)`\n\nCreates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator\n->assertEqual([1, 2])\n```\n"} }, { "label": "forEach", @@ -534,7 +536,7 @@ Path Array. "label": "fromArrayLike", "kind": 12, "tags": [], - "detail": "Js.Array2.array_like<'a> => array<'a>", + "detail": "arrayLike<'a> => array<'a>", "documentation": null }, { "label": "indexOfFrom", @@ -548,7 +550,8 @@ Complete src/Completion.res 5:10 posCursor:[5:10] posNoWhite:[5:9] Found expr:[5:3->5:10] Pexp_ident Array.m:[5:3->5:10] Completable: Cpath Value[Array, m] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Array, m] Path Array.m [{ @@ -575,7 +578,8 @@ Complete src/Completion.res 15:17 posCursor:[15:17] posNoWhite:[15:16] Found expr:[15:12->15:17] Pexp_ident Dep.c:[15:12->15:17] Completable: Cpath Value[Dep, c] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Dep, c] Path Dep.c [{ @@ -590,7 +594,8 @@ Complete src/Completion.res 23:20 posCursor:[23:20] posNoWhite:[23:19] Found expr:[23:11->23:20] Pexp_apply ...[23:11->23:18] () Completable: CnamedArg(Value[Lib, foo], "", []) -Package opens Pervasives.JsxModules.place holder +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 @@ -611,10 +616,11 @@ Found type for function (~age: int, ~name: string) => string Complete src/Completion.res 26:13 posCursor:[26:13] posNoWhite:[26:12] Found expr:[26:3->26:13] Completable: Cpath array->m -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath array->m ContextPath array -Path Array.m +Path Stdlib.Array.m [{ "label": "Array.map", "kind": 12, @@ -632,10 +638,11 @@ Path Array.m Complete src/Completion.res 29:13 posCursor:[29:13] posNoWhite:[29:12] Found expr:[29:3->29:13] Completable: Cpath string->toU -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath string->toU ContextPath string -Path String.toU +Path Stdlib.String.toU [{ "label": "String.toUpperCase", "kind": 12, @@ -647,11 +654,12 @@ Path String.toU Complete src/Completion.res 34:8 posCursor:[34:8] posNoWhite:[34:7] Found expr:[34:3->34:8] Completable: Cpath Value[op]->e -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[op]->e ContextPath Value[op] Path op -Path Option.e +Path Stdlib.Option.e [{ "label": "Option.equal", "kind": 12, @@ -665,7 +673,8 @@ posCursor:[44:7] posNoWhite:[44:6] Found expr:[44:3->54:3] Pexp_apply ...[50:9->50:10] (...[44:3->50:8], ...[51:2->54:3]) posCursor:[44:7] posNoWhite:[44:6] Found expr:[44:3->50:8] Completable: Cpath Value[fa]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fa]-> ContextPath Value[fa] Path fa @@ -693,7 +702,8 @@ Complete src/Completion.res 59:30 posCursor:[59:30] posNoWhite:[59:29] Found expr:[59:15->59:30] JSX 59:21] second[59:22->59:28]=...[59:29->59:30]> _children:None Completable: Cexpression CJsxPropValue [O, Comp] second=z -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [O, Comp] second Path O.Comp.make [{ @@ -708,7 +718,8 @@ Complete src/Completion.res 62:23 posCursor:[62:23] posNoWhite:[62:22] Found expr:[62:15->62:23] JSX 62:21] z[62:22->62:23]=...[62:22->62:23]> _children:None Completable: Cjsx([O, Comp], z, [z]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path O.Comp.make [{ "label": "zoo", @@ -721,7 +732,8 @@ Path O.Comp.make Complete src/Completion.res 65:8 Attribute id:reac:[65:3->65:8] label:reac Completable: Cdecorator(reac) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "react.component", "kind": 4, @@ -736,7 +748,8 @@ posCursor:[68:10] posNoWhite:[68:9] Found expr:[0:-1->86:1] Pexp_apply ...[80:6->80:7] (...[80:8->86:1]) Attribute id:react.let:[68:3->80:3] label:react. Completable: Cdecorator(react.) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "component", "kind": 4, @@ -750,7 +763,8 @@ Complete src/Completion.res 71:27 posCursor:[71:27] posNoWhite:[71:26] Found expr:[71:11->71:27] Pexp_apply ...[71:11->71:18] (~name71:20->71:24=...[71:20->71:24]) Completable: CnamedArg(Value[Lib, foo], "", [name]) -Package opens Pervasives.JsxModules.place holder +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 @@ -766,7 +780,8 @@ Complete src/Completion.res 74:26 posCursor:[74:26] posNoWhite:[74:25] Found expr:[74:11->74:26] Pexp_apply ...[74:11->74:18] (~age74:20->74:23=...[74:20->74:23]) Completable: CnamedArg(Value[Lib, foo], "", [age]) -Package opens Pervasives.JsxModules.place holder +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 @@ -782,7 +797,8 @@ Complete src/Completion.res 77:32 posCursor:[77:32] posNoWhite:[77:31] Found expr:[77:11->77:32] Pexp_apply ...[77:11->77:18] (~age77:20->77:23=...[77:25->77:28]) Completable: CnamedArg(Value[Lib, foo], "", [age]) -Package opens Pervasives.JsxModules.place holder +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 @@ -798,7 +814,8 @@ Complete src/Completion.res 82:5 posCursor:[82:5] posNoWhite:[82:4] Found expr:[80:8->86:1] Pexp_apply ...[80:8->80:15] (~age84:3->84:6=...[84:7->84:8], ~name85:3->85:7=...[85:8->85:10]) Completable: CnamedArg(Value[Lib, foo], "", [age, name]) -Package opens Pervasives.JsxModules.place holder +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 @@ -808,7 +825,8 @@ Complete src/Completion.res 90:13 posCursor:[90:13] posNoWhite:[90:12] Found expr:[90:3->93:18] Pexp_send a[90:12->90:13] e:[90:3->90:10] Completable: Cpath Value[someObj]["a"] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someObj]["a"] ContextPath Value[someObj] Path someObj @@ -824,7 +842,8 @@ Complete src/Completion.res 95:24 posCursor:[95:24] posNoWhite:[95:23] Found expr:[95:3->99:6] Pexp_send [95:24->95:24] e:[95:3->95:22] Completable: Cpath Value[nestedObj]["x"]["y"][""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[nestedObj]["x"]["y"][""] ContextPath Value[nestedObj]["x"]["y"] ContextPath Value[nestedObj]["x"] @@ -848,7 +867,8 @@ Complete src/Completion.res 99:7 posCursor:[99:7] posNoWhite:[99:6] Found expr:[99:3->102:20] Pexp_send a[99:6->99:7] e:[99:3->99:4] Completable: Cpath Value[o]["a"] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[o]["a"] ContextPath Value[o] Path o @@ -864,7 +884,8 @@ Complete src/Completion.res 104:17 posCursor:[104:17] posNoWhite:[104:16] Found expr:[104:3->125:19] Pexp_send [104:17->104:17] e:[104:3->104:15] Completable: Cpath Value[no]["x"]["y"][""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[no]["x"]["y"][""] ContextPath Value[no]["x"]["y"] ContextPath Value[no]["x"] @@ -888,7 +909,8 @@ Complete src/Completion.res 110:5 posCursor:[110:5] posNoWhite:[110:4] Found expr:[110:3->110:5] Pexp_field [110:3->110:4] _:[116:0->110:5] Completable: Cpath Value[r]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[r]."" ContextPath Value[r] Path r @@ -915,7 +937,8 @@ Complete src/Completion.res 113:25 posCursor:[113:25] posNoWhite:[113:24] Found expr:[113:3->113:25] Pexp_field [113:3->113:24] _:[116:0->113:25] Completable: Cpath Value[Objects, Rec, recordVal]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Objects, Rec, recordVal]."" ContextPath Value[Objects, Rec, recordVal] Path Objects.Rec.recordVal @@ -944,7 +967,8 @@ posCursor:[120:7] posNoWhite:[120:6] Found expr:[120:5->122:5] posCursor:[120:7] posNoWhite:[120:6] Found expr:[120:5->120:7] Pexp_ident my:[120:5->120:7] Completable: Cpath Value[my] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[my] Path my [{ @@ -959,7 +983,8 @@ Complete src/Completion.res 125:19 posCursor:[125:19] posNoWhite:[125:18] Found expr:[125:3->145:32] Pexp_send [125:19->125:19] e:[125:3->125:17] Completable: Cpath Value[Objects, object][""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Objects, object][""] ContextPath Value[Objects, object] Path Objects.object @@ -981,7 +1006,8 @@ Complete src/Completion.res 151:6 posCursor:[151:6] posNoWhite:[151:5] Found expr:[151:4->151:6] JSX 151:6] > _children:None Completable: Cpath Module[O, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[O, ""] Path O. [{ @@ -996,7 +1022,8 @@ Complete src/Completion.res 157:8 posCursor:[157:8] posNoWhite:[157:7] Found expr:[157:3->157:8] Pexp_field [157:3->157:7] _:[165:0->157:8] Completable: Cpath Value[q].aa."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[q].aa."" ContextPath Value[q].aa ContextPath Value[q] @@ -1035,7 +1062,8 @@ Complete src/Completion.res 159:9 posCursor:[159:9] posNoWhite:[159:8] Found expr:[159:3->159:9] Pexp_field [159:3->159:7] n:[159:8->159:9] Completable: Cpath Value[q].aa.n -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[q].aa.n ContextPath Value[q].aa ContextPath Value[q] @@ -1068,7 +1096,8 @@ Complete src/Completion.res 162:6 posCursor:[162:6] posNoWhite:[162:5] Found expr:[162:3->162:6] Pexp_construct Lis:[162:3->162:6] None Completable: Cpath Value[Lis] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Lis] Path Lis [{ @@ -1076,18 +1105,15 @@ Path Lis "kind": 9, "tags": [], "detail": "module List", - "documentation": null, - "data": { - "modulePath": "List", - "filePath": "src/Completion.res" - } + "documentation": null }] Complete src/Completion.res 169:16 posCursor:[169:16] posNoWhite:[169:15] Found expr:[169:4->169:16] JSX 169:16] > _children:None Completable: Cpath Module[WithChildren] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren [{ @@ -1102,7 +1128,8 @@ Complete src/Completion.res 172:17 posCursor:[172:17] posNoWhite:[172:16] Found type:[172:12->172:17] Ptyp_constr Null.:[172:12->172:17] Completable: Cpath Type[Null, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[Null, ""] Path Null. [{ @@ -1110,14 +1137,15 @@ Path Null. "kind": 22, "tags": [], "detail": "type t", - "documentation": {"kind": "markdown", "value": "\nA type representing a value that can be either `'a` or `null`.\n\n\n```rescript\n@unboxed\ntype t<'a> = Js.Null.t<'a> = Value('a) | @as(null) Null\n```"} + "documentation": {"kind": "markdown", "value": "\nA type representing a value that can be either `'a` or `null`.\n\n\n```rescript\n@unboxed\ntype t<'a> = Primitive_js_extern.null<'a> =\n | Value('a)\n | @as(null) Null\n```"} }] Complete src/Completion.res 174:20 posCursor:[174:20] posNoWhite:[174:19] Found type:[174:12->174:20] Ptyp_constr ForAuto.:[174:12->174:20] Completable: Cpath Type[ForAuto, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[ForAuto, ""] Path ForAuto. [{ @@ -1132,7 +1160,8 @@ Complete src/Completion.res 179:13 posCursor:[179:13] posNoWhite:[179:12] Found expr:[179:11->179:13] Pexp_construct As:[179:11->179:13] None Completable: Cpath Value[As] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[As] Path As [{ @@ -1146,17 +1175,14 @@ Path As "kind": 9, "tags": [], "detail": "module AsyncIterator", - "documentation": null, - "data": { - "modulePath": "AsyncIterator", - "filePath": "src/Completion.res" - } + "documentation": null }] Complete src/Completion.res 182:17 Pmod_ident For:[182:14->182:17] Completable: Cpath Module[For] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[For] Path For [{ @@ -1171,7 +1197,8 @@ Complete src/Completion.res 190:11 posCursor:[190:11] posNoWhite:[190:10] Found expr:[190:3->190:11] Pexp_ident Private.:[190:3->190:11] Completable: Cpath Value[Private, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Private, ""] Path Private. [{ @@ -1186,7 +1213,8 @@ Complete src/Completion.res 202:6 posCursor:[202:6] posNoWhite:[202:5] Found expr:[202:3->202:6] Pexp_ident sha:[202:3->202:6] Completable: Cpath Value[sha] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[sha] Path sha [] @@ -1196,8 +1224,8 @@ posCursor:[205:6] posNoWhite:[205:5] Found expr:[205:3->205:6] Pexp_ident sha:[205:3->205:6] Completable: Cpath Value[sha] Raw opens: 1 Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib Completion ContextPath Value[sha] Path sha [{ @@ -1213,8 +1241,8 @@ posCursor:[208:6] posNoWhite:[208:5] Found expr:[208:3->208:6] Pexp_ident sha:[208:3->208:6] Completable: Cpath Value[sha] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[sha] Path sha [{ @@ -1230,8 +1258,8 @@ posCursor:[221:22] posNoWhite:[221:21] Found expr:[221:3->224:22] Pexp_send [221:22->221:22] e:[221:3->221:20] Completable: Cpath Value[FAO, forAutoObject][""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject @@ -1254,8 +1282,8 @@ posCursor:[224:37] posNoWhite:[224:36] Found expr:[224:3->224:37] Pexp_field [224:3->224:36] _:[233:0->224:37] Completable: Cpath Value[FAO, forAutoObject]["forAutoLabel"]."" Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject]["forAutoLabel"]."" ContextPath Value[FAO, forAutoObject]["forAutoLabel"] ContextPath Value[FAO, forAutoObject] @@ -1284,8 +1312,8 @@ Complete src/Completion.res 227:46 posCursor:[227:46] posNoWhite:[227:45] Found expr:[227:3->0:-1] Completable: Cpath Value[FAO, forAutoObject]["forAutoLabel"].forAuto-> Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject]["forAutoLabel"].forAuto-> ContextPath Value[FAO, forAutoObject]["forAutoLabel"].forAuto ContextPath Value[FAO, forAutoObject]["forAutoLabel"] @@ -1319,8 +1347,8 @@ posCursor:[230:55] posNoWhite:[230:54] Found expr:[230:46->230:55] Pexp_ident ForAuto.a:[230:46->230:55] Completable: Cpath Value[ForAuto, a] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, a] Path ForAuto.a [{ @@ -1346,8 +1374,8 @@ posCursor:[234:34] posNoWhite:[234:33] Found expr:[234:32->234:34] Pexp_ident na:[234:32->234:34] Completable: Cpath Value[na] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[na] Path na [{ @@ -1362,8 +1390,8 @@ Complete src/Completion.res 237:17 posCursor:[237:17] posNoWhite:[237:14] Found expr:[237:14->237:22] Completable: Cnone Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion [] Complete src/Completion.res 243:8 @@ -1373,8 +1401,8 @@ posCursor:[243:8] posNoWhite:[243:7] Found expr:[243:5->243:8] Pexp_field [243:5->243:7] _:[245:0->243:8] Completable: Cpath Value[_z]."" Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[_z]."" ContextPath Value[_z] Path _z @@ -1402,8 +1430,8 @@ posCursor:[254:17] posNoWhite:[254:16] Found expr:[254:11->254:17] Pexp_construct SomeLo:[254:11->254:17] None Completable: Cpath Value[SomeLo] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLo] Path SomeLo [{ @@ -1419,8 +1447,8 @@ posCursor:[256:29] posNoWhite:[256:28] Found type:[256:13->256:29] Ptyp_constr SomeLocalModule.:[256:13->256:29] Completable: Cpath Type[SomeLocalModule, ""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. [{ @@ -1436,8 +1464,8 @@ posCursor:[261:33] posNoWhite:[261:32] Found type:[261:17->263:11] Ptyp_constr SomeLocalModule.:[261:17->263:11] Completable: Cpath Type[SomeLocalModule, ""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. [{ @@ -1452,8 +1480,8 @@ Complete src/Completion.res 268:21 Ptype_variant unary SomeLocal:[268:12->268:21] Completable: Cpath Value[SomeLocal] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocal] Path SomeLocal [{ @@ -1476,8 +1504,8 @@ posCursor:[271:20] posNoWhite:[271:19] Found type:[271:11->274:3] Ptyp_constr SomeLocal:[271:11->274:3] Completable: Cpath Type[SomeLocal] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocal] Path SomeLocal [{ @@ -1495,8 +1523,8 @@ posCursor:[275:15] posNoWhite:[275:14] Found expr:[275:13->275:15] Pexp_ident _w:[275:13->275:15] Completable: Cpath Value[_w] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[_w] Path _w [{ @@ -1512,8 +1540,8 @@ posCursor:[281:22] posNoWhite:[281:21] Found type:[281:21->281:22] Ptyp_constr s:[281:21->281:22] Completable: Cpath Type[s] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[s] Path s [{ @@ -1535,8 +1563,8 @@ posCursor:[291:30] posNoWhite:[291:29] Found expr:[291:11->291:32] Pexp_apply ...[291:11->291:28] () Completable: CnamedArg(Value[funRecord].someFun, "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[funRecord].someFun ContextPath Value[funRecord] Path funRecord @@ -1559,8 +1587,8 @@ posCursor:[296:11] posNoWhite:[296:10] Found expr:[296:3->296:11] Pexp_field [296:3->296:10] _:[299:0->296:11] Completable: Cpath Value[retAA](Nolabel)."" Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[retAA](Nolabel)."" ContextPath Value[retAA](Nolabel) ContextPath Value[retAA] @@ -1590,8 +1618,8 @@ posCursor:[301:13] posNoWhite:[301:12] Found expr:[301:3->301:13] Pexp_apply ...[301:3->301:11] () Completable: CnamedArg(Value[ff](~c), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff](~c) ContextPath Value[ff] Path ff @@ -1634,8 +1662,8 @@ posCursor:[304:15] posNoWhite:[304:14] Found expr:[304:3->304:15] Pexp_apply ...[304:3->304:13] () Completable: CnamedArg(Value[ff](~c)(Nolabel), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff](~c)(Nolabel) ContextPath Value[ff](~c) ContextPath Value[ff] @@ -1666,8 +1694,8 @@ posCursor:[307:17] posNoWhite:[307:16] Found expr:[307:3->307:17] Pexp_apply ...[307:3->307:15] () Completable: CnamedArg(Value[ff](~c, Nolabel), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff](~c, Nolabel) ContextPath Value[ff] Path ff @@ -1697,8 +1725,8 @@ posCursor:[310:21] posNoWhite:[310:20] Found expr:[310:3->310:21] Pexp_apply ...[310:3->310:19] () Completable: CnamedArg(Value[ff](~c, Nolabel, Nolabel), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff](~c, Nolabel, Nolabel) ContextPath Value[ff] Path ff @@ -1722,8 +1750,8 @@ posCursor:[313:23] posNoWhite:[313:22] Found expr:[313:3->313:23] Pexp_apply ...[313:3->313:21] () Completable: CnamedArg(Value[ff](~c, Nolabel, ~b), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff](~c, Nolabel, ~b) ContextPath Value[ff] Path ff @@ -1747,8 +1775,8 @@ posCursor:[316:16] posNoWhite:[316:15] Found expr:[316:3->316:16] Pexp_apply ...[316:3->316:14] () Completable: CnamedArg(Value[ff](~opt2), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff](~opt2) ContextPath Value[ff] Path ff @@ -1784,8 +1812,8 @@ posCursor:[326:17] posNoWhite:[326:16] Found expr:[326:3->326:17] Pexp_apply ...[326:3->326:15] () Completable: CnamedArg(Value[withCallback], "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[withCallback] Path withCallback Found type for function (~b: int) => callback @@ -1808,8 +1836,8 @@ posCursor:[329:21] posNoWhite:[329:20] Found expr:[329:3->329:21] Pexp_apply ...[329:3->329:19] () Completable: CnamedArg(Value[withCallback](~a), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[withCallback](~a) ContextPath Value[withCallback] Path withCallback @@ -1827,8 +1855,8 @@ posCursor:[332:21] posNoWhite:[332:20] Found expr:[332:3->332:21] Pexp_apply ...[332:3->332:19] () Completable: CnamedArg(Value[withCallback](~b), "", []) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[withCallback](~b) ContextPath Value[withCallback] Path withCallback @@ -1856,11 +1884,17 @@ posCursor:[339:26] posNoWhite:[339:25] Found type:[339:23->341:5] Ptyp_constr Res:[339:23->341:5] Completable: Cpath Type[Res] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[Res] Path Res [{ + "label": "Result", + "kind": 9, + "tags": [], + "detail": "module Result", + "documentation": null + }, { "label": "RescriptReactErrorBoundary", "kind": 9, "tags": [], @@ -1900,16 +1934,6 @@ Path Res "modulePath": "RescriptTools_Docgen", "filePath": "src/Completion.res" } - }, { - "label": "Result", - "kind": 9, - "tags": [], - "detail": "module Result", - "documentation": null, - "data": { - "modulePath": "Result", - "filePath": "src/Completion.res" - } }] Complete src/Completion.res 346:57 @@ -1918,8 +1942,8 @@ posCursor:[346:57] posNoWhite:[346:56] Found expr:[346:53->346:57] Pexp_ident this:[346:53->346:57] Completable: Cpath Value[this] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[this] Path this [{ @@ -1927,7 +1951,7 @@ Path this "kind": 12, "tags": [], "detail": "\\\"Type Not Known\"", - "documentation": null + "documentation": {"kind": "markdown", "value": "```rescript\ntype props<'first, 'zoo, 'second> = {\n first?: 'first,\n zoo?: 'zoo,\n second: 'second,\n}\n```"} }] Hover src/Completion.res 349:14 @@ -1941,12 +1965,13 @@ posCursor:[352:17] posNoWhite:[352:16] Found expr:[352:11->352:28] Pexp_ident FAO.forAutoObject:[352:11->352:28] Completable: Cpath Value[FAO, forAutoObject] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +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 Pervasives.JsxModules.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 @@ -1955,8 +1980,8 @@ posCursor:[355:17] posNoWhite:[355:16] Found expr:[355:11->355:22] Pexp_apply ...[355:11->355:13] (~opt1355:15->355:19=...[355:20->355:21]) Completable: CnamedArg(Value[ff], opt1, [opt1]) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ff] Path ff Found type for function ( @@ -1982,14 +2007,14 @@ posCursor:[365:8] posNoWhite:[365:7] Found pattern:[365:7->365:8] Ppat_construct T:[365:7->365:8] Completable: Cpattern Value[x]=T Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[x] Path x Completable: Cpath Value[T] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[T] Path T [{ @@ -2005,23 +2030,25 @@ Path T "detail": "This", "documentation": {"kind": "markdown", "value": "```rescript\nThis\n```\n\n```rescript\ntype v = This | That\n```"} }, { - "label": "TableclothMap", + "label": "TypedArray", "kind": 9, "tags": [], - "detail": "module TableclothMap", - "documentation": null, - "data": { - "modulePath": "TableclothMap", - "filePath": "src/Completion.res" - } + "detail": "module TypedArray", + "documentation": null }, { "label": "Type", "kind": 9, "tags": [], "detail": "module Type", + "documentation": null + }, { + "label": "TableclothMap", + "kind": 9, + "tags": [], + "detail": "module TableclothMap", "documentation": null, "data": { - "modulePath": "Type", + "modulePath": "TableclothMap", "filePath": "src/Completion.res" } }, { @@ -2064,16 +2091,6 @@ Path T "modulePath": "TypeDefinition", "filePath": "src/Completion.res" } - }, { - "label": "TypedArray", - "kind": 9, - "tags": [], - "detail": "module TypedArray", - "documentation": null, - "data": { - "modulePath": "TypedArray", - "filePath": "src/Completion.res" - } }] Complete src/Completion.res 376:21 @@ -2083,8 +2100,8 @@ posCursor:[376:21] posNoWhite:[376:20] Found pattern:[376:7->376:21] Ppat_construct AndThatOther.T:[376:7->376:21] Completable: Cpath Value[AndThatOther, T] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[AndThatOther, T] Path AndThatOther.T [{ @@ -2104,8 +2121,8 @@ posCursor:[381:24] posNoWhite:[381:23] Found expr:[381:16->381:24] Pexp_ident ForAuto.:[381:16->381:24] Completable: Cpath Value[ForAuto, ""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, ""] Path ForAuto. [{ @@ -2131,8 +2148,8 @@ posCursor:[384:38] posNoWhite:[384:37] Found expr:[384:19->384:39] Pexp_send [384:38->384:38] e:[384:19->384:36] Completable: Cpath Value[FAO, forAutoObject][""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject @@ -2159,8 +2176,8 @@ posCursor:[387:24] posNoWhite:[387:23] Found expr:[387:14->387:24] Pexp_field [387:14->387:23] _:[387:24->387:24] Completable: Cpath Value[funRecord]."" Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[funRecord]."" ContextPath Value[funRecord] Path funRecord @@ -2189,11 +2206,11 @@ posCursor:[391:12] posNoWhite:[391:11] Found expr:[391:6->393:4] posCursor:[391:12] posNoWhite:[391:11] Found expr:[391:6->391:12] Completable: Cpath array->ma Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath array->ma ContextPath array -Path Array.ma +Path Stdlib.Array.ma [{ "label": "Array.map", "kind": 12, @@ -2217,8 +2234,8 @@ posCursor:[399:14] posNoWhite:[399:13] Found expr:[399:13->399:16] Pexp_ident red:[399:13->399:16] Completable: Cpath Value[red] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[red] Path red [{ @@ -2238,8 +2255,8 @@ posCursor:[404:25] posNoWhite:[404:24] Found expr:[404:24->404:27] Pexp_ident red:[404:24->404:27] Completable: Cpath Value[red] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[red] Path red [{ @@ -2260,8 +2277,8 @@ posCursor:[407:22] posNoWhite:[407:21] Found expr:[407:21->407:22] Pexp_ident r:[407:21->407:22] Completable: Cpath Value[r] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[r] Path r [{ @@ -2292,8 +2309,8 @@ posCursor:[411:21] posNoWhite:[411:20] Found expr:[411:5->413:5] Pexp_ident SomeLocalModule.:[411:5->413:5] Completable: Cpath Value[SomeLocalModule, ""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. [{ @@ -2319,8 +2336,8 @@ posCursor:[414:21] posNoWhite:[414:20] Found expr:[414:5->416:13] Pexp_ident SomeLocalModule.:[414:5->416:13] Completable: Cpath Value[SomeLocalModule, ""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. [{ @@ -2341,11 +2358,11 @@ Complete src/Completion.res 419:17 posCursor:[419:17] posNoWhite:[419:16] Found expr:[419:11->419:17] Completable: Cpath int->t Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath int->t ContextPath int -Path Int.t +Path Stdlib.Int.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -2412,11 +2429,11 @@ Complete src/Completion.res 422:19 posCursor:[422:19] posNoWhite:[422:18] Found expr:[422:11->422:19] Completable: Cpath float->t Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath float->t ContextPath float -Path Float.t +Path Stdlib.Float.t [{ "label": "Float.toStringWithRadix", "kind": 12, @@ -2483,12 +2500,12 @@ Complete src/Completion.res 427:8 posCursor:[427:8] posNoWhite:[427:7] Found expr:[427:3->427:8] Completable: Cpath Value[ok]->g Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[ok]->g ContextPath Value[ok] Path ok -Path Result.g +Path Stdlib.Result.g [{ "label": "Result.getExn", "kind": 12, @@ -2514,8 +2531,8 @@ posCursor:[445:15] posNoWhite:[445:14] Found expr:[445:3->445:15] Pexp_field [445:3->445:12] so:[445:13->445:15] Completable: Cpath Value[rWithDepr].so Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[rWithDepr].so ContextPath Value[rWithDepr] Path rWithDepr @@ -2542,8 +2559,8 @@ Complete src/Completion.res 452:37 XXX Not found! Completable: Cexpression Type[someVariantWithDeprecated] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithDeprecated] Path someVariantWithDeprecated [{ @@ -2576,13 +2593,13 @@ Complete src/Completion.res 457:30 posCursor:[457:30] posNoWhite:[457:29] Found expr:[457:11->457:30] Completable: Cpath Value[uncurried](Nolabel)->toS Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Value[uncurried](Nolabel)->toS ContextPath Value[uncurried](Nolabel) ContextPath Value[uncurried] Path uncurried -Path Int.toS +Path Stdlib.Int.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -2601,8 +2618,8 @@ Complete src/Completion.res 462:30 XXX Not found! Completable: Cexpression Type[withUncurried]->recordField(fn) Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath Type[withUncurried] Path withUncurried [{ @@ -2621,8 +2638,8 @@ posCursor:[465:26] posNoWhite:[465:25] Found expr:[465:22->465:26] Pexp_ident FAR.:[465:22->465:26] Completable: Cpath ValueOrField[FAR, ""] Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 2 Completion Completion +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 3 Stdlib Completion Completion ContextPath ValueOrField[FAR, ""] Path FAR. [{ diff --git a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt index 11921fa2a4..1c7c3fb9df 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt @@ -1,7 +1,8 @@ Complete src/CompletionAttributes.res 0:8 Attribute id:modu:[0:3->0:8] label:modu Completable: Cdecorator(modu) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "module", "kind": 4, @@ -15,7 +16,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 3:12 XXX Not found! Completable: CdecoratorPayload(module=) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "@rescript/react", "kind": 4, @@ -39,7 +41,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 6:7 Attribute id:js:[6:3->6:7] label:@js Completable: Cdecorator(@js) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "jsxConfig", "kind": 4, @@ -53,7 +56,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 9:16 XXX Not found! Completable: JsxConfig -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "version", "kind": 5, @@ -77,7 +81,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 12:17 XXX Not found! Completable: JsxConfig -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "module_", "kind": 5, @@ -95,7 +100,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 15:25 XXX Not found! Completable: JsxConfig -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "\"\"", "kind": 12, @@ -110,7 +116,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 18:29 XXX Not found! Completable: JsxConfig -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "version", "kind": 5, @@ -128,7 +135,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 21:12 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "from", "kind": 5, @@ -146,7 +154,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 24:17 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "{}", "kind": 12, @@ -161,7 +170,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 27:19 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "type_", "kind": 5, @@ -173,7 +183,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 30:19 XXX Not found! Completable: CdecoratorPayload(module=) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "@rescript/react", "kind": 4, @@ -197,7 +208,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 33:17 XXX Not found! Completable: CdecoratorPayload(module=) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "@rescript/react", "kind": 4, @@ -221,7 +233,8 @@ Package opens Pervasives.JsxModules.place holder Complete src/CompletionAttributes.res 36:14 posCursor:[36:14] posNoWhite:[36:13] Found expr:[36:12->36:14] Completable: CextensionNode(t) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib [{ "label": "todo", "kind": 4, diff --git a/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt b/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt index 23a1b3556b..60614d7045 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionDicts.res 0:30 posCursor:[0:30] posNoWhite:[0:29] Found expr:[0:14->0:32] Pexp_apply ...[0:14->0:28] (...[0:29->0:31]) Completable: Cexpression CArgument Value[Dict, fromArray]($0)->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray @@ -20,7 +21,8 @@ Complete src/CompletionDicts.res 3:31 posCursor:[3:31] posNoWhite:[3:30] Found expr:[3:14->3:34] Pexp_apply ...[3:14->3:28] (...[3:29->3:33]) Completable: Cexpression CArgument Value[Dict, fromArray]($0)->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray @@ -38,7 +40,8 @@ Complete src/CompletionDicts.res 6:37 posCursor:[6:37] posNoWhite:[6:36] Found expr:[6:14->6:41] Pexp_apply ...[6:14->6:28] (...[6:29->6:40]) Completable: Cexpression CArgument Value[Dict, fromArray]($0)->array, tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray @@ -49,7 +52,8 @@ Complete src/CompletionDicts.res 12:14 posCursor:[12:14] posNoWhite:[12:13] Found expr:[10:11->14:2] Pexp_apply ...[10:11->10:25] (...[10:26->14:1]) Completable: Cexpression CArgument Value[Dict, fromArray]($0)->array, tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray diff --git a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt index 625c197011..057b6130d6 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt @@ -1,7 +1,8 @@ Complete src/CompletionExpressions.res 3:20 XXX Not found! Completable: Cpattern CTuple(Value[s], Value[f]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTuple(Value[s], Value[f]) ContextPath Value[s] Path s @@ -21,7 +22,8 @@ Complete src/CompletionExpressions.res 26:27 posCursor:[26:27] posNoWhite:[26:26] Found expr:[26:11->26:29] Pexp_apply ...[26:11->26:25] (...[26:26->26:28]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -67,7 +69,8 @@ Complete src/CompletionExpressions.res 29:28 posCursor:[29:28] posNoWhite:[29:27] Found expr:[29:11->29:30] Pexp_apply ...[29:11->29:25] (...[29:27->29:28]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)=n->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -83,7 +86,8 @@ Complete src/CompletionExpressions.res 32:35 posCursor:[32:35] posNoWhite:[32:34] Found expr:[32:11->32:38] Pexp_apply ...[32:11->32:25] (...[32:26->32:38]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(offline) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -105,7 +109,8 @@ Complete src/CompletionExpressions.res 35:36 posCursor:[35:36] posNoWhite:[35:35] Found expr:[35:11->35:39] Pexp_apply ...[35:11->35:25] (...[35:26->35:38]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -145,7 +150,8 @@ Complete src/CompletionExpressions.res 38:37 posCursor:[38:37] posNoWhite:[38:35] Found expr:[38:11->38:53] Pexp_apply ...[38:11->38:25] (...[38:26->38:52]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -179,7 +185,8 @@ Complete src/CompletionExpressions.res 41:44 posCursor:[41:44] posNoWhite:[41:43] Found expr:[41:11->41:47] Pexp_apply ...[41:11->41:25] (...[41:26->41:47]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(nested) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -219,7 +226,8 @@ Complete src/CompletionExpressions.res 44:46 posCursor:[44:46] posNoWhite:[44:45] Found expr:[44:11->44:49] Pexp_apply ...[44:11->44:25] (...[44:26->44:48]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(nested), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -229,7 +237,8 @@ Complete src/CompletionExpressions.res 47:51 posCursor:[47:51] posNoWhite:[47:50] Found expr:[47:11->47:55] Pexp_apply ...[47:11->47:25] (...[47:26->47:54]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(nested), variantPayload::Some($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -251,7 +260,8 @@ Complete src/CompletionExpressions.res 50:45 posCursor:[50:45] posNoWhite:[50:44] Found expr:[50:11->50:48] Pexp_apply ...[50:11->50:25] (...[50:26->50:48]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(variant) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -285,7 +295,8 @@ Complete src/CompletionExpressions.res 53:47 posCursor:[53:47] posNoWhite:[53:46] Found expr:[53:11->53:50] Pexp_apply ...[53:11->53:25] (...[53:26->53:49]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)=O->recordField(variant) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -303,7 +314,8 @@ Complete src/CompletionExpressions.res 56:57 posCursor:[56:57] posNoWhite:[56:56] Found expr:[56:11->56:61] Pexp_apply ...[56:11->56:25] (...[56:26->56:60]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(polyvariant), polyvariantPayload::three($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -322,7 +334,8 @@ Complete src/CompletionExpressions.res 59:60 posCursor:[59:60] posNoWhite:[59:59] Found expr:[59:11->59:65] Pexp_apply ...[59:11->59:25] (...[59:26->59:64]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordField(polyvariant), polyvariantPayload::three($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -344,7 +357,8 @@ Complete src/CompletionExpressions.res 62:62 posCursor:[62:62] posNoWhite:[62:61] Found expr:[62:11->62:66] Pexp_apply ...[62:11->62:25] (...[62:26->62:65]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)=t->recordField(polyvariant), polyvariantPayload::three($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -353,6 +367,13 @@ Path fnTakingRecord "kind": 4, "tags": [], "detail": "bool", + "documentation": null, + "sortText": "A true" + }, { + "label": "typeof", + "kind": 12, + "tags": [], + "detail": "'a => Type.t", "documentation": null }] @@ -360,7 +381,8 @@ Complete src/CompletionExpressions.res 69:25 posCursor:[69:25] posNoWhite:[69:24] Found expr:[69:11->69:26] Pexp_apply ...[69:11->69:24] (...[69:25->69:26]) Completable: Cexpression CArgument Value[fnTakingArray]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray @@ -379,7 +401,8 @@ Complete src/CompletionExpressions.res 72:26 posCursor:[72:26] posNoWhite:[72:25] Found expr:[72:11->72:28] Pexp_apply ...[72:11->72:24] (...[72:25->72:27]) Completable: Cexpression CArgument Value[fnTakingArray]($0)->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray @@ -415,7 +438,8 @@ Complete src/CompletionExpressions.res 75:26 posCursor:[75:26] posNoWhite:[75:25] Found expr:[75:11->75:27] Pexp_apply ...[75:11->75:24] (...[75:25->75:26]) Completable: Cexpression CArgument Value[fnTakingArray]($0)=s -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray @@ -425,13 +449,38 @@ Path fnTakingArray "tags": [], "detail": "bool", "documentation": null + }, { + "label": "setTimeoutFloat", + "kind": 12, + "tags": [], + "detail": "(unit => unit, float) => timeoutId", + "documentation": {"kind": "markdown", "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n"} + }, { + "label": "setIntervalFloat", + "kind": 12, + "tags": [], + "detail": "(unit => unit, float) => intervalId", + "documentation": {"kind": "markdown", "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n"} + }, { + "label": "setInterval", + "kind": 12, + "tags": [], + "detail": "(unit => unit, int) => intervalId", + "documentation": {"kind": "markdown", "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n"} + }, { + "label": "setTimeout", + "kind": 12, + "tags": [], + "detail": "(unit => unit, int) => timeoutId", + "documentation": {"kind": "markdown", "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n"} }] Complete src/CompletionExpressions.res 78:31 posCursor:[78:31] posNoWhite:[78:30] Found expr:[78:11->78:34] Pexp_apply ...[78:11->78:24] (...[78:25->78:33]) Completable: Cexpression CArgument Value[fnTakingArray]($0)->array, variantPayload::Some($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray @@ -453,7 +502,8 @@ Complete src/CompletionExpressions.res 81:31 posCursor:[81:31] posNoWhite:[81:30] Found expr:[81:11->81:34] Pexp_apply ...[81:11->81:24] (...[81:25->81:33]) Completable: Cexpression CArgument Value[fnTakingArray]($0)->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray @@ -489,7 +539,8 @@ Complete src/CompletionExpressions.res 84:31 posCursor:[84:31] posNoWhite:[84:30] Found expr:[84:11->84:40] Pexp_apply ...[84:11->84:24] (...[84:25->84:39]) Completable: Cexpression CArgument Value[fnTakingArray]($0)->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray @@ -525,7 +576,8 @@ Complete src/CompletionExpressions.res 89:38 posCursor:[89:38] posNoWhite:[89:37] Found expr:[89:11->89:41] Pexp_apply ...[89:11->89:25] (...[89:26->89:40]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)=so -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -541,7 +593,8 @@ Complete src/CompletionExpressions.res 96:43 posCursor:[96:43] posNoWhite:[96:42] Found expr:[96:11->96:46] Pexp_apply ...[96:11->96:30] (...[96:31->96:46]) Completable: Cexpression CArgument Value[fnTakingOtherRecord]($0)->recordField(otherField) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingOtherRecord]($0) ContextPath Value[fnTakingOtherRecord] Path fnTakingOtherRecord @@ -560,7 +613,8 @@ Complete src/CompletionExpressions.res 108:57 posCursor:[108:57] posNoWhite:[108:56] Found expr:[108:11->108:60] Pexp_apply ...[108:11->108:42] (...[108:43->108:60]) Completable: Cexpression CArgument Value[fnTakingRecordWithOptionalField]($0)->recordField(someOptField) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecordWithOptionalField]($0) ContextPath Value[fnTakingRecordWithOptionalField] Path fnTakingRecordWithOptionalField @@ -582,7 +636,8 @@ Complete src/CompletionExpressions.res 116:53 posCursor:[116:53] posNoWhite:[116:52] Found expr:[116:11->116:56] Pexp_apply ...[116:11->116:39] (...[116:40->116:56]) Completable: Cexpression CArgument Value[fnTakingRecordWithOptVariant]($0)->recordField(someVariant) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecordWithOptVariant]($0) ContextPath Value[fnTakingRecordWithOptVariant] Path fnTakingRecordWithOptVariant @@ -638,7 +693,8 @@ Complete src/CompletionExpressions.res 126:49 posCursor:[126:49] posNoWhite:[126:48] Found expr:[126:11->126:51] Pexp_apply ...[126:11->126:31] (...[126:32->126:50]) Completable: Cexpression CArgument Value[fnTakingInlineRecord]($0)->variantPayload::WithInlineRecord($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord @@ -657,7 +713,8 @@ Complete src/CompletionExpressions.res 129:50 posCursor:[129:50] posNoWhite:[129:49] Found expr:[129:11->129:53] Pexp_apply ...[129:11->129:31] (...[129:32->129:52]) Completable: Cexpression CArgument Value[fnTakingInlineRecord]($0)->variantPayload::WithInlineRecord($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord @@ -685,7 +742,8 @@ Complete src/CompletionExpressions.res 132:51 posCursor:[132:51] posNoWhite:[132:50] Found expr:[132:11->132:54] Pexp_apply ...[132:11->132:31] (...[132:32->132:53]) Completable: Cexpression CArgument Value[fnTakingInlineRecord]($0)=s->variantPayload::WithInlineRecord($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord @@ -701,7 +759,8 @@ Complete src/CompletionExpressions.res 135:63 posCursor:[135:63] posNoWhite:[135:62] Found expr:[135:11->135:67] Pexp_apply ...[135:11->135:31] (...[135:32->135:66]) Completable: Cexpression CArgument Value[fnTakingInlineRecord]($0)->variantPayload::WithInlineRecord($0), recordField(nestedRecord) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord @@ -720,7 +779,8 @@ Complete src/CompletionExpressions.res 138:65 posCursor:[138:65] posNoWhite:[138:64] Found expr:[138:11->138:70] Pexp_apply ...[138:11->138:31] (...[138:32->138:69]) Completable: Cexpression CArgument Value[fnTakingInlineRecord]($0)->variantPayload::WithInlineRecord($0), recordField(nestedRecord), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord @@ -742,7 +802,8 @@ Complete src/CompletionExpressions.res 159:20 posCursor:[159:20] posNoWhite:[159:19] Found expr:[159:3->159:21] Pexp_apply ...[159:3->159:19] (...[159:20->159:21]) Completable: Cexpression CArgument Value[fnTakingCallback]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($0) ContextPath Value[fnTakingCallback] Path fnTakingCallback @@ -761,17 +822,25 @@ Complete src/CompletionExpressions.res 162:21 posCursor:[162:21] posNoWhite:[162:20] Found expr:[162:3->162:22] Pexp_apply ...[162:3->162:19] (...[162:20->162:21]) Completable: Cexpression CArgument Value[fnTakingCallback]($0)=a -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($0) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[] +[{ + "label": "assertEqual", + "kind": 12, + "tags": [], + "detail": "('a, 'a) => unit", + "documentation": {"kind": "markdown", "value": "\n`assertEqual(a, b)` check if `a` is equal `b`. If not raise a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}\n->List.tailExn\n->assertEqual(list{2})\n```\n"} + }] Complete src/CompletionExpressions.res 165:22 posCursor:[165:22] posNoWhite:[165:21] Found expr:[165:3->165:24] Pexp_apply ...[165:3->165:19] (...[165:20->165:21]) Completable: Cexpression CArgument Value[fnTakingCallback]($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($1) ContextPath Value[fnTakingCallback] Path fnTakingCallback @@ -790,7 +859,8 @@ Complete src/CompletionExpressions.res 168:25 posCursor:[168:25] posNoWhite:[168:24] Found expr:[168:3->168:27] Pexp_apply ...[168:3->168:19] (...[168:20->168:21], ...[168:23->168:24]) Completable: Cexpression CArgument Value[fnTakingCallback]($2) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($2) ContextPath Value[fnTakingCallback] Path fnTakingCallback @@ -809,7 +879,8 @@ Complete src/CompletionExpressions.res 171:29 posCursor:[171:29] posNoWhite:[171:27] Found expr:[171:3->171:30] Pexp_apply ...[171:3->171:19] (...[171:20->171:21], ...[171:23->171:24], ...[171:26->171:27]) Completable: Cexpression CArgument Value[fnTakingCallback]($3) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($3) ContextPath Value[fnTakingCallback] Path fnTakingCallback @@ -828,7 +899,8 @@ Complete src/CompletionExpressions.res 174:32 posCursor:[174:32] posNoWhite:[174:30] Found expr:[174:3->174:33] Pexp_apply ...[174:3->174:19] (...[174:20->174:21], ...[174:23->174:24], ...[174:26->174:27], ...[174:29->174:30]) Completable: Cexpression CArgument Value[fnTakingCallback]($4) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($4) ContextPath Value[fnTakingCallback] Path fnTakingCallback @@ -847,7 +919,8 @@ Complete src/CompletionExpressions.res 177:34 posCursor:[177:34] posNoWhite:[177:33] Found expr:[177:3->177:36] Pexp_apply ...[177:3->177:19] (...[177:20->177:21], ...[177:23->177:24], ...[177:26->177:27], ...[177:29->177:30], ...[177:32->177:33]) Completable: Cexpression CArgument Value[fnTakingCallback]($5) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($5) ContextPath Value[fnTakingCallback] Path fnTakingCallback @@ -870,7 +943,8 @@ posCursor:[185:15] posNoWhite:[185:14] Found expr:[184:2->185:16] posCursor:[185:15] posNoWhite:[185:14] Found expr:[185:2->185:16] Pexp_apply ...[185:2->185:13] (...[185:14->185:15]) Completable: Cexpression CArgument Value[Console, log]($0)=s -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Console, log]($0) ContextPath Value[Console, log] Path Console.log @@ -898,13 +972,38 @@ Path Console.log "tags": [], "detail": "bool", "documentation": null + }, { + "label": "setTimeoutFloat", + "kind": 12, + "tags": [], + "detail": "(unit => unit, float) => timeoutId", + "documentation": {"kind": "markdown", "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n"} + }, { + "label": "setIntervalFloat", + "kind": 12, + "tags": [], + "detail": "(unit => unit, float) => intervalId", + "documentation": {"kind": "markdown", "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n"} + }, { + "label": "setInterval", + "kind": 12, + "tags": [], + "detail": "(unit => unit, int) => intervalId", + "documentation": {"kind": "markdown", "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n"} + }, { + "label": "setTimeout", + "kind": 12, + "tags": [], + "detail": "(unit => unit, int) => timeoutId", + "documentation": {"kind": "markdown", "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n"} }] Complete src/CompletionExpressions.res 196:14 posCursor:[196:14] posNoWhite:[196:13] Found expr:[196:3->196:14] Pexp_field [196:3->196:6] someOpt:[196:7->196:14] Completable: Cpath Value[fff].someOpt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fff].someOpt ContextPath Value[fff] Path fff @@ -925,7 +1024,8 @@ Complete src/CompletionExpressions.res 205:11 posCursor:[205:11] posNoWhite:[205:10] Found expr:[205:3->205:12] Pexp_apply ...[205:3->205:10] (...[205:11->205:12]) Completable: Cexpression CArgument Value[takesCb]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb]($0) ContextPath Value[takesCb] Path takesCb @@ -944,7 +1044,8 @@ Complete src/CompletionExpressions.res 216:12 posCursor:[216:12] posNoWhite:[216:11] Found expr:[216:3->216:13] Pexp_apply ...[216:3->216:11] (...[216:12->216:13]) Completable: Cexpression CArgument Value[takesCb2]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb2]($0) ContextPath Value[takesCb2] Path takesCb2 @@ -963,7 +1064,8 @@ Complete src/CompletionExpressions.res 225:12 posCursor:[225:12] posNoWhite:[225:11] Found expr:[225:3->225:13] Pexp_apply ...[225:3->225:11] (...[225:12->225:13]) Completable: Cexpression CArgument Value[takesCb3]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb3]($0) ContextPath Value[takesCb3] Path takesCb3 @@ -982,7 +1084,8 @@ Complete src/CompletionExpressions.res 232:12 posCursor:[232:12] posNoWhite:[232:11] Found expr:[232:3->232:13] Pexp_apply ...[232:3->232:11] (...[232:12->232:13]) Completable: Cexpression CArgument Value[takesCb4]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb4]($0) ContextPath Value[takesCb4] Path takesCb4 @@ -1001,7 +1104,8 @@ Complete src/CompletionExpressions.res 239:12 posCursor:[239:12] posNoWhite:[239:11] Found expr:[239:3->239:13] Pexp_apply ...[239:3->239:11] (...[239:12->239:13]) Completable: Cexpression CArgument Value[takesCb5]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb5]($0) ContextPath Value[takesCb5] Path takesCb5 @@ -1020,7 +1124,8 @@ Complete src/CompletionExpressions.res 250:30 posCursor:[250:30] posNoWhite:[250:29] Found expr:[250:3->250:31] Pexp_apply ...[250:3->250:20] (~updater250:22->250:29=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[commitLocalUpdate](~updater) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[commitLocalUpdate](~updater) ContextPath Value[commitLocalUpdate] Path commitLocalUpdate @@ -1039,7 +1144,8 @@ Complete src/CompletionExpressions.res 257:25 posCursor:[257:25] posNoWhite:[257:24] Found expr:[257:3->257:26] Pexp_apply ...[257:3->257:24] (...[257:25->257:26]) Completable: Cexpression CArgument Value[fnTakingAsyncCallback]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingAsyncCallback]($0) ContextPath Value[fnTakingAsyncCallback] Path fnTakingAsyncCallback @@ -1057,7 +1163,8 @@ Path fnTakingAsyncCallback Complete src/CompletionExpressions.res 262:23 posCursor:[262:23] posNoWhite:[262:22] Found expr:[262:3->262:24] Completable: Cexpression CArgument Value[Belt, Array, map]($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Belt, Array, map]($1) ContextPath Value[Belt, Array, map] Path Belt.Array.map @@ -1076,7 +1183,8 @@ Complete src/CompletionExpressions.res 271:15 posCursor:[271:15] posNoWhite:[271:14] Found expr:[271:3->271:16] Pexp_apply ...[271:3->271:14] (...[271:15->271:16]) Completable: Cexpression CArgument Value[takesExotic]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[takesExotic]($0) ContextPath Value[takesExotic] Path takesExotic @@ -1094,7 +1202,8 @@ Complete src/CompletionExpressions.res 278:23 posCursor:[278:23] posNoWhite:[278:22] Found expr:[278:3->278:24] Pexp_apply ...[278:3->278:22] (...[278:23->278:24]) Completable: Cexpression CArgument Value[fnTakingPolyVariant]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant @@ -1128,7 +1237,8 @@ Complete src/CompletionExpressions.res 281:24 posCursor:[281:24] posNoWhite:[281:23] Found expr:[281:3->290:18] Pexp_apply ...[281:3->281:22] (...[281:23->281:25], ...[290:0->290:16]) Completable: Cexpression CArgument Value[fnTakingPolyVariant]($0)=# -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant @@ -1162,7 +1272,8 @@ Complete src/CompletionExpressions.res 284:25 posCursor:[284:25] posNoWhite:[284:24] Found expr:[284:3->284:26] Pexp_apply ...[284:3->284:22] (...[284:23->284:25]) Completable: Cexpression CArgument Value[fnTakingPolyVariant]($0)=#o -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant @@ -1180,7 +1291,8 @@ Complete src/CompletionExpressions.res 287:24 posCursor:[287:24] posNoWhite:[287:23] Found expr:[287:3->287:25] Pexp_apply ...[287:3->287:22] (...[287:23->287:24]) Completable: Cexpression CArgument Value[fnTakingPolyVariant]($0)=o -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant @@ -1197,7 +1309,8 @@ Path fnTakingPolyVariant Complete src/CompletionExpressions.res 306:41 XXX Not found! Completable: Cexpression Type[withIntLocal]->recordField(superInt) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[withIntLocal] Path withIntLocal [{ @@ -1214,7 +1327,8 @@ Complete src/CompletionExpressions.res 309:36 posCursor:[309:36] posNoWhite:[309:35] Found expr:[309:3->309:37] Pexp_apply ...[309:3->309:35] (...[309:36->309:37]) Completable: Cexpression CArgument Value[CompletionSupport, makeTestHidden]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[CompletionSupport, makeTestHidden]($0) ContextPath Value[CompletionSupport, makeTestHidden] Path CompletionSupport.makeTestHidden @@ -1233,8 +1347,8 @@ posCursor:[313:36] posNoWhite:[313:35] Found expr:[313:3->313:37] Pexp_apply ...[313:3->313:35] (...[313:36->313:37]) Completable: Cexpression CArgument Value[CompletionSupport, makeTestHidden]($0) Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[CompletionSupport, makeTestHidden]($0) ContextPath Value[CompletionSupport, makeTestHidden] Path CompletionSupport.makeTestHidden @@ -1253,8 +1367,8 @@ posCursor:[321:11] posNoWhite:[321:10] Found expr:[321:3->321:12] Pexp_apply ...[321:3->321:10] (...[321:11->321:12]) Completable: Cexpression CArgument Value[mkStuff]($0) Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[mkStuff]($0) ContextPath Value[mkStuff] Path mkStuff @@ -1267,20 +1381,20 @@ Path mkStuff "insertText": "/$0/g", "insertTextFormat": 2 }, { - "label": "Js.Re.fromString()", + "label": "RegExp.fromString()", "kind": 12, "tags": [], "detail": "string => t", "documentation": null, - "insertText": "Js.Re.fromString($0)", + "insertText": "RegExp.fromString($0)", "insertTextFormat": 2 }, { - "label": "Js.Re.fromStringWithFlags()", + "label": "RegExp.fromStringWithFlags()", "kind": 12, "tags": [], "detail": "(string, ~flags: string) => t", "documentation": null, - "insertText": "Js.Re.fromStringWithFlags($0)", + "insertText": "RegExp.fromStringWithFlags($0)", "insertTextFormat": 2 }] @@ -1289,8 +1403,8 @@ posCursor:[352:24] posNoWhite:[352:23] Found expr:[352:3->352:25] Pexp_apply ...[352:3->352:23] (...[352:24->352:25]) Completable: Cexpression CArgument Value[tArgCompletionTestFn]($0) Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[tArgCompletionTestFn]($0) ContextPath Value[tArgCompletionTestFn] Path tArgCompletionTestFn @@ -1325,8 +1439,8 @@ posCursor:[357:37] posNoWhite:[357:36] Found expr:[357:3->357:38] Pexp_apply ...[357:3->357:30] (~tVal357:32->357:36=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[labeledTArgCompletionTestFn](~tVal) Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[labeledTArgCompletionTestFn](~tVal) ContextPath Value[labeledTArgCompletionTestFn] Path labeledTArgCompletionTestFn @@ -1362,8 +1476,8 @@ posCursor:[362:18] posNoWhite:[362:17] Found expr:[362:10->362:18] Pexp_field [362:10->362:17] _:[362:19->362:18] Completable: Cpath Value[someTyp]."" Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath Value[someTyp]."" ContextPath Value[someTyp] Path someTyp @@ -1385,8 +1499,8 @@ posCursor:[380:22] posNoWhite:[380:18] Found expr:[380:13->386:2] Pexp_apply ...[380:13->380:17] (...[380:18->386:1]) Completable: Cexpression CArgument Value[hook]($0)->recordBody Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[hook]($0) ContextPath Value[hook] Path hook @@ -1403,8 +1517,8 @@ posCursor:[382:8] posNoWhite:[382:7] Found expr:[380:13->386:2] Pexp_apply ...[380:13->380:17] (...[380:18->386:1]) Completable: Cexpression CArgument Value[hook]($0)=ope->recordBody Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[hook]($0) ContextPath Value[hook] Path hook @@ -1422,8 +1536,8 @@ posCursor:[388:18] posNoWhite:[388:17] Found expr:[388:10->388:18] Pexp_field [388:10->388:17] _:[388:19->388:18] Completable: Cpath Value[someTyp]."" Raw opens: 1 CompletionSupport.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionSupport +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionSupport ContextPath Value[someTyp]."" ContextPath Value[someTyp] Path someTyp diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt index 8a0ca5d91f..06394e526d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionFromModule.res 10:5 posCursor:[10:5] posNoWhite:[10:4] Found expr:[10:3->10:5] Pexp_field [10:3->10:4] _:[13:0->10:5] Completable: Cpath Value[n]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[n]."" ContextPath Value[n] Path n @@ -35,7 +36,8 @@ Complete src/CompletionFromModule.res 30:6 posCursor:[30:6] posNoWhite:[30:5] Found expr:[30:3->30:6] Pexp_field [30:3->30:5] _:[36:0->30:6] Completable: Cpath Value[nn]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[nn]."" ContextPath Value[nn] Path nn @@ -104,7 +106,8 @@ Path CompletionFromModule.SomeOtherModule. Complete src/CompletionFromModule.res 33:32 XXX Not found! Completable: Cpath Module[SomeOthe] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[SomeOthe] Path SomeOthe [{ @@ -118,7 +121,8 @@ Path SomeOthe Complete src/CompletionFromModule.res 38:8 posCursor:[38:8] posNoWhite:[38:7] Found expr:[38:3->0:-1] Completable: Cpath Value[nnn]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[nnn]-> ContextPath Value[nnn] Path nnn @@ -143,8 +147,8 @@ Complete src/CompletionFromModule.res 42:8 posCursor:[42:8] posNoWhite:[42:7] Found expr:[42:3->0:-1] Completable: Cpath Value[nnn]-> Raw opens: 1 SomeOtherModule.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionFromModule +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionFromModule ContextPath Value[nnn]-> ContextPath Value[nnn] Path nnn diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt index 570284b98e..547b54f130 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionFromModule2.res 2:26 posCursor:[2:26] posNoWhite:[2:25] Found expr:[2:3->2:26] Pexp_field [2:3->2:25] _:[11:0->2:26] Completable: Cpath Value[CompletionFromModule, n]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[CompletionFromModule, n]."" ContextPath Value[CompletionFromModule, n] Path CompletionFromModule.n @@ -35,7 +36,8 @@ Complete src/CompletionFromModule2.res 5:27 posCursor:[5:27] posNoWhite:[5:26] Found expr:[5:3->5:27] Pexp_field [5:3->5:26] _:[11:0->5:27] Completable: Cpath Value[CompletionFromModule, nn]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[CompletionFromModule, nn]."" ContextPath Value[CompletionFromModule, nn] Path CompletionFromModule.nn @@ -104,7 +106,8 @@ Path CompletionFromModule.SomeOtherModule. Complete src/CompletionFromModule2.res 8:29 posCursor:[8:29] posNoWhite:[8:28] Found expr:[8:3->0:-1] Completable: Cpath Value[CompletionFromModule, nnn]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[CompletionFromModule, nnn]-> ContextPath Value[CompletionFromModule, nnn] Path CompletionFromModule.nnn @@ -129,8 +132,8 @@ Complete src/CompletionFromModule2.res 12:29 posCursor:[12:29] posNoWhite:[12:28] Found expr:[12:3->0:-1] Completable: Cpath Value[CompletionFromModule, nnn]-> Raw opens: 1 CompletionFromModule.SomeOtherModule.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 CompletionFromModule +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib CompletionFromModule ContextPath Value[CompletionFromModule, nnn]-> ContextPath Value[CompletionFromModule, nnn] Path CompletionFromModule.nnn diff --git a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt index 30dd19d89a..ae28106430 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionFunctionArguments.res 10:24 posCursor:[10:24] posNoWhite:[10:23] Found expr:[10:11->10:25] Pexp_apply ...[10:11->10:17] (~isOn10:19->10:23=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOn) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn @@ -24,7 +25,8 @@ Complete src/CompletionFunctionArguments.res 13:25 posCursor:[13:25] posNoWhite:[13:24] Found expr:[13:11->13:26] Pexp_apply ...[13:11->13:17] (~isOn13:19->13:23=...[13:24->13:25]) Completable: Cexpression CArgument Value[someFn](~isOn)=t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn @@ -41,13 +43,20 @@ Path someFn "tags": [], "detail": "bool", "documentation": null + }, { + "label": "typeof", + "kind": 12, + "tags": [], + "detail": "'a => Type.t", + "documentation": null }] Complete src/CompletionFunctionArguments.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found expr:[16:11->16:26] Pexp_apply ...[16:11->16:17] (~isOff16:19->16:24=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOff) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOff) ContextPath Value[someFn] Path someFn @@ -73,7 +82,8 @@ posCursor:[21:27] posNoWhite:[21:26] Found expr:[21:7->21:28] posCursor:[21:27] posNoWhite:[21:26] Found expr:[21:14->21:28] Pexp_apply ...[21:14->21:20] (~isOn21:22->21:26=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFn](~isOn) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn @@ -95,7 +105,8 @@ Complete src/CompletionFunctionArguments.res 34:24 posCursor:[34:24] posNoWhite:[34:23] Found expr:[34:11->34:25] Pexp_apply ...[34:11->34:22] (...[34:23->34:24]) Completable: Cexpression CArgument Value[someOtherFn]($0)=f -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($0) ContextPath Value[someOtherFn] Path someOtherFn @@ -111,7 +122,8 @@ Complete src/CompletionFunctionArguments.res 51:39 posCursor:[51:39] posNoWhite:[51:38] Found expr:[51:11->51:40] Pexp_apply ...[51:11->51:30] (~config51:32->51:38=...__ghost__[0:-1->0:-1]) Completable: Cexpression CArgument Value[someFnTakingVariant](~config) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~config) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant @@ -145,7 +157,8 @@ Complete src/CompletionFunctionArguments.res 54:40 posCursor:[54:40] posNoWhite:[54:39] Found expr:[54:11->54:41] Pexp_apply ...[54:11->54:30] (~config54:32->54:38=...[54:39->54:40]) Completable: Cexpression CArgument Value[someFnTakingVariant](~config)=O -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~config) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant @@ -165,53 +178,41 @@ Path someFnTakingVariant "detail": "module OIncludeMeInCompletions", "documentation": null }, { - "label": "Obj", + "label": "Option", "kind": 9, "tags": [], - "detail": "module Obj", - "documentation": null, - "data": { - "modulePath": "Obj", - "filePath": "src/CompletionFunctionArguments.res" - } + "detail": "module Option", + "documentation": null }, { - "label": "Object", + "label": "Ordering", "kind": 9, "tags": [], - "detail": "module Object", - "documentation": null, - "data": { - "modulePath": "Object", - "filePath": "src/CompletionFunctionArguments.res" - } + "detail": "module Ordering", + "documentation": null }, { - "label": "Objects", + "label": "Object", "kind": 9, "tags": [], - "detail": "module Objects", - "documentation": null, - "data": { - "modulePath": "Objects", - "filePath": "src/CompletionFunctionArguments.res" - } + "detail": "module Object", + "documentation": null }, { - "label": "Option", + "label": "Obj", "kind": 9, "tags": [], - "detail": "module Option", + "detail": "module Obj", "documentation": null, "data": { - "modulePath": "Option", + "modulePath": "Obj", "filePath": "src/CompletionFunctionArguments.res" } }, { - "label": "Ordering", + "label": "Objects", "kind": 9, "tags": [], - "detail": "module Ordering", + "detail": "module Objects", "documentation": null, "data": { - "modulePath": "Ordering", + "modulePath": "Objects", "filePath": "src/CompletionFunctionArguments.res" } }] @@ -220,7 +221,8 @@ Complete src/CompletionFunctionArguments.res 57:33 posCursor:[57:33] posNoWhite:[57:32] Found expr:[57:11->57:34] Pexp_apply ...[57:11->57:30] (...[57:31->57:33]) Completable: Cexpression CArgument Value[someFnTakingVariant]($0)=So -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant]($0) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant @@ -238,7 +240,8 @@ Complete src/CompletionFunctionArguments.res 60:44 posCursor:[60:44] posNoWhite:[60:43] Found expr:[60:11->60:45] Pexp_apply ...[60:11->60:30] (~configOpt260:32->60:42=...[60:43->60:44]) Completable: Cexpression CArgument Value[someFnTakingVariant](~configOpt2)=O -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~configOpt2) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant @@ -258,53 +261,41 @@ Path someFnTakingVariant "detail": "module OIncludeMeInCompletions", "documentation": null }, { - "label": "Obj", + "label": "Option", "kind": 9, "tags": [], - "detail": "module Obj", - "documentation": null, - "data": { - "modulePath": "Obj", - "filePath": "src/CompletionFunctionArguments.res" - } + "detail": "module Option", + "documentation": null }, { - "label": "Object", + "label": "Ordering", "kind": 9, "tags": [], - "detail": "module Object", - "documentation": null, - "data": { - "modulePath": "Object", - "filePath": "src/CompletionFunctionArguments.res" - } + "detail": "module Ordering", + "documentation": null }, { - "label": "Objects", + "label": "Object", "kind": 9, "tags": [], - "detail": "module Objects", - "documentation": null, - "data": { - "modulePath": "Objects", - "filePath": "src/CompletionFunctionArguments.res" - } + "detail": "module Object", + "documentation": null }, { - "label": "Option", + "label": "Obj", "kind": 9, "tags": [], - "detail": "module Option", + "detail": "module Obj", "documentation": null, "data": { - "modulePath": "Option", + "modulePath": "Obj", "filePath": "src/CompletionFunctionArguments.res" } }, { - "label": "Ordering", + "label": "Objects", "kind": 9, "tags": [], - "detail": "module Ordering", + "detail": "module Objects", "documentation": null, "data": { - "modulePath": "Ordering", + "modulePath": "Objects", "filePath": "src/CompletionFunctionArguments.res" } }] @@ -313,7 +304,8 @@ Complete src/CompletionFunctionArguments.res 63:23 posCursor:[63:23] posNoWhite:[63:22] Found expr:[63:11->63:24] Pexp_apply ...[63:11->63:22] (...[63:23->63:24]) Completable: Cexpression CArgument Value[someOtherFn]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($0) ContextPath Value[someOtherFn] Path someOtherFn @@ -335,7 +327,8 @@ Complete src/CompletionFunctionArguments.res 66:28 posCursor:[66:28] posNoWhite:[66:27] Found expr:[66:11->66:30] Pexp_apply ...[66:11->66:22] (...[66:23->66:24], ...[66:26->66:27]) Completable: Cexpression CArgument Value[someOtherFn]($2) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($2) ContextPath Value[someOtherFn] Path someOtherFn @@ -356,7 +349,8 @@ Path someOtherFn Complete src/CompletionFunctionArguments.res 69:30 posCursor:[69:30] posNoWhite:[69:29] Found expr:[69:11->69:31] Completable: Cexpression CArgument Value[someOtherFn]($2)=t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($2) ContextPath Value[someOtherFn] Path someOtherFn @@ -373,13 +367,20 @@ Path someOtherFn "tags": [], "detail": "bool", "documentation": null + }, { + "label": "typeof", + "kind": 12, + "tags": [], + "detail": "'a => Type.t", + "documentation": null }] Complete src/CompletionFunctionArguments.res 76:25 posCursor:[76:25] posNoWhite:[76:24] Found expr:[76:11->76:26] Pexp_apply ...[76:11->76:24] (...[76:25->76:26]) Completable: Cexpression CArgument Value[fnTakingTuple]($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingTuple]($0) ContextPath Value[fnTakingTuple] Path fnTakingTuple @@ -397,7 +398,8 @@ Complete src/CompletionFunctionArguments.res 89:27 posCursor:[89:27] posNoWhite:[89:26] Found expr:[89:11->89:29] Pexp_apply ...[89:11->89:25] (...[89:26->89:28]) Completable: Cexpression CArgument Value[fnTakingRecord]($0)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord @@ -429,7 +431,8 @@ posCursor:[109:29] posNoWhite:[109:28] Found expr:[107:6->109:29] posCursor:[109:29] posNoWhite:[109:28] Found expr:[108:6->109:29] posCursor:[109:29] posNoWhite:[109:28] Found expr:[109:9->109:29] Completable: Cpath Value[thisGetsBrokenLoc]->a <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[thisGetsBrokenLoc]->a <> ContextPath Value[thisGetsBrokenLoc] Path thisGetsBrokenLoc @@ -451,7 +454,8 @@ posCursor:[111:27] posNoWhite:[111:26] Found expr:[107:6->111:27] posCursor:[111:27] posNoWhite:[111:26] Found expr:[108:6->111:27] posCursor:[111:27] posNoWhite:[111:26] Found expr:[111:9->111:27] Completable: Cpath Value[reassignedWorks]->a <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[reassignedWorks]->a <> ContextPath Value[reassignedWorks] Path reassignedWorks @@ -471,7 +475,8 @@ Pexp_apply ...[121:3->121:11] (~changefreq121:13->121:23=...[121:24->121:31], ~l posCursor:[121:57] posNoWhite:[121:56] Found expr:[121:42->0:-1] posCursor:[121:57] posNoWhite:[121:56] Found expr:[121:42->0:-1] Completable: Cpath Value[fineModuleVal]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fineModuleVal]-> ContextPath Value[fineModuleVal] Path fineModuleVal diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index 8e4d2124cc..8755e16516 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -1,14 +1,15 @@ Complete src/CompletionInferValues.res 15:43 posCursor:[15:43] posNoWhite:[15:42] Found expr:[15:33->15:43] Completable: Cpath Value[aliased]->t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[aliased]->t ContextPath Value[aliased] Path aliased ContextPath Value[x] Path x ContextPath int -Path Int.t +Path Stdlib.Int.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -75,7 +76,8 @@ Complete src/CompletionInferValues.res 18:30 posCursor:[18:30] posNoWhite:[18:29] Found expr:[18:28->18:30] Pexp_field [18:28->18:29] _:[33:0->18:30] Completable: Cpath Value[x]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x]."" ContextPath Value[x] Path x @@ -108,7 +110,8 @@ Complete src/CompletionInferValues.res 21:53 posCursor:[21:53] posNoWhite:[21:52] Found expr:[21:45->21:53] Pexp_field [21:45->21:52] _:[33:0->21:53] Completable: Cpath Value[aliased]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[aliased]."" ContextPath Value[aliased] Path aliased @@ -150,7 +153,8 @@ posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:42->24:63] posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:52->24:63] Pexp_field [24:52->24:62] _:[24:63->24:63] Completable: Cpath Value[someRecord]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someRecord]."" ContextPath Value[someRecord] Path someRecord @@ -190,7 +194,8 @@ posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:69->27:90] posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:79->27:90] Pexp_field [27:79->27:89] _:[27:90->27:90] Completable: Cpath Value[someRecord]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someRecord]."" ContextPath Value[someRecord] Path someRecord @@ -231,7 +236,8 @@ Pexp_apply ...[30:3->30:15] (...[30:16->30:38]) posCursor:[30:36] posNoWhite:[30:35] Found expr:[30:16->30:38] posCursor:[30:36] posNoWhite:[30:35] Found expr:[30:27->30:36] Completable: Cpath Value[event]->pr -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[event]->pr ContextPath Value[event] Path event @@ -255,7 +261,8 @@ JSX 41:15] onMouseEnter[41:16->41:28]=...[41:36->41:52]> _children: posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:36->41:52] posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:41->41:50] Completable: Cpath Value[event]->pr <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[event]->pr <> ContextPath Value[event] Path event @@ -279,7 +286,8 @@ JSX 44:15] onMouseEnter[44:16->44:28]=...[44:36->44:52]> _children: posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:36->44:52] posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:41->44:50] Completable: Cpath Value[event]->pr <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[event]->pr <> ContextPath Value[event] Path event @@ -303,14 +311,15 @@ posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:36->47:89] posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:41->47:87] posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:81->47:87] Completable: Cpath Value[btn]->t <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[btn]->t <> ContextPath Value[btn] Path btn ContextPath Value[JsxEvent, Mouse, button](Nolabel) ContextPath Value[JsxEvent, Mouse, button] Path JsxEvent.Mouse.button -Path Int.t +Path Stdlib.Int.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -380,7 +389,8 @@ posCursor:[50:103] posNoWhite:[50:102] Found expr:[50:36->50:105] posCursor:[50:103] posNoWhite:[50:102] Found expr:[50:41->50:103] posCursor:[50:103] posNoWhite:[50:102] Found expr:[50:95->50:103] Completable: Cpath Value[btn]->spl <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[btn]->spl <> ContextPath Value[btn] Path btn @@ -396,14 +406,15 @@ posCursor:[53:121] posNoWhite:[53:120] Found expr:[53:36->53:123] posCursor:[53:121] posNoWhite:[53:120] Found expr:[53:41->53:121] posCursor:[53:121] posNoWhite:[53:120] Found expr:[53:114->53:121] Completable: Cpath Value[btn]->ma <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[btn]->ma <> ContextPath Value[btn] Path btn ContextPath Value[String, split](Nolabel, Nolabel) ContextPath Value[String, split] Path String.split -Path Array.ma +Path Stdlib.Array.ma [{ "label": "Array.map", "kind": 12, @@ -422,7 +433,8 @@ Complete src/CompletionInferValues.res 75:78 posCursor:[75:78] posNoWhite:[75:77] Found expr:[75:70->75:78] Pexp_field [75:70->75:77] _:[118:0->75:78] Completable: Cpath Value[srecord]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[srecord]."" ContextPath Value[srecord] Path srecord @@ -459,7 +471,8 @@ Complete src/CompletionInferValues.res 79:86 posCursor:[79:86] posNoWhite:[79:85] Found expr:[79:78->79:86] Pexp_field [79:78->79:85] _:[118:0->79:86] Completable: Cpath Value[aliased]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[aliased]."" ContextPath Value[aliased] Path aliased @@ -490,7 +503,8 @@ Complete src/CompletionInferValues.res 83:103 posCursor:[83:103] posNoWhite:[83:102] Found expr:[83:92->83:103] Pexp_field [83:92->83:102] _:[118:0->83:103] Completable: Cpath Value[someRecord]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someRecord]."" ContextPath Value[someRecord] Path someRecord @@ -526,7 +540,8 @@ Path CompletionInferValues. Complete src/CompletionInferValues.res 87:81 posCursor:[87:81] posNoWhite:[87:80] Found expr:[87:69->87:81] Completable: Cpath Value[things]->slic -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[things]->slic ContextPath Value[things] Path things @@ -535,7 +550,7 @@ ContextPath Value[x] Path x ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff -Path String.slic +Path Stdlib.String.slic [{ "label": "String.slice", "kind": 12, @@ -553,7 +568,8 @@ Path String.slic Complete src/CompletionInferValues.res 91:82 posCursor:[91:82] posNoWhite:[91:81] Found expr:[91:70->91:82] Completable: Cpath Value[someInt]->toS -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someInt]->toS ContextPath Value[someInt] Path someInt @@ -562,7 +578,7 @@ ContextPath Value[x] Path x ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff -Path Int.toS +Path Stdlib.Int.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -580,7 +596,8 @@ Path Int.toS Complete src/CompletionInferValues.res 95:109 posCursor:[95:109] posNoWhite:[95:108] Found expr:[95:97->95:109] Completable: Cpath Value[someInt]->toS -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someInt]->toS ContextPath Value[someInt] Path someInt @@ -592,7 +609,7 @@ ContextPath Value[x] Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord -Path Int.toS +Path Stdlib.Int.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -611,7 +628,8 @@ Complete src/CompletionInferValues.res 99:102 posCursor:[99:102] posNoWhite:[99:101] Found expr:[99:57->99:102] posCursor:[99:102] posNoWhite:[99:101] Found expr:[99:90->99:102] Completable: Cpath Value[someInt]->toS -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someInt]->toS ContextPath Value[someInt] Path someInt @@ -623,7 +641,7 @@ ContextPath Value[x] Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord -Path Int.toS +Path Stdlib.Int.toS [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -641,7 +659,8 @@ Path Int.toS Complete src/CompletionInferValues.res 103:88 posCursor:[103:88] posNoWhite:[103:87] Found expr:[103:79->103:88] Completable: Cpath Value[str]->slic -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[str]->slic ContextPath Value[str] Path str @@ -650,7 +669,7 @@ ContextPath Value[x] Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord -Path String.slic +Path Stdlib.String.slic [{ "label": "String.slice", "kind": 12, @@ -668,7 +687,8 @@ Path String.slic Complete src/CompletionInferValues.res 107:89 posCursor:[107:89] posNoWhite:[107:88] Found expr:[107:80->107:89] Completable: Cpath Value[str]->slic -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[str]->slic ContextPath Value[str] Path str @@ -677,7 +697,7 @@ ContextPath Value[x] Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord -Path String.slic +Path Stdlib.String.slic [{ "label": "String.slice", "kind": 12, @@ -695,7 +715,8 @@ Path String.slic Complete src/CompletionInferValues.res 111:80 posCursor:[111:80] posNoWhite:[111:79] Found expr:[111:70->111:80] Completable: Cpath Value[name]->slic -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[name]->slic ContextPath Value[name] Path name @@ -704,7 +725,7 @@ ContextPath Value[x] Path x ContextPath Type[otherNestedRecord] Path otherNestedRecord -Path String.slic +Path Stdlib.String.slic [{ "label": "String.slice", "kind": 12, @@ -722,14 +743,15 @@ Path String.slic Complete src/CompletionInferValues.res 115:53 posCursor:[115:53] posNoWhite:[115:52] Found expr:[115:46->115:53] Completable: Cpath Value[v]->toSt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v]->toSt ContextPath Value[v] Path v ContextPath Value[x] Path x ContextPath int -Path Int.toSt +Path Stdlib.Int.toSt [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -751,7 +773,8 @@ posCursor:[123:26] posNoWhite:[123:25] Found expr:[123:24->123:36] posCursor:[123:26] posNoWhite:[123:25] Found pattern:[123:25->123:27] posCursor:[123:26] posNoWhite:[123:25] Found pattern:[123:25->123:27] Completable: Cpattern CArgument CArgument Value[fnWithRecordCallback]($0)($0)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument CArgument Value[fnWithRecordCallback]($0)($0) ContextPath CArgument Value[fnWithRecordCallback]($0) ContextPath Value[fnWithRecordCallback] @@ -777,7 +800,8 @@ posCursor:[130:30] posNoWhite:[130:29] Found expr:[130:11->130:32] posCursor:[130:30] posNoWhite:[130:29] Found expr:[130:24->0:-1] posCursor:[130:30] posNoWhite:[130:29] Found expr:[130:24->0:-1] Completable: Cpath Value[root]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[root]-> ContextPath Value[root] Path root @@ -809,7 +833,8 @@ posCursor:[139:30] posNoWhite:[139:29] Found expr:[139:11->139:32] posCursor:[139:30] posNoWhite:[139:29] Found expr:[139:24->0:-1] posCursor:[139:30] posNoWhite:[139:29] Found expr:[139:24->0:-1] Completable: Cpath Value[root]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[root]-> ContextPath Value[root] Path root @@ -837,7 +862,8 @@ Path CompletionSupport.Test. Complete src/CompletionInferValues.res 143:47 XXX Not found! Completable: Cpattern Value[Belt, Int, toString](Nolabel) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Belt, Int, toString](Nolabel) ContextPath Value[Belt, Int, toString] Path Belt.Int.toString @@ -855,7 +881,8 @@ Path Belt.Int.toString Complete src/CompletionInferValues.res 147:66 XXX Not found! Completable: Cpattern Value[String, split](Nolabel, Nolabel) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[String, split](Nolabel, Nolabel) ContextPath Value[String, split] Path String.split @@ -877,7 +904,8 @@ posCursor:[151:105] posNoWhite:[151:104] Found expr:[151:81->151:106] posCursor:[151:105] posNoWhite:[151:104] Found expr:[151:97->151:105] Pexp_field [151:97->151:104] _:[151:105->151:105] Completable: Cpath Value[support]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[support]."" ContextPath Value[support] Path support @@ -911,7 +939,8 @@ posCursor:[155:110] posNoWhite:[155:109] Found expr:[155:81->155:111] posCursor:[155:110] posNoWhite:[155:109] Found expr:[155:104->0:-1] posCursor:[155:110] posNoWhite:[155:109] Found expr:[155:104->0:-1] Completable: Cpath Value[root]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[root]-> ContextPath Value[root] Path root @@ -941,10 +970,12 @@ Nothing at that position. Now trying to use completion. posCursor:[160:27] posNoWhite:[160:26] Found expr:[160:25->160:28] Pexp_ident res:[160:25->160:28] Completable: Cpath Value[res] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res {"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt index ec081b6a4d..0fb67ddfcf 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -1,11 +1,12 @@ Complete src/CompletionJsx.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:3->3:17] Completable: Cpath Value[someString]->st -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someString]->st ContextPath Value[someString] Path someString -Path String.st +Path Stdlib.String.st [{ "label": "String.startsWith", "kind": 12, @@ -29,11 +30,12 @@ posCursor:[13:21] posNoWhite:[13:20] Found expr:[12:4->32:10] posCursor:[13:21] posNoWhite:[13:20] Found expr:[13:7->32:10] posCursor:[13:21] posNoWhite:[13:20] Found expr:[13:7->13:21] Completable: Cpath Value[someString]->st <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString -Path String.st +Path Stdlib.String.st [{ "label": "React.string", "kind": 12, @@ -72,11 +74,12 @@ posCursor:[18:24] posNoWhite:[18:23] Found expr:[18:10->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[18:10->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[18:10->18:24] Completable: Cpath Value[someString]->st <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someString]->st <> ContextPath Value[someString] Path someString -Path String.st +Path Stdlib.String.st [{ "label": "React.string", "kind": 12, @@ -115,10 +118,11 @@ posCursor:[20:27] posNoWhite:[20:26] Found expr:[20:10->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[20:10->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[20:10->20:27] Completable: Cpath string->st <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath string->st <> ContextPath string -Path String.st +Path Stdlib.String.st [{ "label": "React.string", "kind": 12, @@ -157,12 +161,13 @@ posCursor:[22:40] posNoWhite:[22:39] Found expr:[22:10->32:4] posCursor:[22:40] posNoWhite:[22:39] Found expr:[22:10->32:4] posCursor:[22:40] posNoWhite:[22:39] Found expr:[22:10->22:40] Completable: Cpath Value[String, trim](Nolabel)->st <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[String, trim](Nolabel)->st <> ContextPath Value[String, trim](Nolabel) ContextPath Value[String, trim] Path String.trim -Path String.st +Path Stdlib.String.st [{ "label": "React.string", "kind": 12, @@ -201,11 +206,12 @@ posCursor:[24:19] posNoWhite:[24:18] Found expr:[24:10->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[24:10->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[24:10->0:-1] Completable: Cpath Value[someInt]-> <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someInt]-> <> ContextPath Value[someInt] Path someInt -Path Int. +Path Stdlib.Int. [{ "label": "React.int", "kind": 12, @@ -254,7 +260,7 @@ Path Int. "label": "Int.compare", "kind": 12, "tags": [], - "detail": "(int, int) => Ordering.t", + "detail": "(int, int) => Stdlib_Ordering.t", "documentation": null }, { "label": "Int.toPrecision", @@ -328,10 +334,11 @@ posCursor:[26:14] posNoWhite:[26:13] Found expr:[26:10->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[26:10->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[26:10->0:-1] Completable: Cpath int-> <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath int-> <> ContextPath int -Path Int. +Path Stdlib.Int. [{ "label": "React.int", "kind": 12, @@ -380,7 +387,7 @@ Path Int. "label": "Int.compare", "kind": 12, "tags": [], - "detail": "(int, int) => Ordering.t", + "detail": "(int, int) => Stdlib_Ordering.t", "documentation": null }, { "label": "Int.toPrecision", @@ -454,11 +461,12 @@ posCursor:[28:20] posNoWhite:[28:19] Found expr:[28:10->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[28:10->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[28:10->28:20] Completable: Cpath Value[someArr]->a <> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someArr]->a <> ContextPath Value[someArr] Path someArr -Path Array.a +Path Stdlib.Array.a [{ "label": "React.array", "kind": 12, @@ -492,7 +500,8 @@ posCursor:[30:12] posNoWhite:[30:11] Found expr:[30:10->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[30:10->32:10] JSX 30:12] div[32:6->32:9]=...[32:6->32:9]> _children:32:9 Completable: ChtmlElement ", "kind": 4, @@ -520,7 +529,8 @@ Complete src/CompletionJsx.res 45:23 posCursor:[45:23] posNoWhite:[45:22] Found expr:[45:4->45:23] JSX 45:21] n[45:22->45:23]=...[45:22->45:23]> _children:None Completable: Cjsx([CompWithoutJsxPpx], n, [n]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path CompWithoutJsxPpx.make [{ "label": "name", @@ -534,7 +544,8 @@ Complete src/CompletionJsx.res 48:27 posCursor:[48:27] posNoWhite:[48:26] Found expr:[48:4->48:28] JSX 48:17] someProp[48:18->48:26]=...[48:18->48:26]> _children:None Completable: Cexpression CJsxPropValue [SomeComponent] someProp -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [SomeComponent] someProp Path SomeComponent.make [{ @@ -552,7 +563,8 @@ Complete src/CompletionJsx.res 51:11 posCursor:[51:11] posNoWhite:[51:10] Found expr:[51:4->51:11] JSX 51:6] hidd[51:7->51:11]=...[51:7->51:11]> _children:None Completable: Cjsx([h1], hidd, [hidd]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path ReactDOM.domProps Path JsxDOM.domProps [{ @@ -567,7 +579,8 @@ Complete src/CompletionJsx.res 61:30 posCursor:[61:30] posNoWhite:[61:28] Found expr:[61:4->61:29] JSX 61:29] > _children:None Completable: Cjsx([IntrinsicElementLowercase], "", []) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path IntrinsicElementLowercase.make [{ "label": "name", @@ -593,7 +606,8 @@ Complete src/CompletionJsx.res 73:36 posCursor:[73:36] posNoWhite:[73:35] Found expr:[73:4->73:41] JSX 73:17] name[73:18->73:22]=...[73:23->73:30] time[73:31->73:35]=...[73:37->73:40]> _children:None Completable: Cexpression CJsxPropValue [MultiPropComp] time -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make [{ @@ -618,7 +632,8 @@ Complete src/CompletionJsx.res 76:36 posCursor:[76:36] posNoWhite:[76:35] Found expr:[76:4->76:40] JSX 76:17] name[76:18->76:22]=...[76:23->76:30] time[76:31->76:35]=...[76:37->76:40]> _children:None Completable: Cexpression CJsxPropValue [MultiPropComp] time -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make [{ @@ -643,7 +658,8 @@ Complete src/CompletionJsx.res 79:28 posCursor:[79:28] posNoWhite:[79:27] Found expr:[79:4->79:32] JSX 79:17] name[79:18->79:22]=...[79:18->79:22] time[79:23->79:27]=...[79:29->79:32]> _children:None Completable: Cexpression CJsxPropValue [MultiPropComp] time -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make [{ @@ -668,7 +684,8 @@ Complete src/CompletionJsx.res 89:26 posCursor:[89:26] posNoWhite:[89:24] Found expr:[89:4->89:27] JSX 89:8] _type[89:9->89:14]=...[89:16->89:24]> _children:89:26 Completable: Cjsx([Info], "", [_type]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path Info.make [{ "label": "key", @@ -686,12 +703,13 @@ posCursor:[93:19] posNoWhite:[93:18] Found expr:[93:15->93:20] posCursor:[93:19] posNoWhite:[93:18] Found expr:[93:15->93:19] Pexp_field [93:15->93:17] s:[93:18->93:19] Completable: Cpath string.s -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath string.s ContextPath string ContextPath string->s <> ContextPath string -Path String.s +Path Stdlib.String.s [{ "label": "->React.string", "kind": 12, @@ -733,7 +751,7 @@ Path String.s "label": "->String.searchOpt", "kind": 12, "tags": [], - "detail": "(string, RegExp.t) => option", + "detail": "(string, Stdlib_RegExp.t) => option", "documentation": {"kind": "markdown", "value": "\n`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", %re(\"/\\d+/\")) == Some(8)\nString.searchOpt(\"no numbers\", %re(\"/\\d+/\")) == None\n```\n"}, "sortText": "searchOpt", "insertText": "->String.searchOpt", @@ -745,7 +763,7 @@ Path String.s "label": "->String.splitByRegExpAtMost", "kind": 12, "tags": [], - "detail": "(string, RegExp.t, ~limit: int) => array>", + "detail": "(\n string,\n Stdlib_RegExp.t,\n ~limit: int,\n) => array>", "documentation": {"kind": "markdown", "value": "\n`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", %re(\"/ /\"), ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n]\n```\n"}, "sortText": "splitByRegExpAtMost", "insertText": "->String.splitByRegExpAtMost", @@ -781,7 +799,7 @@ Path String.s "label": "->String.setSymbol", "kind": 12, "tags": [], - "detail": "(string, Symbol.t, 'a) => unit", + "detail": "(string, Stdlib_Symbol.t, 'a) => unit", "documentation": null, "sortText": "setSymbol", "insertText": "->String.setSymbol", @@ -793,7 +811,7 @@ Path String.s "label": "->String.splitByRegExp", "kind": 12, "tags": [], - "detail": "(string, RegExp.t) => array>", + "detail": "(string, Stdlib_RegExp.t) => array>", "documentation": {"kind": "markdown", "value": "\n`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", %re(\"/,/\")) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```\n"}, "sortText": "splitByRegExp", "insertText": "->String.splitByRegExp", @@ -841,7 +859,7 @@ Path String.s "label": "->String.search", "kind": 12, "tags": [], - "detail": "(string, RegExp.t) => int", + "detail": "(string, Stdlib_RegExp.t) => int", "documentation": {"kind": "markdown", "value": "\n`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", %re(\"/\\d+/\")) == 8\nString.search(\"no numbers\", %re(\"/\\d+/\")) == -1\n```\n"}, "sortText": "search", "insertText": "->String.search", diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt index 5cbc61be30..11d4780017 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionJsxProps.res 0:47 posCursor:[0:47] posNoWhite:[0:46] Found expr:[0:12->0:47] JSX 0:43] on[0:44->0:46]=...__ghost__[0:-1->0:-1]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] on -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make [{ @@ -23,7 +24,8 @@ Complete src/CompletionJsxProps.res 3:48 posCursor:[3:48] posNoWhite:[3:47] Found expr:[3:12->3:48] JSX 3:43] on[3:44->3:46]=...[3:47->3:48]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] on=t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make [{ @@ -31,6 +33,13 @@ Path CompletionSupport.TestComponent.make "kind": 4, "tags": [], "detail": "bool", + "documentation": null, + "sortText": "A true" + }, { + "label": "typeof", + "kind": 12, + "tags": [], + "detail": "'a => Type.t", "documentation": null }] @@ -38,7 +47,8 @@ Complete src/CompletionJsxProps.res 6:50 posCursor:[6:50] posNoWhite:[6:49] Found expr:[6:12->6:50] JSX 6:43] test[6:44->6:48]=...[6:49->6:50]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] test=T -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] test Path CompletionSupport.TestComponent.make [{ @@ -60,23 +70,25 @@ Path CompletionSupport.TestComponent.make "insertText": "{Three($0)}", "insertTextFormat": 2 }, { - "label": "TableclothMap", + "label": "TypedArray", "kind": 9, "tags": [], - "detail": "module TableclothMap", - "documentation": null, - "data": { - "modulePath": "TableclothMap", - "filePath": "src/CompletionJsxProps.res" - } + "detail": "module TypedArray", + "documentation": null }, { "label": "Type", "kind": 9, "tags": [], "detail": "module Type", + "documentation": null + }, { + "label": "TableclothMap", + "kind": 9, + "tags": [], + "detail": "module TableclothMap", "documentation": null, "data": { - "modulePath": "Type", + "modulePath": "TableclothMap", "filePath": "src/CompletionJsxProps.res" } }, { @@ -119,23 +131,14 @@ Path CompletionSupport.TestComponent.make "modulePath": "TypeDefinition", "filePath": "src/CompletionJsxProps.res" } - }, { - "label": "TypedArray", - "kind": 9, - "tags": [], - "detail": "module TypedArray", - "documentation": null, - "data": { - "modulePath": "TypedArray", - "filePath": "src/CompletionJsxProps.res" - } }] Complete src/CompletionJsxProps.res 9:52 posCursor:[9:52] posNoWhite:[9:51] Found expr:[9:12->9:52] JSX 9:43] polyArg[9:44->9:51]=...__ghost__[0:-1->0:-1]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] polyArg -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make [{ @@ -176,7 +179,8 @@ Complete src/CompletionJsxProps.res 12:54 posCursor:[12:54] posNoWhite:[12:53] Found expr:[12:12->12:54] JSX 12:43] polyArg[12:44->12:51]=...[12:52->12:54]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] polyArg=#t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make [{ @@ -209,7 +213,8 @@ Complete src/CompletionJsxProps.res 15:22 posCursor:[15:22] posNoWhite:[15:21] Found expr:[15:12->15:25] JSX 15:15] muted[15:16->15:21]=...__ghost__[0:-1->0:-1]> _children:None Completable: Cexpression CJsxPropValue [div] muted -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] muted Path ReactDOM.domProps Path JsxDOM.domProps @@ -231,7 +236,8 @@ Complete src/CompletionJsxProps.res 18:29 posCursor:[18:29] posNoWhite:[18:28] Found expr:[18:12->18:32] JSX 18:15] onMouseEnter[18:16->18:28]=...__ghost__[0:-1->0:-1]> _children:None Completable: Cexpression CJsxPropValue [div] onMouseEnter -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] onMouseEnter Path ReactDOM.domProps Path JsxDOM.domProps @@ -250,7 +256,8 @@ Complete src/CompletionJsxProps.res 22:52 posCursor:[22:52] posNoWhite:[22:51] Found expr:[22:12->22:52] JSX 22:43] testArr[22:44->22:51]=...__ghost__[0:-1->0:-1]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] testArr -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] testArr Path CompletionSupport.TestComponent.make [{ @@ -268,7 +275,8 @@ Complete src/CompletionJsxProps.res 26:54 posCursor:[26:54] posNoWhite:[26:53] Found expr:[26:12->26:56] JSX 26:43] testArr[26:44->26:51]=...[26:53->26:55]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] testArr->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] testArr Path CompletionSupport.TestComponent.make [{ @@ -301,7 +309,8 @@ Complete src/CompletionJsxProps.res 31:53 posCursor:[31:53] posNoWhite:[31:52] Found expr:[31:12->31:54] JSX 31:43] polyArg[31:44->31:51]=...[31:52->31:54]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] polyArg->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make [{ @@ -342,7 +351,8 @@ Complete src/CompletionJsxProps.res 34:49 posCursor:[34:49] posNoWhite:[34:48] Found expr:[34:12->34:50] JSX 34:43] on[34:44->34:46]=...[34:48->34:49]> _children:None Completable: Cexpression CJsxPropValue [CompletionSupport, TestComponent] on=t->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make [{ @@ -357,13 +367,20 @@ Path CompletionSupport.TestComponent.make "tags": [], "detail": "[> #two]", "documentation": null + }, { + "label": "typeof", + "kind": 12, + "tags": [], + "detail": "'a => Type.t", + "documentation": null }] Complete src/CompletionJsxProps.res 44:44 posCursor:[44:44] posNoWhite:[44:43] Found expr:[44:12->44:44] JSX 44:36] status[44:37->44:43]=...__ghost__[0:-1->0:-1]> _children:None Completable: Cexpression CJsxPropValue [CompletableComponentLazy] status -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletableComponentLazy] status Path CompletableComponentLazy.make [{ diff --git a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt index ecc736dd52..ee1a269705 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionMultipleEditorCompleteFrom.res 19:5 posCursor:[19:5] posNoWhite:[19:4] Found expr:[19:3->19:5] Pexp_field [19:3->19:4] _:[22:0->19:5] Completable: Cpath Value[a]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[a]."" ContextPath Value[a] Path a diff --git a/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt b/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt index f9a78b5378..aeee22461d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt @@ -4,7 +4,8 @@ posCursor:[5:7] posNoWhite:[5:5] Found expr:[2:10->9:1] posCursor:[5:7] posNoWhite:[5:5] Found pattern:__ghost__[0:-1->7:5] posCursor:[5:7] posNoWhite:[5:5] Found pattern:__ghost__[0:-1->7:5] Completable: Cpattern Value[x] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ diff --git a/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt index 1bf80d38f0..eb7955b96f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt @@ -5,7 +5,8 @@ posCursor:[7:13] posNoWhite:[7:12] Found expr:[7:3->7:13] Complete src/CompletionPattern.res 10:15 XXX Not found! Completable: Cpattern Value[v] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -22,7 +23,8 @@ Complete src/CompletionPattern.res 13:18 posCursor:[13:18] posNoWhite:[13:17] Found pattern:[13:16->13:22] posCursor:[13:18] posNoWhite:[13:17] Found pattern:[13:17->13:18] Completable: Cpattern Value[v]=t->tuple($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -38,7 +40,8 @@ posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:16->16:30] posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:23->16:29] posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:24->16:25] Completable: Cpattern Value[v]=f->tuple($2), tuple($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -52,7 +55,8 @@ Path v Complete src/CompletionPattern.res 21:15 XXX Not found! Completable: Cpattern Value[x] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ @@ -72,7 +76,8 @@ Path x Complete src/CompletionPattern.res 24:17 posCursor:[24:17] posNoWhite:[24:16] Found pattern:[24:16->24:17] Completable: Cpattern Value[x]=t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ @@ -86,7 +91,8 @@ Path x Complete src/CompletionPattern.res 46:15 XXX Not found! Completable: Cpattern Value[f] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -103,7 +109,8 @@ Path f Complete src/CompletionPattern.res 49:17 posCursor:[49:17] posNoWhite:[49:16] Found pattern:[49:16->49:18] Completable: Cpattern Value[f]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -135,7 +142,8 @@ Path f Complete src/CompletionPattern.res 52:24 posCursor:[52:24] posNoWhite:[52:22] Found pattern:[52:16->52:35] Completable: Cpattern Value[f]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -156,7 +164,8 @@ Complete src/CompletionPattern.res 55:19 posCursor:[55:19] posNoWhite:[55:18] Found pattern:[55:16->55:20] posCursor:[55:19] posNoWhite:[55:18] Found pattern:[55:17->55:19] Completable: Cpattern Value[f]=fi->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -172,7 +181,8 @@ posCursor:[58:19] posNoWhite:[58:18] Found pattern:[58:16->58:24] posCursor:[58:19] posNoWhite:[58:18] Found pattern:[58:17->58:20] posCursor:[58:19] posNoWhite:[58:18] Found pattern:[58:18->58:19] Completable: Cpattern Value[z]=o->tuple($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -186,7 +196,8 @@ Path z Complete src/CompletionPattern.res 61:22 posCursor:[61:22] posNoWhite:[61:21] Found pattern:[61:16->61:25] Completable: Cpattern Value[f]->recordField(nest) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -204,7 +215,8 @@ Complete src/CompletionPattern.res 64:24 posCursor:[64:24] posNoWhite:[64:23] Found pattern:[64:16->64:26] posCursor:[64:24] posNoWhite:[64:23] Found pattern:[64:23->64:25] Completable: Cpattern Value[f]->recordField(nest), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -220,7 +232,8 @@ posCursor:[70:22] posNoWhite:[70:21] Found expr:[69:2->72:13] posCursor:[70:22] posNoWhite:[70:21] Found expr:[70:5->72:13] posCursor:[70:22] posNoWhite:[70:21] Found pattern:[70:21->70:23] Completable: Cpattern Value[nest]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[nest] Path nest [{ @@ -234,7 +247,8 @@ Path nest Complete src/CompletionPattern.res 76:8 posCursor:[76:8] posNoWhite:[76:7] Found pattern:[76:7->76:9] Completable: Cpattern Value[f]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -268,7 +282,8 @@ posCursor:[79:16] posNoWhite:[79:15] Found pattern:[79:7->79:18] posCursor:[79:16] posNoWhite:[79:15] Found pattern:[79:14->79:17] posCursor:[79:16] posNoWhite:[79:15] Found pattern:[79:15->79:16] Completable: Cpattern Value[f]=n->recordField(nest), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[f] Path f [{ @@ -285,7 +300,8 @@ Ppat_construct Two:[87:16->87:19] posCursor:[87:20] posNoWhite:[87:19] Found pattern:[87:19->87:21] Ppat_construct ():[87:19->87:21] Completable: Cpattern Value[z]->variantPayload::Two($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -307,7 +323,8 @@ posCursor:[90:21] posNoWhite:[90:20] Found pattern:[90:16->90:22] Ppat_construct Two:[90:16->90:19] posCursor:[90:21] posNoWhite:[90:20] Found pattern:[90:20->90:21] Completable: Cpattern Value[z]=t->variantPayload::Two($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -323,7 +340,8 @@ posCursor:[93:23] posNoWhite:[93:22] Found pattern:[93:16->93:25] Ppat_construct Three:[93:16->93:21] posCursor:[93:23] posNoWhite:[93:22] Found pattern:[93:22->93:24] Completable: Cpattern Value[z]->variantPayload::Three($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -358,7 +376,8 @@ Ppat_construct Three:[96:16->96:21] posCursor:[96:27] posNoWhite:[96:26] Found pattern:[96:21->96:29] posCursor:[96:27] posNoWhite:[96:26] Found pattern:[96:26->96:27] Completable: Cpattern Value[z]=t->variantPayload::Three($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -374,7 +393,8 @@ posCursor:[103:21] posNoWhite:[103:20] Found pattern:[103:16->103:22] posCursor:[103:21] posNoWhite:[103:20] Found pattern:[103:20->103:21] Ppat_construct ():[103:20->103:21] Completable: Cpattern Value[b]->polyvariantPayload::two($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[b] Path b [{ @@ -395,7 +415,8 @@ Complete src/CompletionPattern.res 106:22 posCursor:[106:22] posNoWhite:[106:21] Found pattern:[106:16->106:23] posCursor:[106:22] posNoWhite:[106:21] Found pattern:[106:21->106:22] Completable: Cpattern Value[b]=t->polyvariantPayload::two($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[b] Path b [{ @@ -410,7 +431,8 @@ Complete src/CompletionPattern.res 109:24 posCursor:[109:24] posNoWhite:[109:23] Found pattern:[109:16->109:26] posCursor:[109:24] posNoWhite:[109:23] Found pattern:[109:23->109:25] Completable: Cpattern Value[b]->polyvariantPayload::three($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[b] Path b [{ @@ -444,7 +466,8 @@ posCursor:[112:28] posNoWhite:[112:27] Found pattern:[112:16->112:29] posCursor:[112:28] posNoWhite:[112:27] Found pattern:[112:22->112:29] posCursor:[112:28] posNoWhite:[112:27] Found pattern:[112:27->112:28] Completable: Cpattern Value[b]=t->polyvariantPayload::three($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[b] Path b [{ @@ -458,7 +481,8 @@ Path b Complete src/CompletionPattern.res 118:15 XXX Not found! Completable: Cpattern Value[c] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[c] Path c [{ @@ -475,7 +499,8 @@ Path c Complete src/CompletionPattern.res 121:17 posCursor:[121:17] posNoWhite:[121:16] Found pattern:[121:16->121:18] Completable: Cpattern Value[c]->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[c] Path c [{ @@ -498,7 +523,8 @@ Ppat_construct Some:[127:16->127:20] posCursor:[127:21] posNoWhite:[127:20] Found pattern:[127:20->127:22] Ppat_construct ():[127:20->127:22] Completable: Cpattern Value[o]->variantPayload::Some($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[o] Path o [{ @@ -519,7 +545,8 @@ Complete src/CompletionPattern.res 134:23 posCursor:[134:23] posNoWhite:[134:22] Found pattern:[134:16->134:25] Ppat_construct Test:[134:16->134:20] Completable: Cpattern Value[p]->variantPayload::Test($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[p] Path p [{ @@ -541,7 +568,8 @@ posCursor:[137:29] posNoWhite:[137:28] Found pattern:[137:16->137:31] Ppat_construct Test:[137:16->137:20] posCursor:[137:29] posNoWhite:[137:28] Found pattern:[137:20->137:32] Completable: Cpattern Value[p]->variantPayload::Test($2) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[p] Path p [{ @@ -577,7 +605,8 @@ posCursor:[140:23] posNoWhite:[140:22] Found pattern:[140:16->140:31] Ppat_construct Test:[140:16->140:20] posCursor:[140:23] posNoWhite:[140:22] Found pattern:[140:20->140:32] Completable: Cpattern Value[p]->variantPayload::Test($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[p] Path p [{ @@ -599,7 +628,8 @@ posCursor:[143:35] posNoWhite:[143:34] Found pattern:[143:16->143:37] Ppat_construct Test:[143:16->143:20] posCursor:[143:35] posNoWhite:[143:34] Found pattern:[143:20->143:38] Completable: Cpattern Value[p]->variantPayload::Test($3) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[p] Path p [{ @@ -616,7 +646,8 @@ Path p Complete src/CompletionPattern.res 150:24 posCursor:[150:24] posNoWhite:[150:23] Found pattern:[150:16->150:26] Completable: Cpattern Value[v]->polyvariantPayload::test($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -637,7 +668,8 @@ Complete src/CompletionPattern.res 153:30 posCursor:[153:30] posNoWhite:[153:29] Found pattern:[153:16->153:32] posCursor:[153:30] posNoWhite:[153:29] Found pattern:[153:21->153:32] Completable: Cpattern Value[v]->polyvariantPayload::test($2) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -672,7 +704,8 @@ Complete src/CompletionPattern.res 156:24 posCursor:[156:24] posNoWhite:[156:23] Found pattern:[156:16->156:32] posCursor:[156:24] posNoWhite:[156:23] Found pattern:[156:21->156:32] Completable: Cpattern Value[v]->polyvariantPayload::test($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -693,7 +726,8 @@ Complete src/CompletionPattern.res 159:36 posCursor:[159:36] posNoWhite:[159:35] Found pattern:[159:16->159:38] posCursor:[159:36] posNoWhite:[159:35] Found pattern:[159:21->159:38] Completable: Cpattern Value[v]->polyvariantPayload::test($3) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[v] Path v [{ @@ -711,7 +745,8 @@ Complete src/CompletionPattern.res 164:17 posCursor:[164:17] posNoWhite:[164:16] Found pattern:[164:16->164:18] Ppat_construct ():[164:16->164:18] Completable: Cpattern Value[s]->tuple($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [{ @@ -731,7 +766,8 @@ Path s Complete src/CompletionPattern.res 167:23 posCursor:[167:23] posNoWhite:[167:21] Found pattern:[167:16->167:24] Completable: Cpattern Value[s]->tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [{ @@ -765,7 +801,8 @@ Path s Complete src/CompletionPattern.res 170:22 posCursor:[170:22] posNoWhite:[170:21] Found pattern:[170:16->170:28] Completable: Cpattern Value[s]->tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [{ @@ -799,7 +836,8 @@ Path s Complete src/CompletionPattern.res 173:35 XXX Not found! Completable: Cpattern Value[s] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [{ @@ -815,7 +853,8 @@ Path s Complete src/CompletionPattern.res 176:41 posCursor:[176:41] posNoWhite:[176:40] Found pattern:[176:35->176:47] Completable: Cpattern Value[s]->tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [{ @@ -849,7 +888,8 @@ Path s Complete src/CompletionPattern.res 179:21 XXX Not found! Completable: Cpattern Value[z] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -883,7 +923,8 @@ posCursor:[182:32] posNoWhite:[182:31] Found pattern:[182:16->182:34] posCursor:[182:32] posNoWhite:[182:31] Found pattern:[182:22->182:34] Ppat_construct Two:[182:22->182:25] Completable: Cpattern Value[z]->variantPayload::Two($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -906,7 +947,8 @@ posCursor:[185:48] posNoWhite:[185:47] Found pattern:[185:22->185:50] Ppat_construct Three:[185:22->185:27] posCursor:[185:48] posNoWhite:[185:47] Found pattern:[185:27->185:53] Completable: Cpattern Value[z]->variantPayload::Three($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[z] Path z [{ @@ -927,7 +969,8 @@ Complete src/CompletionPattern.res 188:34 posCursor:[188:34] posNoWhite:[188:33] Found pattern:[188:16->188:36] posCursor:[188:34] posNoWhite:[188:33] Found pattern:[188:23->188:36] Completable: Cpattern Value[b]->polyvariantPayload::two($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[b] Path b [{ @@ -949,7 +992,8 @@ posCursor:[191:50] posNoWhite:[191:49] Found pattern:[191:16->191:52] posCursor:[191:50] posNoWhite:[191:49] Found pattern:[191:23->191:52] posCursor:[191:50] posNoWhite:[191:49] Found pattern:[191:29->191:52] Completable: Cpattern Value[b]->polyvariantPayload::three($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[b] Path b [{ @@ -970,7 +1014,8 @@ Complete src/CompletionPattern.res 194:24 posCursor:[194:24] posNoWhite:[194:23] Found pattern:[194:16->194:29] posCursor:[194:24] posNoWhite:[194:23] Found pattern:[194:23->194:24] Completable: Cpattern Value[s]->tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[s] Path s [{ @@ -1004,7 +1049,8 @@ Path s Complete src/CompletionPattern.res 201:25 posCursor:[201:25] posNoWhite:[201:24] Found pattern:[201:17->201:28] Completable: Cpattern Value[ff]->recordField(someFn) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[ff] Path ff [] @@ -1012,7 +1058,8 @@ Path ff Complete src/CompletionPattern.res 206:16 XXX Not found! Completable: Cpattern Value[xn] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[xn] Path xn [{ @@ -1026,7 +1073,8 @@ Path xn Complete src/CompletionPattern.res 211:30 XXX Not found! Completable: Cpattern await Value[getThing](Nolabel) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath await Value[getThing](Nolabel) ContextPath Value[getThing](Nolabel) ContextPath Value[getThing] @@ -1063,7 +1111,8 @@ Ppat_construct Ok:[216:18->216:20] posCursor:[216:21] posNoWhite:[216:20] Found pattern:[216:20->216:22] Ppat_construct ():[216:20->216:22] Completable: Cpattern Value[res]->variantPayload::Ok($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -1098,7 +1147,8 @@ Ppat_construct Error:[219:18->219:23] posCursor:[219:24] posNoWhite:[219:23] Found pattern:[219:23->219:25] Ppat_construct ():[219:23->219:25] Completable: Cpattern Value[res]->variantPayload::Error($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -1132,7 +1182,8 @@ posCursor:[227:25] posNoWhite:[227:24] Found expr:[223:11->231:1] posCursor:[227:25] posNoWhite:[227:24] Found expr:[226:4->227:28] posCursor:[227:25] posNoWhite:[227:24] Found pattern:[227:18->227:27] Completable: Cpattern Value[r]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[r] Path r [{ @@ -1158,7 +1209,8 @@ Path r Complete src/CompletionPattern.res 242:33 posCursor:[242:33] posNoWhite:[242:32] Found pattern:[242:7->242:35] Completable: Cpattern Value[hitsUse](Nolabel)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[hitsUse](Nolabel) ContextPath Value[hitsUse] Path hitsUse diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index 10049f4281..d35eb940f1 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -1,7 +1,8 @@ Complete src/CompletionPipeChain.res 27:16 posCursor:[27:16] posNoWhite:[27:15] Found expr:[27:11->0:-1] Completable: Cpath Value[int]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[int]-> ContextPath Value[int] Path int @@ -30,7 +31,8 @@ Path Integer. Complete src/CompletionPipeChain.res 30:23 posCursor:[30:23] posNoWhite:[30:22] Found expr:[30:11->0:-1] Completable: Cpath Value[toFlt](Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[toFlt](Nolabel)-> ContextPath Value[toFlt](Nolabel) ContextPath Value[toFlt] @@ -48,7 +50,8 @@ Path SuperFloat. Complete src/CompletionPipeChain.res 33:38 posCursor:[33:38] posNoWhite:[33:37] Found expr:[33:11->0:-1] Completable: Cpath Value[Integer, increment](Nolabel, Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Integer, increment](Nolabel, Nolabel)-> ContextPath Value[Integer, increment](Nolabel, Nolabel) ContextPath Value[Integer, increment] @@ -78,7 +81,8 @@ Path Integer. Complete src/CompletionPipeChain.res 36:38 posCursor:[36:38] posNoWhite:[36:37] Found expr:[36:11->0:-1] Completable: Cpath Value[Integer, increment](Nolabel, Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Integer, increment](Nolabel, Nolabel)-> ContextPath Value[Integer, increment](Nolabel, Nolabel) ContextPath Value[Integer, increment] @@ -108,7 +112,8 @@ Path Integer. Complete src/CompletionPipeChain.res 39:47 posCursor:[39:47] posNoWhite:[39:46] Found expr:[39:11->0:-1] Completable: Cpath Value[Integer, decrement](Nolabel, Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Integer, decrement](Nolabel, Nolabel)-> ContextPath Value[Integer, decrement](Nolabel, Nolabel) ContextPath Value[Integer, decrement] @@ -138,7 +143,8 @@ Path Integer. Complete src/CompletionPipeChain.res 42:69 posCursor:[42:69] posNoWhite:[42:68] Found expr:[42:11->0:-1] Completable: Cpath Value[Integer, decrement](Nolabel, Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Integer, decrement](Nolabel, Nolabel)-> ContextPath Value[Integer, decrement](Nolabel, Nolabel) ContextPath Value[Integer, decrement] @@ -168,7 +174,8 @@ Path Integer. Complete src/CompletionPipeChain.res 45:62 posCursor:[45:62] posNoWhite:[45:61] Found expr:[45:11->0:-1] Completable: Cpath Value[SuperFloat, fromInteger](Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[SuperFloat, fromInteger](Nolabel)-> ContextPath Value[SuperFloat, fromInteger](Nolabel) ContextPath Value[SuperFloat, fromInteger] @@ -186,7 +193,8 @@ Path SuperFloat. Complete src/CompletionPipeChain.res 48:63 posCursor:[48:63] posNoWhite:[48:62] Found expr:[48:11->48:63] Completable: Cpath Value[SuperFloat, fromInteger](Nolabel)->t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[SuperFloat, fromInteger](Nolabel)->t ContextPath Value[SuperFloat, fromInteger](Nolabel) ContextPath Value[SuperFloat, fromInteger] @@ -204,7 +212,8 @@ Path SuperFloat.t Complete src/CompletionPipeChain.res 51:82 posCursor:[51:82] posNoWhite:[51:81] Found expr:[51:11->0:-1] Completable: Cpath Value[CompletionSupport, Test, make](Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[CompletionSupport, Test, make](Nolabel)-> ContextPath Value[CompletionSupport, Test, make](Nolabel) ContextPath Value[CompletionSupport, Test, make] @@ -228,7 +237,8 @@ Path CompletionSupport.Test. Complete src/CompletionPipeChain.res 54:78 posCursor:[54:78] posNoWhite:[54:77] Found expr:[54:11->0:-1] Completable: Cpath Value[CompletionSupport, Test, addSelf](Nolabel, Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[CompletionSupport, Test, addSelf](Nolabel, Nolabel)-> ContextPath Value[CompletionSupport, Test, addSelf](Nolabel, Nolabel) ContextPath Value[CompletionSupport, Test, addSelf] @@ -252,24 +262,26 @@ Path CompletionSupport.Test. Complete src/CompletionPipeChain.res 58:5 posCursor:[58:5] posNoWhite:[58:4] Found expr:[57:8->0:-1] Completable: Cpath Value[Array, forEach](Nolabel, Nolabel)-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Array, forEach](Nolabel, Nolabel)-> ContextPath Value[Array, forEach](Nolabel, Nolabel) ContextPath Value[Array, forEach] Path Array.forEach CPPipe pathFromEnv: found:true -Path Array. +Path Stdlib_Array. [] Complete src/CompletionPipeChain.res 62:6 posCursor:[62:6] posNoWhite:[62:5] Found expr:[61:8->62:6] Completable: Cpath Value[Belt, Array, reduce](Nolabel, Nolabel, Nolabel)->t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Belt, Array, reduce](Nolabel, Nolabel, Nolabel)->t ContextPath Value[Belt, Array, reduce](Nolabel, Nolabel, Nolabel) ContextPath Value[Belt, Array, reduce] Path Belt.Array.reduce -Path Int.t +Path Stdlib.Int.t [{ "label": "Int.toStringWithRadix", "kind": 12, @@ -335,7 +347,8 @@ Path Int.t Complete src/CompletionPipeChain.res 70:12 posCursor:[70:12] posNoWhite:[70:11] Found expr:[70:3->0:-1] Completable: Cpath Value[aliased]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[aliased]-> ContextPath Value[aliased] Path aliased @@ -358,7 +371,8 @@ Path CompletionSupport.Test. Complete src/CompletionPipeChain.res 73:15 posCursor:[73:15] posNoWhite:[73:14] Found expr:[73:3->0:-1] Completable: Cpath Value[notAliased]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[notAliased]-> ContextPath Value[notAliased] Path notAliased @@ -386,7 +400,8 @@ posCursor:[82:30] posNoWhite:[82:29] Found expr:[79:4->90:14] posCursor:[82:30] posNoWhite:[82:29] Found expr:[82:7->90:14] posCursor:[82:30] posNoWhite:[82:29] Found expr:[82:7->82:30] Completable: Cpath Value[props].support.root->ren -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[props].support.root->ren ContextPath Value[props].support.root ContextPath Value[props].support @@ -428,7 +443,8 @@ posCursor:[88:16] posNoWhite:[88:15] Found expr:[85:4->90:14] posCursor:[88:16] posNoWhite:[88:15] Found expr:[88:7->90:14] posCursor:[88:16] posNoWhite:[88:15] Found expr:[88:7->88:16] Completable: Cpath Value[root]->ren -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[root]->ren ContextPath Value[root] Path root @@ -448,7 +464,8 @@ Pexp_apply ...[95:3->95:14] (...[95:15->0:-1]) posCursor:[95:20] posNoWhite:[95:19] Found expr:[95:15->0:-1] posCursor:[95:20] posNoWhite:[95:19] Found expr:[95:15->0:-1] Completable: Cpath Value[int]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[int]-> ContextPath Value[int] Path int @@ -479,7 +496,8 @@ posCursor:[98:21] posNoWhite:[98:20] Found expr:[98:3->98:22] Pexp_apply ...[98:3->98:14] (...[98:15->98:21]) posCursor:[98:21] posNoWhite:[98:20] Found expr:[98:15->98:21] Completable: Cpath Value[int]->t -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[int]->t ContextPath Value[int] Path int @@ -496,7 +514,8 @@ Path Integer.t Complete src/CompletionPipeChain.res 103:8 posCursor:[103:8] posNoWhite:[103:7] Found expr:[103:3->103:8] Completable: Cpath Value[r]->la -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[r]->la ContextPath Value[r] Path r @@ -513,7 +532,8 @@ Path Js.Re.la Complete src/CompletionPipeChain.res 112:7 posCursor:[112:7] posNoWhite:[112:6] Found expr:[112:3->0:-1] Completable: Cpath Value[xx]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[xx]-> ContextPath Value[xx] Path xx diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt index 9d93610741..2252b0554b 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt @@ -2,7 +2,8 @@ Complete src/CompletionPipeProperty.res 21:17 posCursor:[21:17] posNoWhite:[21:16] Found expr:[21:3->21:17] Pexp_field [21:3->21:16] _:[23:0->21:17] Completable: Cpath Value[sprite].anchor."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[sprite].anchor."" ContextPath Value[sprite].anchor ContextPath Value[sprite] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt index 71d2b79dbc..8e5d5b8de4 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt @@ -1,7 +1,8 @@ Complete src/CompletionPipeSubmodules.res 13:20 posCursor:[13:20] posNoWhite:[13:19] Found expr:[13:11->21:8] Completable: Cpath Value[A, B1, xx]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[A, B1, xx]-> ContextPath Value[A, B1, xx] Path A.B1.xx @@ -18,7 +19,8 @@ Path A.B1. Complete src/CompletionPipeSubmodules.res 17:18 posCursor:[17:18] posNoWhite:[17:17] Found expr:[17:11->21:8] Completable: Cpath Value[A, x].v-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[A, x].v-> ContextPath Value[A, x].v ContextPath Value[A, x] @@ -41,7 +43,8 @@ Path A.B1. Complete src/CompletionPipeSubmodules.res 41:20 posCursor:[41:20] posNoWhite:[41:19] Found expr:[41:11->0:-1] Completable: Cpath Value[E, e].v.v-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[E, e].v.v-> ContextPath Value[E, e].v.v ContextPath Value[E, e].v @@ -76,7 +79,8 @@ Path C. Complete src/CompletionPipeSubmodules.res 45:21 posCursor:[45:21] posNoWhite:[45:20] Found expr:[45:11->0:-1] Completable: Cpath Value[E, e].v.v2-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[E, e].v.v2-> ContextPath Value[E, e].v.v2 ContextPath Value[E, e].v diff --git a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt index 73f0090148..ce42cdebe0 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt @@ -1,7 +1,8 @@ Complete src/CompletionTaggedTemplate.res 11:20 posCursor:[11:20] posNoWhite:[11:19] Found expr:[11:11->0:-1] Completable: Cpath Value[meh](Nolabel, Nolabel)."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[meh](Nolabel, Nolabel)."" ContextPath Value[meh](Nolabel, Nolabel) ContextPath Value[meh] @@ -53,7 +54,8 @@ Path M. Complete src/CompletionTaggedTemplate.res 14:21 posCursor:[14:21] posNoWhite:[14:20] Found expr:[14:11->14:21] Completable: Cpath Value[meh](Nolabel, Nolabel).x -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[meh](Nolabel, Nolabel).x ContextPath Value[meh](Nolabel, Nolabel) ContextPath Value[meh] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt index 12df6fe3b8..8a30600d10 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt @@ -1,7 +1,8 @@ Complete src/CompletionTypeAnnotation.res 9:22 XXX Not found! Completable: Cexpression Type[someRecord] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someRecord] Path someRecord [{ @@ -18,7 +19,8 @@ Path someRecord Complete src/CompletionTypeAnnotation.res 12:24 XXX Not found! Completable: Cexpression Type[someRecord]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someRecord] Path someRecord [{ @@ -38,7 +40,8 @@ Path someRecord Complete src/CompletionTypeAnnotation.res 15:23 XXX Not found! Completable: Cexpression Type[someVariant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someVariant] Path someVariant [{ @@ -62,7 +65,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 18:25 XXX Not found! Completable: Cexpression Type[someVariant]=O -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someVariant] Path someVariant [{ @@ -75,53 +79,41 @@ Path someVariant "insertText": "One", "insertTextFormat": 2 }, { - "label": "Obj", + "label": "Option", "kind": 9, "tags": [], - "detail": "module Obj", - "documentation": null, - "data": { - "modulePath": "Obj", - "filePath": "src/CompletionTypeAnnotation.res" - } + "detail": "module Option", + "documentation": null }, { - "label": "Object", + "label": "Ordering", "kind": 9, "tags": [], - "detail": "module Object", - "documentation": null, - "data": { - "modulePath": "Object", - "filePath": "src/CompletionTypeAnnotation.res" - } + "detail": "module Ordering", + "documentation": null }, { - "label": "Objects", + "label": "Object", "kind": 9, "tags": [], - "detail": "module Objects", - "documentation": null, - "data": { - "modulePath": "Objects", - "filePath": "src/CompletionTypeAnnotation.res" - } + "detail": "module Object", + "documentation": null }, { - "label": "Option", + "label": "Obj", "kind": 9, "tags": [], - "detail": "module Option", + "detail": "module Obj", "documentation": null, "data": { - "modulePath": "Option", + "modulePath": "Obj", "filePath": "src/CompletionTypeAnnotation.res" } }, { - "label": "Ordering", + "label": "Objects", "kind": 9, "tags": [], - "detail": "module Ordering", + "detail": "module Objects", "documentation": null, "data": { - "modulePath": "Ordering", + "modulePath": "Objects", "filePath": "src/CompletionTypeAnnotation.res" } }] @@ -129,7 +121,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 21:27 XXX Not found! Completable: Cexpression Type[somePolyVariant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[somePolyVariant] Path somePolyVariant [{ @@ -153,7 +146,8 @@ Path somePolyVariant Complete src/CompletionTypeAnnotation.res 24:30 XXX Not found! Completable: Cexpression Type[somePolyVariant]=#o -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[somePolyVariant] Path somePolyVariant [{ @@ -169,7 +163,8 @@ Path somePolyVariant Complete src/CompletionTypeAnnotation.res 29:20 XXX Not found! Completable: Cexpression Type[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someFunc] Path someFunc [{ @@ -186,7 +181,8 @@ Path someFunc Complete src/CompletionTypeAnnotation.res 34:21 XXX Not found! Completable: Cexpression Type[someTuple] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someTuple] Path someTuple [{ @@ -202,7 +198,8 @@ Path someTuple Complete src/CompletionTypeAnnotation.res 37:28 XXX Not found! Completable: Cexpression Type[someTuple]->tuple($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[someTuple] Path someTuple [{ @@ -236,7 +233,8 @@ Path someTuple Complete src/CompletionTypeAnnotation.res 40:31 XXX Not found! Completable: Cexpression option -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath option ContextPath Type[someVariant] Path someVariant @@ -275,7 +273,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 43:37 XXX Not found! Completable: Cexpression option->variantPayload::Some($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath option ContextPath Type[someVariant] Path someVariant @@ -300,7 +299,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 46:30 XXX Not found! Completable: Cexpression array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath array ContextPath Type[someVariant] Path someVariant @@ -318,7 +318,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 49:32 XXX Not found! Completable: Cexpression array->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath array ContextPath Type[someVariant] Path someVariant @@ -343,7 +344,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 52:38 XXX Not found! Completable: Cexpression array> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath array> ContextPath option ContextPath Type[someVariant] @@ -362,7 +364,8 @@ Path someVariant Complete src/CompletionTypeAnnotation.res 55:45 XXX Not found! Completable: Cexpression option>->variantPayload::Some($0), array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath option> ContextPath array ContextPath Type[someVariant] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt index d4b015c969..0fdfa27260 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt @@ -1,21 +1,22 @@ Complete src/CompletionTypeT.res 4:26 XXX Not found! Completable: Cpattern Value[date] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[date] Path date [{ "label": "None", "kind": 12, "tags": [], - "detail": "Date.t", - "documentation": null + "detail": "Stdlib.Date.t", + "documentation": {"kind": "markdown", "value": "\nA type representing a JavaScript date.\n"} }, { "label": "Some(_)", "kind": 12, "tags": [], - "detail": "Date.t", - "documentation": null, + "detail": "Stdlib.Date.t", + "documentation": {"kind": "markdown", "value": "\nA type representing a JavaScript date.\n"}, "insertText": "Some(${1:_})", "insertTextFormat": 2 }, { @@ -31,80 +32,81 @@ Path date Complete src/CompletionTypeT.res 7:27 XXX Not found! Completable: Cexpression Type[withDate]->recordField(date) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[withDate] Path withDate [{ - "label": "Js.Date.makeWithYMD()", + "label": "Date.makeWithYMD()", "kind": 12, "tags": [], - "detail": "(~year: float, ~month: float, ~date: float, unit) => t", + "detail": "(~year: int, ~month: int, ~date: int) => t", "documentation": null, - "insertText": "Js.Date.makeWithYMD($0)", + "insertText": "Date.makeWithYMD($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.makeWithYMDHM()", + "label": "Date.makeWithYMDHM()", "kind": 12, "tags": [], - "detail": "(\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", + "detail": "(\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n) => t", "documentation": null, - "insertText": "Js.Date.makeWithYMDHM($0)", + "insertText": "Date.makeWithYMDHM($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.make()", + "label": "Date.make()", "kind": 12, "tags": [], "detail": "unit => t", "documentation": null, - "insertText": "Js.Date.make($0)", + "insertText": "Date.make($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.fromString()", + "label": "Date.fromTime()", "kind": 12, "tags": [], - "detail": "string => t", + "detail": "msSinceEpoch => t", "documentation": null, - "insertText": "Js.Date.fromString($0)", + "insertText": "Date.fromTime($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.fromFloat()", + "label": "Date.fromString()", "kind": 12, "tags": [], - "detail": "float => t", + "detail": "string => t", "documentation": null, - "insertText": "Js.Date.fromFloat($0)", + "insertText": "Date.fromString($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.parse()", + "label": "Date.makeWithYMDHMSM()", "kind": 12, "tags": [], - "detail": "string => t", + "detail": "(\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t", "documentation": null, - "insertText": "Js.Date.parse($0)", + "insertText": "Date.makeWithYMDHMSM($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.makeWithYM()", + "label": "Date.makeWithYM()", "kind": 12, "tags": [], - "detail": "(~year: float, ~month: float, unit) => t", + "detail": "(~year: int, ~month: int) => t", "documentation": null, - "insertText": "Js.Date.makeWithYM($0)", + "insertText": "Date.makeWithYM($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.makeWithYMDHMS()", + "label": "Date.makeWithYMDHMS()", "kind": 12, "tags": [], - "detail": "(\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", + "detail": "(\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t", "documentation": null, - "insertText": "Js.Date.makeWithYMDHMS($0)", + "insertText": "Date.makeWithYMDHMS($0)", "insertTextFormat": 2 }, { - "label": "Js.Date.makeWithYMDH()", + "label": "Date.makeWithYMDH()", "kind": 12, "tags": [], - "detail": "(\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", + "detail": "(~year: int, ~month: int, ~date: int, ~hours: int) => t", "documentation": null, - "insertText": "Js.Date.makeWithYMDH($0)", + "insertText": "Date.makeWithYMDH($0)", "insertTextFormat": 2 }] diff --git a/tests/analysis_tests/tests/src/expected/CreateInterface.res.txt b/tests/analysis_tests/tests/src/expected/CreateInterface.res.txt index 4e12129485..a5955f3081 100644 --- a/tests/analysis_tests/tests/src/expected/CreateInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/CreateInterface.res.txt @@ -66,7 +66,7 @@ module type FT = { let make: (~name: string) => React.element } } -module NormaList = List +module NormaList = Stdlib.List module BeltList = Belt.List module type MT2 = ModTyp module rec RM: ModTyp diff --git a/tests/analysis_tests/tests/src/expected/Cross.res.txt b/tests/analysis_tests/tests/src/expected/Cross.res.txt index be8e6a4ed6..9cbbdc6d99 100644 --- a/tests/analysis_tests/tests/src/expected/Cross.res.txt +++ b/tests/analysis_tests/tests/src/expected/Cross.res.txt @@ -97,7 +97,8 @@ Complete src/Cross.res 36:28 posCursor:[36:28] posNoWhite:[36:27] Found expr:[36:3->36:28] Pexp_ident DefinitionWithInterface.a:[36:3->36:28] Completable: Cpath Value[DefinitionWithInterface, a] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[DefinitionWithInterface, a] Path DefinitionWithInterface.a [] diff --git a/tests/analysis_tests/tests/src/expected/Debug.res.txt b/tests/analysis_tests/tests/src/expected/Debug.res.txt index e79d5485d9..f70ae60f0e 100644 --- a/tests/analysis_tests/tests/src/expected/Debug.res.txt +++ b/tests/analysis_tests/tests/src/expected/Debug.res.txt @@ -6,8 +6,8 @@ posCursor:[11:8] posNoWhite:[11:7] Found expr:[11:5->11:8] Pexp_ident eqN:[11:5->11:8] Completable: Cpath Value[eqN] Raw opens: 1 Js.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 Js +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib Js ContextPath Value[eqN] Path eqN [{ diff --git a/tests/analysis_tests/tests/src/expected/Definition.res.txt b/tests/analysis_tests/tests/src/expected/Definition.res.txt index 024a9d7ba6..4e2b514014 100644 --- a/tests/analysis_tests/tests/src/expected/Definition.res.txt +++ b/tests/analysis_tests/tests/src/expected/Definition.res.txt @@ -5,10 +5,10 @@ Definition src/Definition.res 10:23 {"uri": "Definition.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 6, "character": 13}}} Hover src/Definition.res 14:14 -{"contents": {"kind": "markdown", "value": "```rescript\n(List.t<'a>, 'a => 'b) => List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22List.res%22%2C34%2C0%5D)\n\n---\n\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) // list{3, 4}\n```\n"}} +{"contents": {"kind": "markdown", "value": "```rescript\n(Stdlib.List.t<'a>, 'a => 'b) => Stdlib.List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype Stdlib.List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Stdlib_List.resi%22%2C34%2C0%5D)\n\n---\n\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) // list{3, 4}\n```\n"}} Hover src/Definition.res 18:14 -{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, List.t<'a>) => List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22List.res%22%2C34%2C0%5D)\n"}} +{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, Stdlib.List.t<'a>) => Stdlib.List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype Stdlib.List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Stdlib_List.resi%22%2C34%2C0%5D)\n"}} Hover src/Definition.res 23:3 {"contents": {"kind": "markdown", "value": "```rescript\n(int, int) => int\n```"}} diff --git a/tests/analysis_tests/tests/src/expected/Destructuring.res.txt b/tests/analysis_tests/tests/src/expected/Destructuring.res.txt index 000a516af5..cd44272944 100644 --- a/tests/analysis_tests/tests/src/expected/Destructuring.res.txt +++ b/tests/analysis_tests/tests/src/expected/Destructuring.res.txt @@ -1,7 +1,8 @@ Complete src/Destructuring.res 4:11 posCursor:[4:11] posNoWhite:[4:9] Found pattern:[4:4->4:12] Completable: Cpattern Value[x]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ @@ -15,7 +16,8 @@ Path x Complete src/Destructuring.res 7:8 posCursor:[7:8] posNoWhite:[7:7] Found pattern:[7:7->7:9] Completable: Cpattern Value[x]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ @@ -37,7 +39,8 @@ posCursor:[11:13] posNoWhite:[11:11] Found expr:[10:8->14:1] posCursor:[11:13] posNoWhite:[11:11] Found expr:[11:2->13:6] posCursor:[11:13] posNoWhite:[11:11] Found pattern:[11:6->11:14] Completable: Cpattern Value[x]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ @@ -53,7 +56,8 @@ posCursor:[17:10] posNoWhite:[17:9] Found expr:[16:9->20:1] posCursor:[17:10] posNoWhite:[17:9] Found expr:[17:5->19:11] posCursor:[17:10] posNoWhite:[17:9] Found pattern:[17:9->17:11] Completable: Cpattern Value[x]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ @@ -73,7 +77,8 @@ Path x Complete src/Destructuring.res 31:8 posCursor:[31:8] posNoWhite:[31:7] Found pattern:[31:7->31:9] Completable: Cpattern Value[x]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x] Path x [{ diff --git a/tests/analysis_tests/tests/src/expected/Div.res.txt b/tests/analysis_tests/tests/src/expected/Div.res.txt index dd4336444a..1fb532b983 100644 --- a/tests/analysis_tests/tests/src/expected/Div.res.txt +++ b/tests/analysis_tests/tests/src/expected/Div.res.txt @@ -5,7 +5,8 @@ Complete src/Div.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:4->3:17] JSX 3:7] dangerous[3:8->3:17]=...[3:8->3:17]> _children:None Completable: Cjsx([div], dangerous, [dangerous]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path ReactDOM.domProps Path JsxDOM.domProps [{ diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index ae0244a611..3d8952608c 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -2,7 +2,8 @@ Complete src/DotPipeCompletionSpec.res 15:5 posCursor:[15:5] posNoWhite:[15:4] Found expr:[15:3->15:5] Pexp_field [15:3->15:4] _:[18:0->15:5] Completable: Cpath Value[n]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[n]."" ContextPath Value[n] Path n @@ -47,7 +48,8 @@ Complete src/DotPipeCompletionSpec.res 44:6 posCursor:[44:6] posNoWhite:[44:5] Found expr:[44:3->44:6] Pexp_field [44:3->44:5] _:[47:0->44:6] Completable: Cpath Value[nn]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[nn]."" ContextPath Value[nn] Path nn @@ -130,7 +132,8 @@ Complete src/DotPipeCompletionSpec.res 62:5 posCursor:[62:5] posNoWhite:[62:4] Found expr:[62:3->62:5] Pexp_field [62:3->62:4] _:[65:0->62:5] Completable: Cpath Value[a]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[a]."" ContextPath Value[a] Path a @@ -170,7 +173,8 @@ Complete src/DotPipeCompletionSpec.res 67:6 posCursor:[67:6] posNoWhite:[67:5] Found expr:[67:3->67:6] Pexp_field [67:3->67:5] _:[70:0->67:6] Completable: Cpath Value[xx]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[xx]."" ContextPath Value[xx] Path xx @@ -203,14 +207,15 @@ Complete src/DotPipeCompletionSpec.res 75:9 posCursor:[75:9] posNoWhite:[75:8] Found expr:[75:3->75:9] Pexp_field [75:3->75:7] u:[75:8->75:9] Completable: Cpath Value[ffff].u -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[ffff].u ContextPath Value[ffff] Path ffff ContextPath Value[ffff]->u ContextPath Value[ffff] Path ffff -Path Array.u +Path Stdlib.Array.u [{ "label": "->Array.unshiftMany", "kind": 12, @@ -253,7 +258,8 @@ Complete src/DotPipeCompletionSpec.res 80:7 posCursor:[80:7] posNoWhite:[80:6] Found expr:[80:3->80:7] Pexp_field [80:3->80:6] _:[84:0->80:7] Completable: Cpath Value[nnn]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[nnn]."" ContextPath Value[nnn] Path nnn @@ -312,7 +318,8 @@ posCursor:[86:39] posNoWhite:[86:38] Found expr:[86:3->86:39] posCursor:[86:39] posNoWhite:[86:38] Found expr:[86:9->86:39] Pexp_field [86:9->86:34] filt:[86:35->86:39] Completable: Cpath Value[Array, filter](Nolabel).filt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Array, filter](Nolabel).filt ContextPath Value[Array, filter](Nolabel) ContextPath Value[Array, filter] @@ -321,7 +328,7 @@ ContextPath Value[Array, filter](Nolabel, Nolabel)->filt ContextPath Value[Array, filter](Nolabel, Nolabel) ContextPath Value[Array, filter] Path Array.filter -Path Array.filt +Path Stdlib.Array.filt [{ "label": "->Array.filterMap", "kind": 12, @@ -365,7 +372,8 @@ posCursor:[89:62] posNoWhite:[89:61] Found expr:[89:3->89:62] posCursor:[89:62] posNoWhite:[89:61] Found expr:[89:36->89:62] Pexp_field [89:36->89:55] includ:[89:56->89:62] Completable: Cpath Value[Array, joinWith](Nolabel).includ -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Array, joinWith](Nolabel).includ ContextPath Value[Array, joinWith](Nolabel) ContextPath Value[Array, joinWith] @@ -374,7 +382,7 @@ ContextPath Value[Array, joinWith](Nolabel, Nolabel)->includ ContextPath Value[Array, joinWith](Nolabel, Nolabel) ContextPath Value[Array, joinWith] Path Array.joinWith -Path String.includ +Path Stdlib.String.includ [{ "label": "->String.includesFrom", "kind": 12, @@ -406,7 +414,8 @@ posCursor:[94:36] posNoWhite:[94:35] Found expr:[94:3->94:36] posCursor:[94:36] posNoWhite:[94:35] Found expr:[94:8->94:36] Pexp_field [94:8->94:26] toUpperCa:[94:27->94:36] Completable: Cpath Value[String, toLowerCase].toUpperCa -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[String, toLowerCase].toUpperCa ContextPath Value[String, toLowerCase] Path String.toLowerCase @@ -414,7 +423,7 @@ ContextPath Value[String, toLowerCase](Nolabel)->toUpperCa ContextPath Value[String, toLowerCase](Nolabel) ContextPath Value[String, toLowerCase] Path String.toLowerCase -Path String.toUpperCa +Path Stdlib.String.toUpperCa [{ "label": "->String.toUpperCase", "kind": 12, @@ -434,7 +443,8 @@ posCursor:[97:55] posNoWhite:[97:54] Found expr:[97:3->97:55] posCursor:[97:55] posNoWhite:[97:54] Found expr:[97:28->97:55] Pexp_field [97:28->97:46] toLowerC:[97:47->97:55] Completable: Cpath Value[String, toUpperCase].toLowerC -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[String, toUpperCase].toLowerC ContextPath Value[String, toUpperCase] Path String.toUpperCase @@ -442,7 +452,7 @@ ContextPath Value[String, toUpperCase](Nolabel)->toLowerC ContextPath Value[String, toUpperCase](Nolabel) ContextPath Value[String, toUpperCase] Path String.toUpperCase -Path String.toLowerC +Path Stdlib.String.toLowerC [{ "label": "->String.toLowerCase", "kind": 12, @@ -462,7 +472,8 @@ posCursor:[101:7] posNoWhite:[101:6] Found expr:[100:9->104:1] posCursor:[101:7] posNoWhite:[101:6] Found expr:[101:5->103:3] Pexp_field [101:5->101:6] t:[103:2->103:3] Completable: Cpath Value[t]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[t]."" ContextPath Value[t] Path t @@ -519,7 +530,8 @@ Path DotPipeCompletionSpec.SomeOtherModule. Complete src/DotPipeCompletionSpec.res 108:27 XXX Not found! Completable: Cpath Module[Dot] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[Dot] Path Dot [{ @@ -539,7 +551,8 @@ posCursor:[111:39] posNoWhite:[111:38] Found expr:[111:24->111:40] posCursor:[111:39] posNoWhite:[111:38] Found expr:[111:25->111:39] Pexp_construct CompletionPipe:[111:25->111:39] None Completable: Cpath Value[CompletionPipe] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[CompletionPipe] Path CompletionPipe [{ @@ -579,7 +592,8 @@ posCursor:[114:44] posNoWhite:[114:43] Found expr:[114:24->114:45] posCursor:[114:44] posNoWhite:[114:43] Found expr:[114:41->114:44] Pexp_construct Dot:[114:41->114:44] None Completable: Cpath Value[Dot] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Dot] Path Dot [{ @@ -598,7 +612,8 @@ Complete src/DotPipeCompletionSpec.res 122:11 posCursor:[122:11] posNoWhite:[122:10] Found expr:[122:3->122:11] Pexp_field [122:3->122:10] _:[128:0->122:11] Completable: Cpath Value[someObj]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someObj]."" ContextPath Value[someObj] Path someObj @@ -633,7 +648,8 @@ Complete src/DotPipeCompletionSpec.res 125:13 posCursor:[125:13] posNoWhite:[125:12] Found expr:[125:3->125:13] Pexp_field [125:3->125:10] na:[125:11->125:13] Completable: Cpath Value[someObj].na -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someObj].na ContextPath Value[someObj] Path someObj @@ -657,7 +673,8 @@ Complete src/DotPipeCompletionSpec.res 144:10 posCursor:[144:10] posNoWhite:[144:9] Found expr:[144:3->144:10] Pexp_field [144:3->144:9] _:[147:0->144:10] Completable: Cpath Value[button]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[button]."" ContextPath Value[button] Path button diff --git a/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt b/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt index 3fdaf5c010..04fcb8d2cf 100644 --- a/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt @@ -1,7 +1,8 @@ Complete src/EnvCompletion.res 10:17 XXX Not found! Completable: Cpattern Value[res] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -28,7 +29,8 @@ Ppat_construct Okay:[13:18->13:22] posCursor:[13:23] posNoWhite:[13:22] Found pattern:[13:22->13:24] Ppat_construct ():[13:22->13:24] Completable: Cpattern Value[res]->variantPayload::Okay($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -55,7 +57,8 @@ Ppat_construct Failure:[16:18->16:25] posCursor:[16:26] posNoWhite:[16:25] Found pattern:[16:25->16:27] Ppat_construct ():[16:25->16:27] Completable: Cpattern Value[res]->variantPayload::Failure($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -72,7 +75,8 @@ Path res Complete src/EnvCompletion.res 19:19 XXX Not found! Completable: Cpattern Value[use](Nolabel) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -90,7 +94,8 @@ Path use Complete src/EnvCompletion.res 22:21 posCursor:[22:21] posNoWhite:[22:20] Found pattern:[22:20->22:22] Completable: Cpattern Value[use](Nolabel)->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -111,7 +116,8 @@ Path use Complete src/EnvCompletion.res 25:27 posCursor:[25:27] posNoWhite:[25:26] Found pattern:[25:20->25:31] Completable: Cpattern Value[use](Nolabel)->recordField(stuff) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -140,7 +146,8 @@ Ppat_construct Second:[28:28->28:34] posCursor:[28:35] posNoWhite:[28:34] Found pattern:[28:34->28:36] Ppat_construct ():[28:34->28:36] Completable: Cpattern Value[use](Nolabel)->recordField(stuff), variantPayload::Second($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -161,7 +168,8 @@ posCursor:[31:36] posNoWhite:[31:35] Found pattern:[31:28->31:38] Ppat_construct Second:[31:28->31:34] posCursor:[31:36] posNoWhite:[31:35] Found pattern:[31:35->31:37] Completable: Cpattern Value[use](Nolabel)->recordField(stuff), variantPayload::Second($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -176,7 +184,8 @@ Path use Complete src/EnvCompletion.res 34:25 posCursor:[34:25] posNoWhite:[34:24] Found pattern:[34:20->34:29] Completable: Cpattern Value[use](Nolabel)->recordField(res) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -205,7 +214,8 @@ Ppat_construct Okay:[37:26->37:30] posCursor:[37:31] posNoWhite:[37:30] Found pattern:[37:30->37:32] Ppat_construct ():[37:30->37:32] Completable: Cpattern Value[use](Nolabel)->recordField(res), variantPayload::Okay($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -236,7 +246,8 @@ Ppat_construct Second:[40:31->40:37] posCursor:[40:38] posNoWhite:[40:37] Found pattern:[40:37->40:39] Ppat_construct ():[40:37->40:39] Completable: Cpattern Value[use](Nolabel)->recordField(res), variantPayload::Okay($0), variantPayload::Second($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -259,7 +270,8 @@ posCursor:[43:39] posNoWhite:[43:38] Found pattern:[43:31->43:41] Ppat_construct Second:[43:31->43:37] posCursor:[43:39] posNoWhite:[43:38] Found pattern:[43:38->43:40] Completable: Cpattern Value[use](Nolabel)->recordField(res), variantPayload::Okay($0), variantPayload::Second($0), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use @@ -274,7 +286,8 @@ Path use Complete src/EnvCompletion.res 52:18 XXX Not found! Completable: Cpattern Value[res2] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 [{ @@ -291,7 +304,8 @@ Path res2 Complete src/EnvCompletion.res 55:20 posCursor:[55:20] posNoWhite:[55:19] Found pattern:[55:19->55:21] Completable: Cpattern Value[res2]->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 [{ @@ -317,7 +331,8 @@ Path res2 Complete src/EnvCompletion.res 58:29 posCursor:[58:29] posNoWhite:[58:28] Found pattern:[58:19->58:33] Completable: Cpattern Value[res2]->recordField(theThing) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 [{ @@ -341,7 +356,8 @@ Path res2 Complete src/EnvCompletion.res 61:31 posCursor:[61:31] posNoWhite:[61:30] Found pattern:[61:19->61:35] Completable: Cpattern Value[res2]->recordField(theVariant) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 [{ diff --git a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt index 66dff588a4..e9e8d298ef 100644 --- a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt +++ b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt @@ -1,7 +1,8 @@ Complete src/ExhaustiveSwitch.res 8:24 XXX Not found! Completable: CexhaustiveSwitch Value[withSomeVarian] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[withSomeVarian] Path withSomeVarian [{ @@ -24,7 +25,8 @@ Path withSomeVarian Complete src/ExhaustiveSwitch.res 11:21 XXX Not found! Completable: CexhaustiveSwitch Value[withSomePol] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[withSomePol] Path withSomePol [{ @@ -47,7 +49,8 @@ Path withSomePol Complete src/ExhaustiveSwitch.res 14:17 XXX Not found! Completable: CexhaustiveSwitch Value[someBoo] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someBoo] Path someBoo [{ @@ -70,7 +73,8 @@ Path someBoo Complete src/ExhaustiveSwitch.res 17:16 XXX Not found! Completable: CexhaustiveSwitch Value[someOp] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someOp] Path someOp [{ @@ -94,23 +98,27 @@ Xform src/ExhaustiveSwitch.res 30:13 posCursor:[30:13] posNoWhite:[30:12] Found expr:[30:3->30:17] posCursor:[30:13] posNoWhite:[30:12] Found expr:[30:10->30:17] Completable: Cpath Value[x]-> -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x]-> ContextPath Value[x] Path x CPPipe pathFromEnv: found:true Path ExhaustiveSwitch. -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Xform src/ExhaustiveSwitch.res start: 33:3, end: 33:10 found selection: [33:3->33:10] -> [33:6->33:10] XXX Not found! Completable: Cpath Value[getV](Nolabel) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[getV](Nolabel) ContextPath Value[getV] Path getV -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Exhaustive switch TextDocumentEdit: ExhaustiveSwitch.res @@ -126,10 +134,12 @@ newText: Xform src/ExhaustiveSwitch.res 36:4 XXX Not found! Completable: Cpath Value[vvv] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[vvv] Path vvv -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Exhaustive switch TextDocumentEdit: ExhaustiveSwitch.res @@ -148,7 +158,8 @@ newText: Complete src/ExhaustiveSwitch.res 40:24 XXX Not found! Completable: CexhaustiveSwitch Value[withSomeVarian] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[withSomeVarian] Path withSomeVarian [{ diff --git a/tests/analysis_tests/tests/src/expected/Firebase.res.txt b/tests/analysis_tests/tests/src/expected/Firebase.res.txt index a6f55d6451..fcc05460e3 100644 --- a/tests/analysis_tests/tests/src/expected/Firebase.res.txt +++ b/tests/analysis_tests/tests/src/expected/Firebase.res.txt @@ -3,8 +3,8 @@ posCursor:[30:9] posNoWhite:[30:8] Found expr:[30:5->30:9] Pexp_field [30:5->30:8] _:[32:0->30:9] Completable: Cpath Value[ref]."" Raw opens: 1 Firebase.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 Firebase +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib Firebase ContextPath Value[ref]."" ContextPath Value[ref] Path ref @@ -29,7 +29,7 @@ Path Firebase.Firestore. "label": "->Firestore.getDoc", "kind": 12, "tags": [], - "detail": "documentReference<\n 'documentdata,\n> => Promise.t>", + "detail": "documentReference<\n 'documentdata,\n> => Stdlib.Promise.t>", "documentation": null, "sortText": "getDoc", "insertText": "->Firestore.getDoc", diff --git a/tests/analysis_tests/tests/src/expected/Fragment.res.txt b/tests/analysis_tests/tests/src/expected/Fragment.res.txt index c17fd7adc8..3b67cf3a42 100644 --- a/tests/analysis_tests/tests/src/expected/Fragment.res.txt +++ b/tests/analysis_tests/tests/src/expected/Fragment.res.txt @@ -10,7 +10,8 @@ JSX 9:26] > _children:9:26 posCursor:[9:56] posNoWhite:[9:55] Found expr:__ghost__[9:10->9:67] Pexp_construct []:__ghost__[9:10->9:67] None Completable: Cexpression CTypeAtPos()=[]->variantPayload::::($1) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTypeAtPos() null diff --git a/tests/analysis_tests/tests/src/expected/Hover.res.txt b/tests/analysis_tests/tests/src/expected/Hover.res.txt index a3ead7ce8b..8d692baed4 100644 --- a/tests/analysis_tests/tests/src/expected/Hover.res.txt +++ b/tests/analysis_tests/tests/src/expected/Hover.res.txt @@ -76,7 +76,8 @@ Hover src/Hover.res 122:3 Nothing at that position. Now trying to use completion. Attribute id:live:[122:0->122:5] label:live Completable: Cdecorator(live) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib {"contents": {"kind": "markdown", "value": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!"}} Hover src/Hover.res 125:4 @@ -107,7 +108,8 @@ Complete src/Hover.res 170:16 posCursor:[170:16] posNoWhite:[170:15] Found expr:[170:5->170:16] Pexp_field [170:5->170:15] _:[176:2->170:16] Completable: Cpath Value[x1].content."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x1].content."" ContextPath Value[x1].content ContextPath Value[x1] @@ -140,7 +142,8 @@ Complete src/Hover.res 173:16 posCursor:[173:16] posNoWhite:[173:15] Found expr:[173:5->173:16] Pexp_field [173:5->173:15] _:[176:2->173:16] Completable: Cpath Value[x2].content."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x2].content."" ContextPath Value[x2].content ContextPath Value[x2] @@ -173,7 +176,8 @@ Complete src/Hover.res 182:16 posCursor:[182:16] posNoWhite:[182:15] Found expr:[182:5->182:16] Pexp_field [182:5->182:15] _:[187:0->182:16] Completable: Cpath Value[y1].content."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[y1].content."" ContextPath Value[y1].content ContextPath Value[y1] @@ -206,7 +210,8 @@ Complete src/Hover.res 185:16 posCursor:[185:16] posNoWhite:[185:15] Found expr:[185:5->185:16] Pexp_field [185:5->185:15] _:[187:0->185:16] Completable: Cpath Value[y2].content."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[y2].content."" ContextPath Value[y2].content ContextPath Value[y2] @@ -246,10 +251,12 @@ Nothing at that position. Now trying to use completion. posCursor:[210:13] posNoWhite:[210:12] Found expr:[210:11->210:14] Pexp_ident usr:[210:11->210:14] Completable: Cpath Value[usr] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[usr] Path usr -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib {"contents": {"kind": "markdown", "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n"}} Hover src/Hover.res 230:20 @@ -263,7 +270,8 @@ Nothing at that position. Now trying to use completion. posCursor:[245:6] posNoWhite:[245:5] Found expr:[245:3->245:14] Pexp_field [245:3->245:4] someField:[245:5->245:14] Completable: Cpath Value[x].someField -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x].someField ContextPath Value[x] Path x @@ -272,7 +280,8 @@ ContextPath Value[x] Path x CPPipe pathFromEnv: found:true Path Hover.someField -Package opens Pervasives.JsxModules.place holder +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```"}} Hover src/Hover.res 248:19 @@ -286,10 +295,12 @@ Nothing at that position. Now trying to use completion. posCursor:[257:23] posNoWhite:[257:22] Found expr:[257:22->257:25] Pexp_ident fff:[257:22->257:25] Completable: Cpath Value[fff] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fff] Path fff -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath string {"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} @@ -298,10 +309,12 @@ Nothing at that position. Now trying to use completion. posCursor:[260:33] posNoWhite:[260:32] Found expr:[260:31->260:40] Pexp_ident someField:[260:31->260:40] Completable: Cpath Value[someField] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someField] Path someField -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CPatternPath(Value[x])->recordField(someField) ContextPath Value[x] Path x diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt index b88345193c..87e09267cf 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt @@ -5,7 +5,8 @@ Complete src/Jsx2.res 8:15 posCursor:[8:15] posNoWhite:[8:14] Found expr:[8:4->8:15] JSX 8:5] second[8:6->8:12]=...[8:13->8:15]> _children:None Completable: Cexpression CJsxPropValue [M] second=fi -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [M] second Path M.make [] @@ -14,7 +15,8 @@ Complete src/Jsx2.res 11:20 posCursor:[11:20] posNoWhite:[11:19] Found expr:[11:4->11:20] JSX 11:5] second[11:6->11:12]=...[11:13->11:18] f[11:19->11:20]=...[11:19->11:20]> _children:None Completable: Cjsx([M], f, [second, f]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "first", @@ -34,7 +36,8 @@ Complete src/Jsx2.res 14:13 posCursor:[14:13] posNoWhite:[14:12] Found expr:[14:12->14:13] JSX 14:13] > _children:None Completable: Cpath Module[M] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[M] Path M [{ @@ -44,25 +47,17 @@ Path M "detail": "module M", "documentation": null }, { - "label": "Map", + "label": "Math", "kind": 9, "tags": [], - "detail": "module Map", - "documentation": null, - "data": { - "modulePath": "Map", - "filePath": "src/Jsx2.res" - } + "detail": "module Math", + "documentation": null }, { - "label": "Math", + "label": "Map", "kind": 9, "tags": [], - "detail": "module Math", - "documentation": null, - "data": { - "modulePath": "Math", - "filePath": "src/Jsx2.res" - } + "detail": "module Map", + "documentation": null }, { "label": "ModuleStuff", "kind": 9, @@ -79,7 +74,8 @@ Complete src/Jsx2.res 22:19 posCursor:[22:19] posNoWhite:[22:18] Found expr:[22:4->22:19] JSX 22:5] prop[22:6->22:10]=...[22:12->22:16] k[22:18->22:19]=...[22:18->22:19]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -93,7 +89,8 @@ Complete src/Jsx2.res 25:17 posCursor:[25:17] posNoWhite:[25:16] Found expr:[25:4->25:17] JSX 25:5] prop[25:6->25:10]=...[25:11->25:15] k[25:16->25:17]=...[25:16->25:17]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -107,7 +104,8 @@ Complete src/Jsx2.res 28:21 posCursor:[28:21] posNoWhite:[28:20] Found expr:[28:4->28:21] JSX 28:5] prop[28:6->28:10]=...[28:11->28:19] k[28:20->28:21]=...[28:20->28:21]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -121,7 +119,8 @@ Complete src/Jsx2.res 31:24 posCursor:[31:24] posNoWhite:[31:23] Found expr:[31:4->31:24] JSX 31:5] prop[31:6->31:10]=...[31:11->31:22] k[31:23->31:24]=...[31:23->31:24]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -135,7 +134,8 @@ Complete src/Jsx2.res 34:18 posCursor:[34:18] posNoWhite:[34:17] Found expr:[34:4->34:18] JSX 34:5] prop[34:6->34:10]=...[34:12->34:16] k[34:17->34:18]=...[34:17->34:18]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -149,7 +149,8 @@ Complete src/Jsx2.res 37:16 posCursor:[37:16] posNoWhite:[37:15] Found expr:[37:4->37:16] JSX 37:5] prop[37:6->37:10]=...[37:11->37:14] k[37:15->37:16]=...[37:15->37:16]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -163,7 +164,8 @@ Complete src/Jsx2.res 40:17 posCursor:[40:17] posNoWhite:[40:16] Found expr:[40:4->40:17] JSX 40:5] prop[40:6->40:10]=...[40:11->40:15] k[40:16->40:17]=...[40:16->40:17]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -177,7 +179,8 @@ Complete src/Jsx2.res 43:18 posCursor:[43:18] posNoWhite:[43:17] Found expr:[43:4->43:18] JSX 43:5] prop[43:6->43:10]=...[43:11->43:16] k[43:17->43:18]=...[43:17->43:18]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -191,7 +194,8 @@ Complete src/Jsx2.res 46:16 posCursor:[46:16] posNoWhite:[46:15] Found expr:[46:4->46:16] JSX 46:5] prop[46:6->46:10]=...[46:11->46:14] k[46:15->46:16]=...[46:15->46:16]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -205,7 +209,8 @@ Complete src/Jsx2.res 49:27 posCursor:[49:27] posNoWhite:[49:26] Found expr:[49:4->49:27] JSX 49:5] prop[49:6->49:10]=...[49:11->49:25] k[49:26->49:27]=...[49:26->49:27]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -219,7 +224,8 @@ Complete src/Jsx2.res 52:38 posCursor:[52:38] posNoWhite:[52:37] Found expr:[52:4->52:38] JSX 52:5] prop[52:6->52:10]=...[52:11->52:36] k[52:37->52:38]=...[52:37->52:38]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -233,7 +239,8 @@ Complete src/Jsx2.res 55:25 posCursor:[55:25] posNoWhite:[55:24] Found expr:[55:4->55:25] JSX 55:5] prop[55:6->55:10]=...[55:11->55:23] k[55:24->55:25]=...[55:24->55:25]> _children:None Completable: Cjsx([M], k, [prop, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -250,7 +257,8 @@ Complete src/Jsx2.res 68:10 posCursor:[68:10] posNoWhite:[68:9] Found expr:[68:4->68:10] JSX 68:7] al[68:8->68:10]=...[68:8->68:10]> _children:None Completable: Cjsx([Ext], al, [al]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path Ext.make [{ "label": "align", @@ -264,7 +272,8 @@ Complete src/Jsx2.res 71:11 posCursor:[71:11] posNoWhite:[71:10] Found expr:[71:4->71:11] JSX 71:5] first[71:6->71:11]=...[71:6->71:11]> _children:None Completable: Cjsx([M], first, [first]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [] @@ -272,7 +281,8 @@ Complete src/Jsx2.res 74:16 posCursor:[74:16] posNoWhite:[74:15] Found expr:[74:4->74:16] JSX 74:5] first[74:6->74:11]=...[74:12->74:14] k[74:15->74:16]=...[74:15->74:16]> _children:None Completable: Cjsx([M], k, [first, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -286,7 +296,8 @@ Complete src/Jsx2.res 77:23 posCursor:[77:23] posNoWhite:[77:22] Found expr:[77:4->77:23] JSX 77:5] first[77:6->77:11]=...[77:19->77:21] k[77:22->77:23]=...[77:22->77:23]> _children:None Completable: Cjsx([M], k, [first, k]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M.make [{ "label": "key", @@ -315,7 +326,8 @@ Complete src/Jsx2.res 89:16 posCursor:[89:16] posNoWhite:[89:15] Found expr:[89:4->89:16] JSX 89:16] > _children:None Completable: Cpath Module[WithChildren] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren [{ @@ -330,7 +342,8 @@ Complete src/Jsx2.res 91:18 posCursor:[91:18] posNoWhite:[91:17] Found expr:[91:4->91:18] JSX 91:16] n[91:17->91:18]=...[91:17->91:18]> _children:None Completable: Cjsx([WithChildren], n, [n]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path WithChildren.make [{ "label": "name", @@ -345,7 +358,8 @@ posCursor:[94:18] posNoWhite:[94:17] Found pattern:[94:7->94:18] posCursor:[94:18] posNoWhite:[94:17] Found type:[94:11->94:18] Ptyp_constr React.e:[94:11->94:18] Completable: Cpath Type[React, e] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e [{ @@ -361,7 +375,8 @@ posCursor:[96:20] posNoWhite:[96:19] Found pattern:[96:7->99:6] posCursor:[96:20] posNoWhite:[96:19] Found type:[96:11->99:6] Ptyp_constr ReactDOMR:[96:11->99:6] Completable: Cpath Type[ReactDOMR] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[ReactDOMR] Path ReactDOMR [{ @@ -382,7 +397,8 @@ Pexp_apply ...[102:15->102:16] (...[102:13->102:14], ...[102:17->102:21]) posCursor:[102:21] posNoWhite:[102:20] Found expr:[102:17->102:21] Pexp_field [102:17->102:18] th:[102:19->102:21] Completable: Cpath Value[x].th -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[x].th ContextPath Value[x] Path x @@ -392,7 +408,8 @@ Complete src/Jsx2.res 106:28 posCursor:[106:28] posNoWhite:[106:27] Found expr:[106:11->106:28] Pexp_ident DefineSomeFields.:[106:11->106:28] Completable: Cpath Value[DefineSomeFields, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[DefineSomeFields, ""] Path DefineSomeFields. [{ @@ -409,7 +426,8 @@ Pexp_apply ...[108:13->108:14] (...[108:11->108:12], ...[108:15->108:36]) posCursor:[108:36] posNoWhite:[108:35] Found expr:[108:15->108:36] Pexp_field [108:15->108:16] DefineSomeFields.th:[108:17->108:36] Completable: Cpath Module[DefineSomeFields].th -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[DefineSomeFields].th Path DefineSomeFields.th [{ @@ -432,7 +450,8 @@ JSX 121:6] x[122:5->122:6]=...[122:7->122:20] name[124:4->124:8]=.. posCursor:[122:20] posNoWhite:[122:19] Found expr:[122:7->122:20] Pexp_ident Outer.Inner.h:[122:7->122:20] Completable: Cpath Value[Outer, Inner, h] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, h] Path Outer.Inner.h [{ @@ -449,7 +468,8 @@ JSX 128:6] x[129:5->129:6]=...[129:7->131:8]> _children:None posCursor:[129:19] posNoWhite:[129:18] Found expr:[129:7->131:8] Pexp_ident Outer.Inner.:[129:7->131:8] Completable: Cpath Value[Outer, Inner, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, ""] Path Outer.Inner. [{ @@ -464,7 +484,8 @@ Complete src/Jsx2.res 136:7 posCursor:[136:7] posNoWhite:[136:6] Found expr:[135:3->138:9] JSX 135:6] x[136:5->136:6]=...[138:4->138:8]> _children:None Completable: Cexpression CJsxPropValue [div] x -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] x Path ReactDOM.domProps Path JsxDOM.domProps @@ -483,7 +504,8 @@ Complete src/Jsx2.res 150:21 posCursor:[150:21] posNoWhite:[150:20] Found expr:[150:12->150:32] JSX 150:21] name[150:22->150:26]=...[150:27->150:29]> _children:150:30 Completable: Cpath Module[Nested, Co] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[Nested, Co] Path Nested.Co [{ @@ -498,7 +520,8 @@ Complete src/Jsx2.res 153:19 posCursor:[153:19] posNoWhite:[153:18] Found expr:[153:12->153:25] JSX 153:24] > _children:None Completable: Cpath Module[Nested, ""] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[Nested, ""] Path Nested. [{ @@ -516,7 +539,8 @@ posCursor:[162:12] posNoWhite:[162:11] Found expr:[162:6->162:21] posCursor:[162:12] posNoWhite:[162:11] Found expr:[162:6->162:20] JSX 162:10] age[162:11->162:14]=...[162:15->162:17]> _children:162:18 Completable: Cjsx([Comp], age, [age]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path Comp.make {"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} @@ -529,7 +553,8 @@ posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:10->167:25] posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:10->167:24] JSX 167:14] age[167:15->167:18]=...[167:19->167:21]> _children:167:22 Completable: Cjsx([Comp], age, [age]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path Comp.make {"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt b/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt index 97d8216b91..c34ab6fca5 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt @@ -8,7 +8,8 @@ Complete src/Jsx2.resi 7:19 posCursor:[7:19] posNoWhite:[7:18] Found type:[7:12->7:19] Ptyp_constr React.e:[7:12->7:19] Completable: Cpath Type[React, e] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e [{ @@ -23,7 +24,8 @@ Complete src/Jsx2.resi 10:18 posCursor:[10:18] posNoWhite:[10:17] Found type:[10:11->10:18] Ptyp_constr React.e:[10:11->10:18] Completable: Cpath Type[React, e] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e [{ diff --git a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt index 8a1abb7796..cca05ca41c 100644 --- a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt +++ b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt @@ -5,7 +5,8 @@ Complete src/JsxV4.res 11:20 posCursor:[11:20] posNoWhite:[11:19] Found expr:[11:4->11:20] JSX 11:6] first[11:7->11:12]=...[11:13->11:18] f[11:19->11:20]=...[11:19->11:20]> _children:None Completable: Cjsx([M4], f, [first, f]) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Path M4.make [{ "label": "fun", diff --git a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt index 5b94263443..7673dc6c9a 100644 --- a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt @@ -1,7 +1,8 @@ Complete src/RecordCompletion.res 8:9 posCursor:[8:9] posNoWhite:[8:8] Found expr:[8:3->8:9] Completable: Cpath Value[t].n->m -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[t].n->m ContextPath Value[t].n ContextPath Value[t] @@ -11,7 +12,7 @@ ContextPath Value[t] Path t CPPipe pathFromEnv: found:true Path RecordCompletion.n -Path Array.m +Path Stdlib.Array.m [{ "label": "Array.map", "kind": 12, @@ -29,7 +30,8 @@ Path Array.m Complete src/RecordCompletion.res 11:13 posCursor:[11:13] posNoWhite:[11:12] Found expr:[11:3->11:13] Completable: Cpath Value[t2].n2.n->m -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[t2].n2.n->m ContextPath Value[t2].n2.n ContextPath Value[t2].n2 @@ -51,7 +53,7 @@ CPPipe pathFromEnv: found:true Path RecordCompletion.n2 CPPipe pathFromEnv: found:true Path RecordCompletion.n -Path Array.m +Path Stdlib.Array.m [{ "label": "Array.map", "kind": 12, @@ -70,7 +72,8 @@ Complete src/RecordCompletion.res 19:7 posCursor:[19:7] posNoWhite:[19:6] Found expr:[19:3->19:7] Pexp_field [19:3->19:4] R.:[19:5->19:7] Completable: Cpath Module[R]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. [{ @@ -85,7 +88,8 @@ Complete src/RecordCompletion.res 22:7 posCursor:[22:7] posNoWhite:[22:6] Found expr:[22:3->22:10] Pexp_field [22:3->22:4] R.xx:[22:5->22:10] Completable: Cpath Module[R]."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. [{ diff --git a/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt b/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt index bb85ebdca0..2dc24193b4 100644 --- a/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt @@ -11,10 +11,17 @@ posCursor:[6:26] posNoWhite:[6:25] Found pattern:[6:20->8:5] posCursor:[6:26] posNoWhite:[6:25] Found type:[6:23->8:5] Ptyp_constr Res:[6:23->8:5] Completable: Cpath Type[Res] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Type[Res] Path Res [{ + "label": "Result", + "kind": 9, + "tags": [], + "detail": "module Result", + "documentation": null + }, { "label": "RescriptReactErrorBoundary", "kind": 9, "tags": [], @@ -54,15 +61,5 @@ Path Res "modulePath": "RescriptTools_Docgen", "filePath": "src/RecoveryOnProp.res" } - }, { - "label": "Result", - "kind": 9, - "tags": [], - "detail": "module Result", - "documentation": null, - "data": { - "modulePath": "Result", - "filePath": "src/RecoveryOnProp.res" - } }] diff --git a/tests/analysis_tests/tests/src/expected/Reprod.res.txt b/tests/analysis_tests/tests/src/expected/Reprod.res.txt index bbe3d02558..08783543a5 100644 --- a/tests/analysis_tests/tests/src/expected/Reprod.res.txt +++ b/tests/analysis_tests/tests/src/expected/Reprod.res.txt @@ -2,7 +2,8 @@ Complete src/Reprod.res 7:53 posCursor:[7:53] posNoWhite:[7:52] Found expr:[7:11->7:56] Pexp_apply ...[7:11->7:20] (~variables7:22->7:31=...[7:32->7:55]) Completable: Cexpression CArgument Value[Query, use](~variables)->recordField(location), variantPayload::ByAddress($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CArgument Value[Query, use](~variables) ContextPath Value[Query, use] Path Query.use @@ -20,7 +21,8 @@ Path Query.use Complete src/Reprod.res 33:28 posCursor:[33:28] posNoWhite:[33:27] Found pattern:[33:21->33:31] Completable: Cpattern Value[record]->recordField(first) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[record] Path record [{ @@ -52,7 +54,8 @@ Path record Complete src/Reprod.res 36:29 posCursor:[36:29] posNoWhite:[36:28] Found pattern:[36:21->36:32] Completable: Cpattern Value[record]->recordField(second) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[record] Path record [{ @@ -72,7 +75,8 @@ Ppat_construct Ok:[43:18->43:20] posCursor:[43:21] posNoWhite:[43:20] Found pattern:[43:20->43:22] Ppat_construct ():[43:20->43:22] Completable: Cpattern Value[res]->variantPayload::Ok($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -107,7 +111,8 @@ Ppat_construct Error:[46:18->46:23] posCursor:[46:24] posNoWhite:[46:23] Found pattern:[46:23->46:25] Ppat_construct ():[46:23->46:25] Completable: Cpattern Value[res]->variantPayload::Error($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[res] Path res [{ @@ -142,7 +147,8 @@ Ppat_construct Ok:[51:21->51:23] posCursor:[51:24] posNoWhite:[51:23] Found pattern:[51:23->51:25] Ppat_construct ():[51:23->51:25] Completable: Cpattern Value[resOpt]->variantPayload::Ok($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[resOpt] Path resOpt [{ @@ -193,7 +199,8 @@ Ppat_construct Some:[54:24->54:28] posCursor:[54:29] posNoWhite:[54:28] Found pattern:[54:28->54:30] Ppat_construct ():[54:28->54:30] Completable: Cpattern Value[resOpt]->variantPayload::Ok($0), variantPayload::Some($0) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[resOpt] Path resOpt [{ diff --git a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt index 8e1af01752..5c6f8fb4be 100644 --- a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt @@ -8,8 +8,8 @@ posCursor:[26:29] posNoWhite:[26:28] Found expr:[26:7->26:29] Pexp_field [26:7->26:28] _:[30:2->26:29] Completable: Cpath Value[merge](Nolabel, Nolabel)."" Raw opens: 1 Rxjs.place holder -Package opens Pervasives.JsxModules.place holder -Resolved opens 1 Rxjs +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 2 Stdlib Rxjs ContextPath Value[merge](Nolabel, Nolabel)."" ContextPath Value[merge](Nolabel, Nolabel) ContextPath Value[merge] @@ -90,7 +90,8 @@ posCursor:[34:30] posNoWhite:[34:29] Found expr:[32:2->34:30] posCursor:[34:30] posNoWhite:[34:29] Found expr:[34:5->34:30] Pexp_field [34:5->34:29] _:[38:0->34:30] Completable: Cpath Value[Rxjs, combineLatest](Nolabel, Nolabel)."" -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Rxjs, combineLatest](Nolabel, Nolabel)."" ContextPath Value[Rxjs, combineLatest](Nolabel, Nolabel) ContextPath Value[Rxjs, combineLatest] diff --git a/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt b/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt index 3c546a4318..f6a030bcaf 100644 --- a/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt +++ b/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt @@ -4,7 +4,8 @@ Pexp_apply ...[16:11->16:19] (...[46:0->16:20]) posCursor:[16:19] posNoWhite:[16:18] Found expr:[16:11->16:19] Pexp_ident someFunc:[16:11->16:19] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: unlabelled<0> @@ -27,7 +28,8 @@ Pexp_apply ...[19:11->19:19] (...[19:20->19:21]) posCursor:[19:19] posNoWhite:[19:18] Found expr:[19:11->19:19] Pexp_ident someFunc:[19:11->19:19] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: unlabelled<0> @@ -50,7 +52,8 @@ Pexp_apply ...[22:11->22:19] (...[22:20->22:23], ~two22:26->22:29=...[22:26->22: posCursor:[22:19] posNoWhite:[22:18] Found expr:[22:11->22:19] Pexp_ident someFunc:[22:11->22:19] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: ~two @@ -73,7 +76,8 @@ Pexp_apply ...[25:11->25:19] (...[25:20->25:23], ~two25:26->25:29=...[25:30->25: posCursor:[25:19] posNoWhite:[25:18] Found expr:[25:11->25:19] Pexp_ident someFunc:[25:11->25:19] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: ~two @@ -96,7 +100,8 @@ Pexp_apply ...[28:11->28:19] (...[28:20->28:23], ~two28:26->28:29=...[28:30->28: posCursor:[28:19] posNoWhite:[28:18] Found expr:[28:11->28:19] Pexp_ident someFunc:[28:11->28:19] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: ~four @@ -119,7 +124,8 @@ Pexp_apply ...[31:11->31:19] (...[31:20->31:23], ~two31:26->31:29=...[31:30->31: posCursor:[31:19] posNoWhite:[31:18] Found expr:[31:11->31:19] Pexp_ident someFunc:[31:11->31:19] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: ~four @@ -142,7 +148,8 @@ Pexp_apply ...[34:11->34:20] (...[46:0->34:21]) posCursor:[34:20] posNoWhite:[34:19] Found expr:[34:11->34:20] Pexp_ident otherFunc:[34:11->34:20] Completable: Cpath Value[otherFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<0> @@ -163,7 +170,8 @@ Pexp_apply ...[37:11->37:20] (...[37:21->37:26]) posCursor:[37:20] posNoWhite:[37:19] Found expr:[37:11->37:20] Pexp_ident otherFunc:[37:11->37:20] Completable: Cpath Value[otherFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<0> @@ -184,7 +192,8 @@ Pexp_apply ...[40:11->40:20] (...[40:21->40:26], ...[40:28->40:31], ...[40:33->4 posCursor:[40:20] posNoWhite:[40:19] Found expr:[40:11->40:20] Pexp_ident otherFunc:[40:11->40:20] Completable: Cpath Value[otherFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<2> @@ -205,7 +214,8 @@ Pexp_apply ...[43:11->43:29] (~age43:31->43:34=...[43:31->43:34]) posCursor:[43:29] posNoWhite:[43:28] Found expr:[43:11->43:29] Pexp_ident Completion.Lib.foo:[43:11->43:29] Completable: Cpath Value[Completion, Lib, foo] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[Completion, Lib, foo] Path Completion.Lib.foo argAtCursor: ~age @@ -226,7 +236,8 @@ Pexp_apply ...[50:11->50:23] (...[56:0->50:24]) posCursor:[50:23] posNoWhite:[50:22] Found expr:[50:11->50:23] Pexp_ident iAmSoSpecial:[50:11->50:23] Completable: Cpath Value[iAmSoSpecial] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[iAmSoSpecial] Path iAmSoSpecial argAtCursor: unlabelled<0> @@ -248,7 +259,8 @@ Pexp_apply ...[53:20->53:29] (...[53:30->53:31]) posCursor:[53:29] posNoWhite:[53:28] Found expr:[53:20->53:29] Pexp_ident otherFunc:[53:20->53:29] Completable: Cpath Value[otherFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<1> @@ -269,7 +281,8 @@ Pexp_apply ...[62:11->62:13] (...[62:14->62:16]) posCursor:[62:13] posNoWhite:[62:12] Found expr:[62:11->62:13] Pexp_ident fn:[62:11->62:13] Completable: Cpath Value[fn] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fn] Path fn argAtCursor: unlabelled<1> @@ -290,7 +303,8 @@ Pexp_apply ...[65:11->65:13] (...[65:14->65:16], ...[65:20->65:24]) posCursor:[65:13] posNoWhite:[65:12] Found expr:[65:11->65:13] Pexp_ident fn:[65:11->65:13] Completable: Cpath Value[fn] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fn] Path fn argAtCursor: unlabelled<1> @@ -311,7 +325,8 @@ Pexp_apply ...[68:11->68:13] (...[68:14->68:16], ...[68:18->68:25]) posCursor:[68:13] posNoWhite:[68:12] Found expr:[68:11->68:13] Pexp_ident fn:[68:11->68:13] Completable: Cpath Value[fn] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[fn] Path fn argAtCursor: unlabelled<2> @@ -334,7 +349,8 @@ Pexp_apply ...[71:16->71:28] (...[71:29->71:30]) posCursor:[71:28] posNoWhite:[71:27] Found expr:[71:16->71:28] Pexp_ident iAmSoSpecial:[71:16->71:28] Completable: Cpath Value[iAmSoSpecial] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[iAmSoSpecial] Path iAmSoSpecial argAtCursor: unlabelled<0> @@ -359,7 +375,8 @@ Pexp_apply ...[74:31->74:39] (...[74:40->74:41]) posCursor:[74:39] posNoWhite:[74:38] Found expr:[74:31->74:39] Pexp_ident someFunc:[74:31->74:39] Completable: Cpath Value[someFunc] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[someFunc] Path someFunc argAtCursor: unlabelled<0> diff --git a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt index 62940941cb..be53ba25ba 100644 --- a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt @@ -3,7 +3,8 @@ posCursor:[7:36] posNoWhite:[7:35] Found pattern:[7:26->7:39] Ppat_construct Ok:[7:26->7:28] posCursor:[7:36] posNoWhite:[7:35] Found pattern:[7:29->7:38] Completable: Cpattern Value[catchResult]->variantPayload::Ok($0), recordField(value) -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[catchResult] Path catchResult [{ diff --git a/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt b/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt index 1d6de28853..499d5fa4b1 100644 --- a/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt @@ -1,7 +1,8 @@ Complete src/TypeAtPosCompletion.res 7:17 posCursor:[7:17] posNoWhite:[7:15] Found expr:[6:16->9:1] Completable: Cexpression CTypeAtPos()->recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTypeAtPos() [{ "label": "age", @@ -22,7 +23,8 @@ posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:8->19:1] Pexp_construct One:[13:8->13:11] [13:11->19:1] posCursor:[16:18] posNoWhite:[16:16] Found expr:[15:2->18:3] Completable: Cexpression CTypeAtPos()->variantPayload::One($1), recordBody -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTypeAtPos() [{ "label": "age", @@ -41,7 +43,8 @@ ContextPath CTypeAtPos() Complete src/TypeAtPosCompletion.res 22:12 posCursor:[22:12] posNoWhite:[22:11] Found expr:[21:10->24:1] Completable: Cexpression CTypeAtPos()->array -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath CTypeAtPos() [{ "label": "{}", diff --git a/tests/analysis_tests/tests/src/expected/Xform.res.txt b/tests/analysis_tests/tests/src/expected/Xform.res.txt index fec60ff18b..606adcdd07 100644 --- a/tests/analysis_tests/tests/src/expected/Xform.res.txt +++ b/tests/analysis_tests/tests/src/expected/Xform.res.txt @@ -1,10 +1,12 @@ Xform src/Xform.res 6:5 posCursor:[6:3] posNoWhite:[6:1] Found expr:[6:0->11:1] Completable: Cpath Value[kind] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[kind] Path kind -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Replace with switch TextDocumentEdit: Xform.res @@ -120,10 +122,12 @@ newText: Xform src/Xform.res 48:21 posCursor:[48:21] posNoWhite:[48:19] Found expr:[48:15->48:25] Completable: Cpath Value[name] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[name] Path name -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Add braces to function TextDocumentEdit: Xform.res @@ -187,10 +191,12 @@ newText: Xform src/Xform.res 80:4 posCursor:[78:16] posNoWhite:[78:14] Found expr:[78:9->82:1] Completable: Cpath Value[variant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[variant] Path variant -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -202,10 +208,12 @@ newText: Xform src/Xform.res 86:4 posCursor:[84:16] posNoWhite:[84:14] Found expr:[84:9->88:1] Completable: Cpath Value[variant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[variant] Path variant -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -217,10 +225,12 @@ newText: Xform src/Xform.res 93:4 posCursor:[90:16] posNoWhite:[90:14] Found expr:[90:9->95:1] Completable: Cpath Value[variant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[variant] Path variant -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -232,10 +242,12 @@ newText: Xform src/Xform.res 101:4 posCursor:[99:16] posNoWhite:[99:14] Found expr:[99:9->103:1] Completable: Cpath Value[polyvariant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[polyvariant] Path polyvariant -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -247,10 +259,12 @@ newText: Xform src/Xform.res 107:4 posCursor:[105:16] posNoWhite:[105:14] Found expr:[105:9->109:1] Completable: Cpath Value[polyvariant] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[polyvariant] Path polyvariant -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -262,10 +276,12 @@ newText: Xform src/Xform.res 115:4 posCursor:[113:16] posNoWhite:[113:14] Found expr:[113:9->117:1] Completable: Cpath Value[variantOpt] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[variantOpt] Path variantOpt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -277,10 +293,12 @@ newText: Xform src/Xform.res 121:4 posCursor:[119:16] posNoWhite:[119:14] Found expr:[119:9->123:1] Completable: Cpath Value[variantOpt] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[variantOpt] Path variantOpt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -292,10 +310,12 @@ newText: Xform src/Xform.res 127:4 posCursor:[125:16] posNoWhite:[125:14] Found expr:[125:9->129:1] Completable: Cpath Value[variantOpt] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[variantOpt] Path variantOpt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -307,10 +327,12 @@ newText: Xform src/Xform.res 136:4 posCursor:[133:16] posNoWhite:[133:14] Found expr:[133:9->138:1] Completable: Cpath Value[polyvariantOpt] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[polyvariantOpt] Path polyvariantOpt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res @@ -322,10 +344,12 @@ newText: Xform src/Xform.res 142:4 posCursor:[140:16] posNoWhite:[140:14] Found expr:[140:9->144:1] Completable: Cpath Value[polyvariantOpt] -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib ContextPath Value[polyvariantOpt] Path polyvariantOpt -Package opens Pervasives.JsxModules.place holder +Package opens Stdlib.place holder Pervasives.JsxModules.place holder +Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res diff --git a/tests/docstring_tests/DocTest.res b/tests/docstring_tests/DocTest.res index e6017c0959..1d7b78dc0a 100644 --- a/tests/docstring_tests/DocTest.res +++ b/tests/docstring_tests/DocTest.res @@ -24,16 +24,16 @@ let ignoreRuntimeTests = [ // Ignore some tests not supported by node v18 18, [ - "Array.toReversed", - "Array.toSorted", - "Promise.withResolvers", - "Set.union", - "Set.isSupersetOf", - "Set.isSubsetOf", - "Set.isDisjointFrom", - "Set.intersection", - "Set.symmetricDifference", - "Set.difference", + "Stdlib.Array.toReversed", + "Stdlib.Array.toSorted", + "Stdlib.Promise.withResolvers", + "Stdlib.Set.union", + "Stdlib.Set.isSupersetOf", + "Stdlib.Set.isSubsetOf", + "Stdlib.Set.isDisjointFrom", + "Stdlib.Set.intersection", + "Stdlib.Set.symmetricDifference", + "Stdlib.Set.difference", ], ), ] @@ -150,7 +150,11 @@ let extractExamples = async () => { let docFiles = files->Array.filter(f => switch f { // Ignore Js modules and RescriptTools for now - | f if f->String.startsWith("Js") || f->String.startsWith("RescriptTools") => false + // Avoid Stdlib modules showing up as both "Stdlib_X" and "Stdlib.X" + | f + if f->String.startsWith("Js") || + f->String.startsWith("RescriptTools") || + f->String.startsWith("Stdlib_") => false | f if f->String.endsWith(".resi") => true | f if f->String.endsWith(".res") && !(files->Array.includes(f ++ "i")) => true | _ => false diff --git a/tests/docstring_tests/DocTest.res.mjs b/tests/docstring_tests/DocTest.res.mjs index aa63b8065b..c2276b1d23 100644 --- a/tests/docstring_tests/DocTest.res.mjs +++ b/tests/docstring_tests/DocTest.res.mjs @@ -2,40 +2,40 @@ import * as Fs from "fs"; import * as Os from "os"; -import * as Exn from "rescript/lib/es6/Exn.js"; -import * as Int from "rescript/lib/es6/Int.js"; import * as Url from "url"; -import * as Dict from "rescript/lib/es6/Dict.js"; -import * as List from "rescript/lib/es6/List.js"; import * as Path from "path"; -import * as $$Array from "rescript/lib/es6/Array.js"; -import * as $$Error from "rescript/lib/es6/Error.js"; -import * as Option from "rescript/lib/es6/Option.js"; +import * as Stdlib from "rescript/lib/es6/Stdlib.js"; import * as Belt_List from "rescript/lib/es6/Belt_List.js"; import * as ArrayUtils from "./ArrayUtils.res.mjs"; import * as Belt_Array from "rescript/lib/es6/Belt_Array.js"; -import * as Pervasives from "rescript/lib/es6/Pervasives.js"; import * as SpawnAsync from "./SpawnAsync.res.mjs"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; +import * as Stdlib_Int from "rescript/lib/es6/Stdlib_Int.js"; +import * as Stdlib_Dict from "rescript/lib/es6/Stdlib_Dict.js"; +import * as Stdlib_List from "rescript/lib/es6/Stdlib_List.js"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; +import * as Stdlib_Error from "rescript/lib/es6/Stdlib_Error.js"; +import * as Stdlib_Option from "rescript/lib/es6/Stdlib_Option.js"; import * as Primitive_string from "rescript/lib/es6/Primitive_string.js"; import * as Promises from "node:fs/promises"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; import * as RescriptTools_Docgen from "rescript/lib/es6/RescriptTools_Docgen.js"; -let nodeVersion = Option.getExn(Int.fromString(Option.getExn(process.version.replace("v", "").split(".")[0], "Failed to find major version of Node"), undefined), "Failed to convert node version to Int"); +let nodeVersion = Stdlib_Option.getExn(Stdlib_Int.fromString(Stdlib_Option.getExn(process.version.replace("v", "").split(".")[0], "Failed to find major version of Node"), undefined), "Failed to convert node version to Int"); let ignoreRuntimeTests = [[ 18, [ - "Array.toReversed", - "Array.toSorted", - "Promise.withResolvers", - "Set.union", - "Set.isSupersetOf", - "Set.isSubsetOf", - "Set.isDisjointFrom", - "Set.intersection", - "Set.symmetricDifference", - "Set.difference" + "Stdlib.Array.toReversed", + "Stdlib.Array.toSorted", + "Stdlib.Promise.withResolvers", + "Stdlib.Set.union", + "Stdlib.Set.isSupersetOf", + "Stdlib.Set.isSubsetOf", + "Stdlib.Set.isDisjointFrom", + "Stdlib.Set.intersection", + "Stdlib.Set.symmetricDifference", + "Stdlib.Set.difference" ] ]]; @@ -53,8 +53,8 @@ async function extractDocFromFile(file) { return RescriptTools_Docgen.decodeFromJson(JSON.parse(getOutput(match.stdout))); } catch (raw_exn) { let exn = Primitive_exceptions.internalToException(raw_exn); - if (exn.RE_EXN_ID === Exn.$$Error) { - return $$Error.panic("Failed to generate docstrings from " + file); + if (exn.RE_EXN_ID === Stdlib_Exn.$$Error) { + return Stdlib_Error.panic("Failed to generate docstrings from " + file); } throw { RE_EXN_ID: "Assert_failure", @@ -114,7 +114,7 @@ function getExamples(param) { }; _items = Belt_List.concatMany([ items.tl, - List.fromArray(match.items) + Stdlib_List.fromArray(match.items) ]); continue; case "moduleType" : @@ -129,7 +129,7 @@ function getExamples(param) { }; _items = Belt_List.concatMany([ items.tl, - List.fromArray(match.items) + Stdlib_List.fromArray(match.items) ]); continue; case "moduleAlias" : @@ -144,13 +144,13 @@ function getExamples(param) { }; _items = Belt_List.concatMany([ items.tl, - List.fromArray(match.items) + Stdlib_List.fromArray(match.items) ]); continue; } }; }; - return List.toArray(loop(List.fromArray(param.items), /* [] */0)).filter(param => param.docstrings.length > 0); + return Stdlib_List.toArray(loop(Stdlib_List.fromArray(param.items), /* [] */0)).filter(param => param.docstrings.length > 0); } function getCodeBlocks(example) { @@ -159,7 +159,7 @@ function getCodeBlocks(example) { let acc = _acc; let lines = _lines; if (lines === 0) { - return Pervasives.panic("Failed to find end of code block for " + example.kind + ": " + example.id); + return Stdlib.panic("Failed to find end of code block for " + example.kind + ": " + example.id); } let hd = lines.hd; if (hd.trim().endsWith("```")) { @@ -184,7 +184,7 @@ function getCodeBlocks(example) { if (lines.hd.trim().startsWith("```res")) { let code = loopEndCodeBlock(rest, /* [] */0); _acc = { - hd: List.toArray(List.reverse(code)).join("\n"), + hd: Stdlib_List.toArray(Stdlib_List.reverse(code)).join("\n"), tl: acc }; _lines = rest; @@ -194,7 +194,7 @@ function getCodeBlocks(example) { continue; }; }; - return Belt_Array.reverse(List.toArray(loop(List.fromArray($$Array.reduce(example.docstrings, [], (acc, docstring) => acc.concat(docstring.split("\n")))), /* [] */0))).join("\n\n"); + return Belt_Array.reverse(Stdlib_List.toArray(loop(Stdlib_List.fromArray(Stdlib_Array.reduce(example.docstrings, [], (acc, docstring) => acc.concat(docstring.split("\n")))), /* [] */0))).join("\n\n"); } let batchSize = Os.cpus().length; @@ -202,7 +202,7 @@ let batchSize = Os.cpus().length; async function extractExamples() { let files = Fs.readdirSync("runtime"); let docFiles = files.filter(f => { - if (f.startsWith("Js") || f.startsWith("RescriptTools")) { + if (f.startsWith("Js") || f.startsWith("RescriptTools") || f.startsWith("Stdlib_")) { return false; } else if (f.endsWith(".resi")) { return true; @@ -233,9 +233,9 @@ async function main() { dict[id] = [cur].concat(previous); }); let output = []; - Dict.forEachWithKey(dict, (examples, key) => { + Stdlib_Dict.forEachWithKey(dict, (examples, key) => { examples.sort((a, b) => Primitive_string.compare(a.name, b.name)); - let codeExamples = $$Array.filterMap(examples, example => { + let codeExamples = Stdlib_Array.filterMap(examples, example => { let ignoreExample = ignoreRuntimeTests.some(param => { if (nodeVersion === param[0]) { return param[1].includes(example.id); diff --git a/tests/gentype_tests/typescript-react-example/package-lock.json b/tests/gentype_tests/typescript-react-example/package-lock.json index d1d0e9c2ab..f7b3f3975c 100644 --- a/tests/gentype_tests/typescript-react-example/package-lock.json +++ b/tests/gentype_tests/typescript-react-example/package-lock.json @@ -21,7 +21,8 @@ } }, "../../..": { - "version": "12.0.0-alpha.7", + "name": "rescript", + "version": "12.0.0-alpha.9", "dev": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", diff --git a/tests/tests/src/UntaggedVariants.res b/tests/tests/src/UntaggedVariants.res index 4e177b77a1..23f9539402 100644 --- a/tests/tests/src/UntaggedVariants.res +++ b/tests/tests/src/UntaggedVariants.res @@ -399,7 +399,7 @@ module AllInstanceofTypes = { | Promise(promise) | Object(record) | Date(Js.Date.t) - | RegExp(Js.Re.t) + | RegExp(Stdlib_RegExp.t) | File(Js.File.t) | Blob(Js.Blob.t) diff --git a/tests/tests/src/core/Core_ArrayTests.mjs b/tests/tests/src/core/Core_ArrayTests.mjs index 5f48457d79..9f528d119c 100644 --- a/tests/tests/src/core/Core_ArrayTests.mjs +++ b/tests/tests/src/core/Core_ArrayTests.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as List from "rescript/lib/es6/List.js"; import * as Test from "./Test.mjs"; -import * as $$Array from "rescript/lib/es6/Array.js"; +import * as Stdlib_List from "rescript/lib/es6/Stdlib_List.js"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; let eq = Primitive_object.equal; @@ -15,7 +15,7 @@ Test.run([ 26 ], "make" -], $$Array.make(6, 7), eq, [ +], Stdlib_Array.make(6, 7), eq, [ 7, 7, 7, @@ -56,7 +56,7 @@ Test.run([ 30 ], "fromInitializer" -], $$Array.fromInitializer(7, i => i + 3 | 0), eq, [ +], Stdlib_Array.fromInitializer(7, i => i + 3 | 0), eq, [ 3, 4, 5, @@ -74,11 +74,11 @@ Test.run([ 28 ], "reduce" -], $$Array.reduce([ +], Stdlib_Array.reduce([ 1, 2, 3 -], /* [] */0, List.add), eq, { +], /* [] */0, Stdlib_List.add), eq, { hd: 3, tl: { hd: 2, @@ -97,7 +97,7 @@ Test.run([ 36 ], "reduce - empty" -], $$Array.reduce([], /* [] */0, List.add), eq, /* [] */0); +], Stdlib_Array.reduce([], /* [] */0, Stdlib_List.add), eq, /* [] */0); Test.run([ [ @@ -107,7 +107,7 @@ Test.run([ 30 ], "reduceWithIndex" -], $$Array.reduceWithIndex([ +], Stdlib_Array.reduceWithIndex([ 1, 2, 3 @@ -133,7 +133,7 @@ Test.run([ 38 ], "reduceWithIndex - empty" -], $$Array.reduceWithIndex([], /* [] */0, (acc, v, i) => ({ +], Stdlib_Array.reduceWithIndex([], /* [] */0, (acc, v, i) => ({ hd: v + i | 0, tl: acc })), eq, /* [] */0); @@ -146,11 +146,11 @@ Test.run([ 26 ], "reduceRight" -], $$Array.reduceRight([ +], Stdlib_Array.reduceRight([ 1, 2, 3 -], /* [] */0, List.add), eq, { +], /* [] */0, Stdlib_List.add), eq, { hd: 1, tl: { hd: 2, @@ -169,7 +169,7 @@ Test.run([ 41 ], "reduceRight - empty" -], $$Array.reduceRight([], /* [] */0, List.add), eq, /* [] */0); +], Stdlib_Array.reduceRight([], /* [] */0, Stdlib_List.add), eq, /* [] */0); Test.run([ [ @@ -179,7 +179,7 @@ Test.run([ 35 ], "reduceEightWithIndex" -], $$Array.reduceRightWithIndex([ +], Stdlib_Array.reduceRightWithIndex([ 1, 2, 3 @@ -205,7 +205,7 @@ Test.run([ 38 ], "reduceWithIndex - empty" -], $$Array.reduceRightWithIndex([], /* [] */0, (acc, v, i) => ({ +], Stdlib_Array.reduceRightWithIndex([], /* [] */0, (acc, v, i) => ({ hd: v + i | 0, tl: acc })), eq, /* [] */0); @@ -218,7 +218,7 @@ Test.run([ 41 ], "toShuffled - length" -], $$Array.toShuffled([ +], Stdlib_Array.toShuffled([ 1, 2, 3 @@ -238,7 +238,7 @@ Test.run([ 31 ], "shuffle - length" -], ($$Array.shuffle(arr), arr.length), eq, 3); +], (Stdlib_Array.shuffle(arr), arr.length), eq, 3); Test.run([ [ @@ -248,7 +248,7 @@ Test.run([ 24 ], "filterMap" -], $$Array.filterMap([ +], Stdlib_Array.filterMap([ 1, 2, 3, @@ -274,7 +274,7 @@ Test.run([ 42 ], "filterMap - no match" -], $$Array.filterMap([ +], Stdlib_Array.filterMap([ 1, 2, 3, @@ -291,7 +291,7 @@ Test.run([ 32 ], "filterMap - empty" -], $$Array.filterMap([], n => { +], Stdlib_Array.filterMap([], n => { if (n % 2 === 0) { return Math.imul(n, n); } @@ -306,7 +306,7 @@ Test.run([ 30 ], "keepSome" -], $$Array.keepSome([ +], Stdlib_Array.keepSome([ 1, undefined, 3 @@ -323,7 +323,7 @@ Test.run([ 34 ], "keepSome - all Some" -], $$Array.keepSome([ +], Stdlib_Array.keepSome([ 1, 2, 3 @@ -341,7 +341,7 @@ Test.run([ 41 ], "keepSome - all None" -], $$Array.keepSome([ +], Stdlib_Array.keepSome([ undefined, undefined, undefined @@ -355,7 +355,7 @@ Test.run([ 38 ], "keepSome - empty" -], $$Array.keepSome([]), eq, []); +], Stdlib_Array.keepSome([]), eq, []); Test.run([ [ @@ -365,7 +365,7 @@ Test.run([ 22 ], "findMap" -], $$Array.findMap([ +], Stdlib_Array.findMap([ 1, 2, 3, @@ -387,7 +387,7 @@ Test.run([ 40 ], "findMap - no match" -], $$Array.findMap([ +], Stdlib_Array.findMap([ 1, 2, 3, @@ -404,7 +404,7 @@ Test.run([ 30 ], "findMap - empty" -], $$Array.findMap([], n => { +], Stdlib_Array.findMap([], n => { if (n % 2 === 0) { return Math.imul(n, n); } @@ -441,7 +441,7 @@ Test.run([ 39 ], "last - with items" -], $$Array.last([ +], Stdlib_Array.last([ 1, 2, 3 @@ -455,7 +455,7 @@ Test.run([ 34 ], "last - empty" -], $$Array.last([]), eq, undefined); +], Stdlib_Array.last([]), eq, undefined); export { eq, diff --git a/tests/tests/src/core/Core_ErrorTests.mjs b/tests/tests/src/core/Core_ErrorTests.mjs index ce1cb6e63e..1d0276de6a 100644 --- a/tests/tests/src/core/Core_ErrorTests.mjs +++ b/tests/tests/src/core/Core_ErrorTests.mjs @@ -1,17 +1,17 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Exn from "rescript/lib/es6/Exn.js"; import * as Test from "./Test.mjs"; -import * as Pervasives from "rescript/lib/es6/Pervasives.js"; +import * as Stdlib from "rescript/lib/es6/Stdlib.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; function panicTest() { let caught; try { - caught = Pervasives.panic("uh oh"); + caught = Stdlib.panic("uh oh"); } catch (raw_err) { let err = Primitive_exceptions.internalToException(raw_err); - if (err.RE_EXN_ID === Exn.$$Error) { + if (err.RE_EXN_ID === Stdlib_Exn.$$Error) { caught = err._1.message; } else { throw err; diff --git a/tests/tests/src/core/Core_FloatTests.mjs b/tests/tests/src/core/Core_FloatTests.mjs index f58ad653a9..05ec56c434 100644 --- a/tests/tests/src/core/Core_FloatTests.mjs +++ b/tests/tests/src/core/Core_FloatTests.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as Float from "rescript/lib/es6/Float.js"; import * as Pervasives from "rescript/lib/es6/Pervasives.js"; +import * as Stdlib_Float from "rescript/lib/es6/Stdlib_Float.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; let eq = Primitive_object.equal; @@ -15,7 +15,7 @@ Test.run([ 27 ], "clamp" -], Float.clamp(undefined, undefined, 4.2), eq, 4.2); +], Stdlib_Float.clamp(undefined, undefined, 4.2), eq, 4.2); Test.run([ [ @@ -25,7 +25,7 @@ Test.run([ 35 ], "clamp - < min" -], Float.clamp(4.3, undefined, 4.1), eq, 4.3); +], Stdlib_Float.clamp(4.3, undefined, 4.1), eq, 4.3); Test.run([ [ @@ -35,7 +35,7 @@ Test.run([ 35 ], "clamp - > min" -], Float.clamp(4.1, undefined, 4.2), eq, 4.2); +], Stdlib_Float.clamp(4.1, undefined, 4.2), eq, 4.2); Test.run([ [ @@ -45,7 +45,7 @@ Test.run([ 35 ], "clamp - < max" -], Float.clamp(undefined, 4.3, 4.2), eq, 4.2); +], Stdlib_Float.clamp(undefined, 4.3, 4.2), eq, 4.2); Test.run([ [ @@ -55,7 +55,7 @@ Test.run([ 35 ], "clamp - > max" -], Float.clamp(undefined, 4.1, 4.2), eq, 4.1); +], Stdlib_Float.clamp(undefined, 4.1, 4.2), eq, 4.1); Test.run([ [ @@ -65,7 +65,7 @@ Test.run([ 42 ], "clamp - < min, < max" -], Float.clamp(4.3, 4.5, 4.2), eq, 4.3); +], Stdlib_Float.clamp(4.3, 4.5, 4.2), eq, 4.3); Test.run([ [ @@ -75,7 +75,7 @@ Test.run([ 42 ], "clamp - < min, > max" -], Float.clamp(4.3, 4.1, 4.2), eq, 4.3); +], Stdlib_Float.clamp(4.3, 4.1, 4.2), eq, 4.3); Test.run([ [ @@ -85,7 +85,7 @@ Test.run([ 42 ], "clamp - > min, < max" -], Float.clamp(4.1, 4.5, 4.2), eq, 4.2); +], Stdlib_Float.clamp(4.1, 4.5, 4.2), eq, 4.2); Test.run([ [ @@ -95,7 +95,7 @@ Test.run([ 42 ], "clamp - > min, > max" -], Float.clamp(4.1, 4.1, 4.2), eq, 4.1); +], Stdlib_Float.clamp(4.1, 4.1, 4.2), eq, 4.1); Test.run([ [ @@ -105,7 +105,7 @@ Test.run([ 33 ], "clamp - nan" -], isNaN(Float.clamp(4.1, 4.3, Number.NaN)), eq, true); +], isNaN(Stdlib_Float.clamp(4.1, 4.3, Number.NaN)), eq, true); Test.run([ [ @@ -115,7 +115,7 @@ Test.run([ 38 ], "clamp - infinity" -], Float.clamp(4.1, 4.3, Pervasives.infinity), eq, 4.3); +], Stdlib_Float.clamp(4.1, 4.3, Pervasives.infinity), eq, 4.3); Test.run([ [ @@ -125,7 +125,7 @@ Test.run([ 39 ], "clamp - -infinity" -], Float.clamp(4.1, 4.3, Pervasives.neg_infinity), eq, 4.1); +], Stdlib_Float.clamp(4.1, 4.3, Pervasives.neg_infinity), eq, 4.1); Test.run([ [ @@ -135,7 +135,7 @@ Test.run([ 37 ], "clamp - min nan" -], Float.clamp(Number.NaN, undefined, 4.2), eq, 4.2); +], Stdlib_Float.clamp(Number.NaN, undefined, 4.2), eq, 4.2); Test.run([ [ @@ -145,7 +145,7 @@ Test.run([ 37 ], "clamp - max nan" -], Float.clamp(undefined, Number.NaN, 4.2), eq, 4.2); +], Stdlib_Float.clamp(undefined, Number.NaN, 4.2), eq, 4.2); Test.run([ [ @@ -155,7 +155,7 @@ Test.run([ 46 ], "clamp - min nan, max nan" -], Float.clamp(Number.NaN, Number.NaN, 4.2), eq, 4.2); +], Stdlib_Float.clamp(Number.NaN, Number.NaN, 4.2), eq, 4.2); Test.run([ [ @@ -165,7 +165,7 @@ Test.run([ 42 ], "clamp - min infinity" -], Float.clamp(Pervasives.infinity, undefined, 4.2), eq, Pervasives.infinity); +], Stdlib_Float.clamp(Pervasives.infinity, undefined, 4.2), eq, Pervasives.infinity); Test.run([ [ @@ -175,7 +175,7 @@ Test.run([ 42 ], "clamp - max infinity" -], Float.clamp(undefined, Pervasives.infinity, 4.2), eq, 4.2); +], Stdlib_Float.clamp(undefined, Pervasives.infinity, 4.2), eq, 4.2); Test.run([ [ @@ -185,7 +185,7 @@ Test.run([ 43 ], "clamp - min -infinity" -], Float.clamp(Pervasives.neg_infinity, undefined, 4.2), eq, 4.2); +], Stdlib_Float.clamp(Pervasives.neg_infinity, undefined, 4.2), eq, 4.2); Test.run([ [ @@ -195,7 +195,7 @@ Test.run([ 43 ], "clamp - max -infinity" -], Float.clamp(undefined, Pervasives.neg_infinity, 4.2), eq, Pervasives.neg_infinity); +], Stdlib_Float.clamp(undefined, Pervasives.neg_infinity, 4.2), eq, Pervasives.neg_infinity); Test.run([ [ @@ -205,7 +205,7 @@ Test.run([ 49 ], "clamp - min infinity, max infinity" -], Float.clamp(Pervasives.infinity, Pervasives.infinity, 4.2), eq, Pervasives.infinity); +], Stdlib_Float.clamp(Pervasives.infinity, Pervasives.infinity, 4.2), eq, Pervasives.infinity); Test.run([ [ @@ -215,7 +215,7 @@ Test.run([ 50 ], "clamp - min -infinity, max infinity" -], Float.clamp(Pervasives.neg_infinity, Pervasives.infinity, 4.2), eq, 4.2); +], Stdlib_Float.clamp(Pervasives.neg_infinity, Pervasives.infinity, 4.2), eq, 4.2); Test.run([ [ @@ -225,7 +225,7 @@ Test.run([ 50 ], "clamp - min infinity, max -infinity" -], Float.clamp(Pervasives.infinity, Pervasives.neg_infinity, 4.2), eq, Pervasives.infinity); +], Stdlib_Float.clamp(Pervasives.infinity, Pervasives.neg_infinity, 4.2), eq, Pervasives.infinity); Test.run([ [ @@ -235,7 +235,7 @@ Test.run([ 51 ], "clamp - min -infinity, max -infinity" -], Float.clamp(Pervasives.neg_infinity, Pervasives.neg_infinity, 4.2), eq, Pervasives.neg_infinity); +], Stdlib_Float.clamp(Pervasives.neg_infinity, Pervasives.neg_infinity, 4.2), eq, Pervasives.neg_infinity); Test.run([ [ diff --git a/tests/tests/src/core/Core_IntTests.mjs b/tests/tests/src/core/Core_IntTests.mjs index 6935d883e3..f873104d52 100644 --- a/tests/tests/src/core/Core_IntTests.mjs +++ b/tests/tests/src/core/Core_IntTests.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Exn from "rescript/lib/es6/Exn.js"; -import * as Int from "rescript/lib/es6/Int.js"; import * as Test from "./Test.mjs"; import * as Pervasives from "rescript/lib/es6/Pervasives.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; +import * as Stdlib_Int from "rescript/lib/es6/Stdlib_Int.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; @@ -15,7 +15,7 @@ function $$catch(f) { return Pervasives.failwith("no exception raised"); } catch (raw_err) { let err = Primitive_exceptions.internalToException(raw_err); - if (err.RE_EXN_ID === Exn.$$Error) { + if (err.RE_EXN_ID === Stdlib_Exn.$$Error) { return err._1; } throw err; @@ -30,7 +30,7 @@ Test.run([ 50 ], "range - positive, increasing" -], Int.range(3, 6, undefined), eq, [ +], Stdlib_Int.range(3, 6, undefined), eq, [ 3, 4, 5 @@ -44,7 +44,7 @@ Test.run([ 50 ], "range - negative, increasing" -], Int.range(-3, -1, undefined), eq, [ +], Stdlib_Int.range(-3, -1, undefined), eq, [ -3, -2 ]); @@ -57,7 +57,7 @@ Test.run([ 51 ], "range - cross-zero, incresing" -], Int.range(-1, 2, undefined), eq, [ +], Stdlib_Int.range(-1, 2, undefined), eq, [ -1, 0, 1 @@ -71,7 +71,7 @@ Test.run([ 42 ], "range - start == end" -], Int.range(3, 3, undefined), eq, []); +], Stdlib_Int.range(3, 3, undefined), eq, []); Test.run([ [ @@ -81,7 +81,7 @@ Test.run([ 50 ], "range - positive, decreasing" -], Int.range(3, 1, undefined), eq, [ +], Stdlib_Int.range(3, 1, undefined), eq, [ 3, 2 ]); @@ -94,7 +94,7 @@ Test.run([ 50 ], "range - negative, decreasing" -], Int.range(-1, -3, undefined), eq, [ +], Stdlib_Int.range(-1, -3, undefined), eq, [ -1, -2 ]); @@ -107,7 +107,7 @@ Test.run([ 51 ], "range - positive, increasing, step 2" -], Int.range(3, 6, { +], Stdlib_Int.range(3, 6, { step: 2 }), eq, [ 3, @@ -122,7 +122,7 @@ Test.run([ 51 ], "range + positive, increasing, step 2" -], Int.range(3, 7, { +], Stdlib_Int.range(3, 7, { step: 2 }), eq, [ 3, @@ -137,7 +137,7 @@ Test.run([ 51 ], "range + positive, increasing, step 2" -], Int.range(3, 8, { +], Stdlib_Int.range(3, 8, { step: 2 }), eq, [ 3, @@ -153,7 +153,7 @@ Test.run([ 51 ], "range - negative, increasing, step 2" -], Int.range(-6, -3, { +], Stdlib_Int.range(-6, -3, { step: 2 }), eq, [ -6, @@ -168,7 +168,7 @@ Test.run([ 51 ], "range - positive, increasing, step 0" -], $$catch(() => Int.range(3, 6, { +], $$catch(() => Stdlib_Int.range(3, 6, { step: 0 })), eq, new RangeError("Incorrect range arguments")); @@ -180,7 +180,7 @@ Test.run([ 50 ], "range - start == end, step 0" -], Int.range(3, 3, { +], Stdlib_Int.range(3, 3, { step: 0 }), eq, []); @@ -192,7 +192,7 @@ Test.run([ 52 ], "range + positive, increasing, step -1" -], Int.range(3, 6, { +], Stdlib_Int.range(3, 6, { step: -1 }), eq, []); @@ -204,7 +204,7 @@ Test.run([ 51 ], "range + positive, decreasing, step 1" -], Int.range(6, 3, { +], Stdlib_Int.range(6, 3, { step: 1 }), eq, []); @@ -216,7 +216,7 @@ Test.run([ 52 ], "range + positive, decreasing, step -2" -], Int.range(6, 3, { +], Stdlib_Int.range(6, 3, { step: -2 }), eq, [ 6, @@ -231,7 +231,7 @@ Test.run([ 52 ], "range + positive, increasing, step -2" -], Int.range(6, 2, { +], Stdlib_Int.range(6, 2, { step: -2 }), eq, [ 6, @@ -246,7 +246,7 @@ Test.run([ 52 ], "range + positive, increasing, step -2" -], Int.range(6, 1, { +], Stdlib_Int.range(6, 1, { step: -2 }), eq, [ 6, @@ -262,7 +262,7 @@ Test.run([ 52 ], "range + negative, decreasing, step -2" -], Int.range(-3, -6, { +], Stdlib_Int.range(-3, -6, { step: -2 }), eq, [ -3, @@ -277,7 +277,7 @@ Test.run([ 62 ], "range - positive, increasing, step 2, inclusive" -], Int.range(3, 6, { +], Stdlib_Int.range(3, 6, { step: 2, inclusive: true }), eq, [ @@ -293,7 +293,7 @@ Test.run([ 62 ], "range + positive, increasing, step 2, inclusive" -], Int.range(3, 7, { +], Stdlib_Int.range(3, 7, { step: 2, inclusive: true }), eq, [ @@ -310,7 +310,7 @@ Test.run([ 62 ], "range + positive, increasing, step 2, inclusive" -], Int.range(3, 8, { +], Stdlib_Int.range(3, 8, { step: 2, inclusive: true }), eq, [ @@ -327,7 +327,7 @@ Test.run([ 62 ], "range - negative, increasing, step 2, inclusive" -], Int.range(-6, -3, { +], Stdlib_Int.range(-6, -3, { step: 2, inclusive: true }), eq, [ @@ -343,7 +343,7 @@ Test.run([ 62 ], "range - positive, increasing, step 0, inclusive" -], $$catch(() => Int.range(3, 6, { +], $$catch(() => Stdlib_Int.range(3, 6, { step: 0, inclusive: true })), eq, new RangeError("Incorrect range arguments")); @@ -356,7 +356,7 @@ Test.run([ 54 ], "range - start == end, step 0, inclusive" -], Int.range(3, 3, { +], Stdlib_Int.range(3, 3, { step: 0, inclusive: true }), eq, [3]); @@ -369,7 +369,7 @@ Test.run([ 63 ], "range + positive, increasing, step -1, inclusive" -], Int.range(3, 6, { +], Stdlib_Int.range(3, 6, { step: -1, inclusive: true }), eq, []); @@ -382,7 +382,7 @@ Test.run([ 62 ], "range + positive, decreasing, step 1, inclusive" -], Int.range(6, 3, { +], Stdlib_Int.range(6, 3, { step: 1, inclusive: true }), eq, []); @@ -395,7 +395,7 @@ Test.run([ 63 ], "range + positive, decreasing, step -2, inclusive" -], Int.range(6, 3, { +], Stdlib_Int.range(6, 3, { step: -2, inclusive: true }), eq, [ @@ -411,7 +411,7 @@ Test.run([ 63 ], "range + positive, increasing, step -2, inclusive" -], Int.range(6, 2, { +], Stdlib_Int.range(6, 2, { step: -2, inclusive: true }), eq, [ @@ -428,7 +428,7 @@ Test.run([ 63 ], "range + positive, increasing, step -2, inclusive" -], Int.range(6, 1, { +], Stdlib_Int.range(6, 1, { step: -2, inclusive: true }), eq, [ @@ -445,7 +445,7 @@ Test.run([ 63 ], "range + negative, decreasing, step -2, inclusive" -], Int.range(-3, -6, { +], Stdlib_Int.range(-3, -6, { step: -2, inclusive: true }), eq, [ @@ -461,7 +461,7 @@ Test.run([ 27 ], "clamp" -], Int.clamp(undefined, undefined, 42), eq, 42); +], Stdlib_Int.clamp(undefined, undefined, 42), eq, 42); Test.run([ [ @@ -471,7 +471,7 @@ Test.run([ 35 ], "clamp - < min" -], Int.clamp(50, undefined, 42), eq, 50); +], Stdlib_Int.clamp(50, undefined, 42), eq, 50); Test.run([ [ @@ -481,7 +481,7 @@ Test.run([ 35 ], "clamp - > min" -], Int.clamp(40, undefined, 42), eq, 42); +], Stdlib_Int.clamp(40, undefined, 42), eq, 42); Test.run([ [ @@ -491,7 +491,7 @@ Test.run([ 35 ], "clamp - < max" -], Int.clamp(undefined, 50, 42), eq, 42); +], Stdlib_Int.clamp(undefined, 50, 42), eq, 42); Test.run([ [ @@ -501,7 +501,7 @@ Test.run([ 35 ], "clamp - > max" -], Int.clamp(undefined, 40, 42), eq, 40); +], Stdlib_Int.clamp(undefined, 40, 42), eq, 40); Test.run([ [ @@ -511,7 +511,7 @@ Test.run([ 42 ], "clamp - < min, < max" -], Int.clamp(50, 60, 42), eq, 50); +], Stdlib_Int.clamp(50, 60, 42), eq, 50); Test.run([ [ @@ -521,7 +521,7 @@ Test.run([ 42 ], "clamp - < min, > max" -], Int.clamp(50, 40, 42), eq, 50); +], Stdlib_Int.clamp(50, 40, 42), eq, 50); Test.run([ [ @@ -531,7 +531,7 @@ Test.run([ 42 ], "clamp - > min, < max" -], Int.clamp(40, 60, 42), eq, 42); +], Stdlib_Int.clamp(40, 60, 42), eq, 42); Test.run([ [ @@ -541,7 +541,7 @@ Test.run([ 42 ], "clamp - > min, > max" -], Int.clamp(40, 40, 42), eq, 40); +], Stdlib_Int.clamp(40, 40, 42), eq, 40); Test.run([ [ diff --git a/tests/tests/src/core/Core_IteratorTests.mjs b/tests/tests/src/core/Core_IteratorTests.mjs index f79c9cefe1..c9a7e4868b 100644 --- a/tests/tests/src/core/Core_IteratorTests.mjs +++ b/tests/tests/src/core/Core_IteratorTests.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as $$Iterator from "rescript/lib/es6/Iterator.js"; -import * as $$AsyncIterator from "rescript/lib/es6/AsyncIterator.js"; +import * as Stdlib_Iterator from "rescript/lib/es6/Stdlib_Iterator.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; +import * as Stdlib_AsyncIterator from "rescript/lib/es6/Stdlib_AsyncIterator.js"; let eq = Primitive_object.equal; @@ -17,7 +17,7 @@ let syncResult = { contents: undefined }; -$$Iterator.forEach(iterator, v => { +Stdlib_Iterator.forEach(iterator, v => { if (v === "b") { syncResult.contents = "b"; return; @@ -49,7 +49,7 @@ let asyncResult = { contents: undefined }; -await $$AsyncIterator.forEach(asyncIterator, v => { +await Stdlib_AsyncIterator.forEach(asyncIterator, v => { if (v !== undefined && v[0] === "second") { asyncResult.contents = "second"; return; @@ -75,17 +75,17 @@ let count = { contents: 0 }; -let asyncIterator$1 = $$AsyncIterator.make(async () => { +let asyncIterator$1 = Stdlib_AsyncIterator.make(async () => { let currentCount = count.contents; count.contents = currentCount + 1 | 0; if (currentCount === 3) { - return $$AsyncIterator.done(currentCount); + return Stdlib_AsyncIterator.done(currentCount); } else { - return $$AsyncIterator.value(currentCount); + return Stdlib_AsyncIterator.value(currentCount); } }); -await $$AsyncIterator.forEach(asyncIterator$1, v => { +await Stdlib_AsyncIterator.forEach(asyncIterator$1, v => { if (v === 3) { asyncResult$1.contents = "done"; } else { diff --git a/tests/tests/src/core/Core_ObjectTests.mjs b/tests/tests/src/core/Core_ObjectTests.mjs index 78b3c4fb32..0da00125a9 100644 --- a/tests/tests/src/core/Core_ObjectTests.mjs +++ b/tests/tests/src/core/Core_ObjectTests.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as Option from "rescript/lib/es6/Option.js"; +import * as Stdlib_Option from "rescript/lib/es6/Stdlib_Option.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; let eq = Primitive_object.equal; @@ -500,7 +500,7 @@ runGetTest({ source: () => ({ a: 1 }), - get: i => Option.isSome(i["toString"]), + get: i => Stdlib_Option.isSome(i["toString"]), expected: true }); @@ -531,7 +531,7 @@ runGetTest({ 3 ] }), - get: i => Option.getOr(Option.map(i["a"], i => i.concat([ + get: i => Stdlib_Option.getOr(Stdlib_Option.map(i["a"], i => i.concat([ 4, 5 ])), []), diff --git a/tests/tests/src/core/Core_PromiseTest.mjs b/tests/tests/src/core/Core_PromiseTest.mjs index c3b23fa1ff..3935f8d730 100644 --- a/tests/tests/src/core/Core_PromiseTest.mjs +++ b/tests/tests/src/core/Core_PromiseTest.mjs @@ -1,14 +1,14 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Exn from "rescript/lib/es6/Exn.js"; import * as Test from "./Test.mjs"; -import * as $$Promise from "rescript/lib/es6/Promise.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; +import * as Stdlib_Promise from "rescript/lib/es6/Stdlib_Promise.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; let TestError = /* @__PURE__ */Primitive_exceptions.create("Core_PromiseTest.TestError"); -let fail = Exn.raiseError; +let fail = Stdlib_Exn.raiseError; let equal = Primitive_object.equal; @@ -111,7 +111,7 @@ let ThenChaining = { }; function testExnRejection() { - $$Promise.$$catch(Promise.reject({ + Stdlib_Promise.$$catch(Promise.reject({ RE_EXN_ID: TestError, _1: "oops" }), e => { @@ -148,8 +148,8 @@ let asyncParseFail = (function() { }); function testExternalPromiseThrow() { - return $$Promise.$$catch(asyncParseFail().then(param => Promise.resolve()), e => { - let success = e.RE_EXN_ID === Exn.$$Error ? Primitive_object.equal(e._1.name, "SyntaxError") : false; + return Stdlib_Promise.$$catch(asyncParseFail().then(param => Promise.resolve()), e => { + let success = e.RE_EXN_ID === Stdlib_Exn.$$Error ? Primitive_object.equal(e._1.name, "SyntaxError") : false; Test.run([ [ "Core_PromiseTest.res", @@ -164,7 +164,7 @@ function testExternalPromiseThrow() { } function testExnThrow() { - return $$Promise.$$catch(Promise.resolve().then(() => { + return Stdlib_Promise.$$catch(Promise.resolve().then(() => { throw { RE_EXN_ID: TestError, _1: "Thrown exn", @@ -186,8 +186,8 @@ function testExnThrow() { } function testRaiseErrorThrow() { - return $$Promise.$$catch(Promise.resolve().then(() => Exn.raiseError("Some JS error")), e => { - let isTestErr = e.RE_EXN_ID === Exn.$$Error ? Primitive_object.equal(e._1.message, "Some JS error") : false; + return Stdlib_Promise.$$catch(Promise.resolve().then(() => Stdlib_Exn.raiseError("Some JS error")), e => { + let isTestErr = e.RE_EXN_ID === Stdlib_Exn.$$Error ? Primitive_object.equal(e._1.message, "Some JS error") : false; Test.run([ [ "Core_PromiseTest.res", @@ -202,7 +202,7 @@ function testRaiseErrorThrow() { } function thenAfterCatch() { - return $$Promise.$$catch(Promise.resolve().then(() => Promise.reject({ + return Stdlib_Promise.$$catch(Promise.resolve().then(() => Promise.reject({ RE_EXN_ID: TestError, _1: "some rejected value" })), e => { @@ -227,7 +227,7 @@ function testCatchFinally() { let wasCalled = { contents: false }; - $$Promise.$$catch(Promise.resolve(5).then(param => Promise.reject({ + Stdlib_Promise.$$catch(Promise.resolve(5).then(param => Promise.reject({ RE_EXN_ID: TestError, _1: "test" })).then(v => Promise.resolve(v)), param => Promise.resolve()).finally(() => { diff --git a/tests/tests/src/core/Core_ResultTests.mjs b/tests/tests/src/core/Core_ResultTests.mjs index 149b1a1d6c..6bb3154f2a 100644 --- a/tests/tests/src/core/Core_ResultTests.mjs +++ b/tests/tests/src/core/Core_ResultTests.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as Result from "rescript/lib/es6/Result.js"; +import * as Stdlib_Result from "rescript/lib/es6/Stdlib_Result.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; let eq = Primitive_object.equal; @@ -10,7 +10,7 @@ function forEachIfOkCallFunction() { let called = { contents: [] }; - Result.forEach({ + Stdlib_Result.forEach({ TAG: "Ok", _0: 3 }, i => { @@ -33,7 +33,7 @@ function forEachIfErrorDoNotCallFunction() { let called = { contents: [] }; - Result.forEach({ + Stdlib_Result.forEach({ TAG: "Error", _0: 3 }, i => { @@ -60,7 +60,7 @@ Test.run([ 48 ], "mapError: if ok, return it" -], Result.mapError({ +], Stdlib_Result.mapError({ TAG: "Ok", _0: 5 }, i => Math.imul(i, 3)), eq, { @@ -76,7 +76,7 @@ Test.run([ 42 ], "mapError: if error, apply f" -], Result.mapError({ +], Stdlib_Result.mapError({ TAG: "Error", _0: 5 }, i => Math.imul(i, 3)), eq, { @@ -92,7 +92,7 @@ Test.run([ 25 ], "all" -], Result.all([]), eq, { +], Stdlib_Result.all([]), eq, { TAG: "Ok", _0: [] }); @@ -105,7 +105,7 @@ Test.run([ 25 ], "all" -], Result.all([ +], Stdlib_Result.all([ { TAG: "Ok", _0: 1 @@ -135,7 +135,7 @@ Test.run([ 25 ], "all" -], Result.all([ +], Stdlib_Result.all([ { TAG: "Ok", _0: 1 @@ -157,7 +157,7 @@ Test.run([ 25 ], "all" -], Result.all2([ +], Stdlib_Result.all2([ { TAG: "Ok", _0: 1 @@ -182,7 +182,7 @@ Test.run([ 25 ], "all" -], Result.all2([ +], Stdlib_Result.all2([ { TAG: "Ok", _0: 1 @@ -204,7 +204,7 @@ Test.run([ 25 ], "all" -], Result.all3([ +], Stdlib_Result.all3([ { TAG: "Ok", _0: 1 @@ -234,7 +234,7 @@ Test.run([ 25 ], "all" -], Result.all3([ +], Stdlib_Result.all3([ { TAG: "Ok", _0: 1 @@ -260,7 +260,7 @@ Test.run([ 25 ], "all" -], Result.all4([ +], Stdlib_Result.all4([ { TAG: "Ok", _0: 1 @@ -295,7 +295,7 @@ Test.run([ 25 ], "all" -], Result.all4([ +], Stdlib_Result.all4([ { TAG: "Ok", _0: 1 diff --git a/tests/tests/src/core/Core_TempTests.mjs b/tests/tests/src/core/Core_TempTests.mjs index 4478b1d59e..7b189a747f 100644 --- a/tests/tests/src/core/Core_TempTests.mjs +++ b/tests/tests/src/core/Core_TempTests.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Int from "rescript/lib/es6/Int.js"; -import * as Dict from "rescript/lib/es6/Dict.js"; -import * as $$JSON from "rescript/lib/es6/JSON.js"; -import * as $$Array from "rescript/lib/es6/Array.js"; -import * as Float from "rescript/lib/es6/Float.js"; -import * as $$BigInt from "rescript/lib/es6/BigInt.js"; -import * as Option from "rescript/lib/es6/Option.js"; +import * as Stdlib_Int from "rescript/lib/es6/Stdlib_Int.js"; +import * as Stdlib_Dict from "rescript/lib/es6/Stdlib_Dict.js"; +import * as Stdlib_JSON from "rescript/lib/es6/Stdlib_JSON.js"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; +import * as Stdlib_Float from "rescript/lib/es6/Stdlib_Float.js"; +import * as Stdlib_BigInt from "rescript/lib/es6/Stdlib_BigInt.js"; +import * as Stdlib_Option from "rescript/lib/es6/Stdlib_Option.js"; import * as Core_IntlTests from "./intl/Core_IntlTests.mjs"; import * as Primitive_bigint from "rescript/lib/es6/Primitive_bigint.js"; import * as Primitive_option from "rescript/lib/es6/Primitive_option.js"; @@ -24,7 +24,7 @@ let array = [ 4 ]; -console.info($$Array.reduce(array.map(x => (x << 1)), 0, (a, b) => a + b | 0)); +console.info(Stdlib_Array.reduce(array.map(x => (x << 1)), 0, (a, b) => a + b | 0)); console.info(typeof array); @@ -50,7 +50,7 @@ dict["foo"] = "bar"; let dict2 = Object.assign({}, dict); -Dict.$$delete(dict2, "foo"); +Stdlib_Dict.$$delete(dict2, "foo"); console.log(dict, dict2); @@ -85,9 +85,9 @@ console.log((10.2).toFixed(2)); console.log((10).toFixed(2)); -console.log(Int.fromString("0", undefined)); +console.log(Stdlib_Int.fromString("0", undefined)); -console.log(Float.fromString("0.1")); +console.log(Stdlib_Float.fromString("0.1")); console.info(""); @@ -97,14 +97,14 @@ console.info("---"); let json = JSON.parse("{\"foo\": \"bar\"}"); -let json$1 = $$JSON.Classify.classify(json); +let json$1 = Stdlib_JSON.Classify.classify(json); let tmp; if (typeof json$1 !== "object" || json$1.TAG !== "Object") { tmp = undefined; } else { - let value = $$JSON.Classify.classify(json$1._0["foo"]); + let value = Stdlib_JSON.Classify.classify(json$1._0["foo"]); tmp = typeof value !== "object" || value.TAG !== "String" ? undefined : value._0; } @@ -207,11 +207,11 @@ let result = regex.exec(string); let result$1 = (result == null) ? undefined : Primitive_option.some(result); -console.log(Option.map(result$1, prim => prim.input)); +console.log(Stdlib_Option.map(result$1, prim => prim.input)); -console.log(Option.map(result$1, prim => prim.index)); +console.log(Stdlib_Option.map(result$1, prim => prim.index)); -console.log(Option.map(result$1, prim => prim.slice(1))); +console.log(Stdlib_Option.map(result$1, prim => prim.slice(1))); console.info(""); @@ -274,7 +274,7 @@ if (globalThis.hello !== undefined) { let z = 1.2 % 1.4; -let intFromBigInt = $$BigInt.toInt(BigInt("10000000000")); +let intFromBigInt = Stdlib_BigInt.toInt(BigInt("10000000000")); console.log({ bar: "1" @@ -282,15 +282,15 @@ console.log({ let Bugfix = {}; -console.log(Int.fromString("1231231", undefined)); +console.log(Stdlib_Int.fromString("1231231", undefined)); -console.log(Int.fromString("12.22", undefined)); +console.log(Stdlib_Int.fromString("12.22", undefined)); -console.log(Int.fromString("99999999999999999", undefined)); +console.log(Stdlib_Int.fromString("99999999999999999", undefined)); -console.log(Int.fromString("99999999999999999", undefined)); +console.log(Stdlib_Int.fromString("99999999999999999", undefined)); -console.log(Int.fromString("010101", 2)); +console.log(Stdlib_Int.fromString("010101", 2)); let _collator = Core_IntlTests._collator; diff --git a/tests/tests/src/core/Core_TypedArrayTests.mjs b/tests/tests/src/core/Core_TypedArrayTests.mjs index fd7fce21da..a8b57b0d95 100644 --- a/tests/tests/src/core/Core_TypedArrayTests.mjs +++ b/tests/tests/src/core/Core_TypedArrayTests.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as Option from "rescript/lib/es6/Option.js"; +import * as Stdlib_Option from "rescript/lib/es6/Stdlib_Option.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; let eq = Primitive_object.equal; @@ -50,7 +50,7 @@ function areSame(x, y) { return x.toString() === y.toString(); } -assertTrue("fromArray", () => areSame(Option.getExn(new BigInt64Array([ +assertTrue("fromArray", () => areSame(Stdlib_Option.getExn(new BigInt64Array([ num1, num2 ])[1], undefined), num2)); @@ -58,25 +58,25 @@ assertTrue("fromArray", () => areSame(Option.getExn(new BigInt64Array([ assertTrue("fromBuffer", () => { let x = new BigInt64Array(new ArrayBuffer(16)); x[1] = num2; - return areSame(Option.getExn(x[1], undefined), num2); + return areSame(Stdlib_Option.getExn(x[1], undefined), num2); }); assertWillThrow("fromBuffer when too short can throw when used", () => { let x = new BigInt64Array(new ArrayBuffer(1)); x[0] = num1; - areSame(Option.getExn(x[0], undefined), num1); + areSame(Stdlib_Option.getExn(x[0], undefined), num1); }); assertTrue("fromBufferWithRange", () => { let x = new BigInt64Array(new ArrayBuffer(16), 0, 1); x[0] = num1; - return areSame(Option.getExn(x[0], undefined), num1); + return areSame(Stdlib_Option.getExn(x[0], undefined), num1); }); assertWillThrow("fromBufferWithRange is unsafe, out of range", () => { let x = new BigInt64Array(new ArrayBuffer(16), 13, 1); x[0] = num1; - areSame(Option.getExn(x[0], undefined), num1); + areSame(Stdlib_Option.getExn(x[0], undefined), num1); }); assertTrue("fromLength is NOT in bytes", () => { diff --git a/tests/tests/src/core/Test.mjs b/tests/tests/src/core/Test.mjs index c24abc1c99..936183ec24 100644 --- a/tests/tests/src/core/Test.mjs +++ b/tests/tests/src/core/Test.mjs @@ -3,7 +3,7 @@ import * as Fs from "fs"; import * as Path from "path"; import * as Util from "util"; -import * as Option from "rescript/lib/es6/Option.js"; +import * as Stdlib_Option from "rescript/lib/es6/Stdlib_Option.js"; import * as CodeFrame from "@babel/code-frame"; let dirname = (new URL('.', import.meta.url).pathname); @@ -13,7 +13,7 @@ function print(value) { if (match === "object" || match === "bigint") { return Util.inspect(value); } else if (match === "string") { - return Option.getExn(JSON.stringify(value), undefined); + return Stdlib_Option.getExn(JSON.stringify(value), undefined); } else { return String(value); } diff --git a/tests/tests/src/core/intl/Core_IntlTests.mjs b/tests/tests/src/core/intl/Core_IntlTests.mjs index 3929756a37..eb96c87316 100644 --- a/tests/tests/src/core/intl/Core_IntlTests.mjs +++ b/tests/tests/src/core/intl/Core_IntlTests.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Exn from "rescript/lib/es6/Exn.js"; -import * as $$Error from "rescript/lib/es6/Error.js"; -import * as Option from "rescript/lib/es6/Option.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; +import * as Stdlib_Error from "rescript/lib/es6/Stdlib_Error.js"; +import * as Stdlib_Option from "rescript/lib/es6/Stdlib_Option.js"; import * as Primitive_option from "rescript/lib/es6/Primitive_option.js"; import * as Core_Intl_LocaleTest from "./Core_Intl_LocaleTest.mjs"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; @@ -29,7 +29,7 @@ try { console.log(Intl.getCanonicalLocales("bloop")); } catch (raw_e) { let e = Primitive_exceptions.internalToException(raw_e); - if (e.RE_EXN_ID === Exn.$$Error) { + if (e.RE_EXN_ID === Stdlib_Exn.$$Error) { console.error(e._1); } else { throw e; @@ -45,7 +45,7 @@ try { console.log(Intl.supportedValuesOf("unit")); } catch (raw_e$1) { let e$1 = Primitive_exceptions.internalToException(raw_e$1); - if (e$1.RE_EXN_ID === Exn.$$Error) { + if (e$1.RE_EXN_ID === Stdlib_Exn.$$Error) { console.error(e$1._1); } else { throw e$1; @@ -57,9 +57,9 @@ try { console.error("Shouldn't have been hit"); } catch (raw_e$2) { let e$2 = Primitive_exceptions.internalToException(raw_e$2); - if (e$2.RE_EXN_ID === Exn.$$Error) { + if (e$2.RE_EXN_ID === Stdlib_Exn.$$Error) { let e$3 = e$2._1; - let message = Option.map(e$3.message, prim => prim.toLowerCase()); + let message = Stdlib_Option.map(e$3.message, prim => prim.toLowerCase()); let exit = 0; if (message === "invalid key : someinvalidkey") { console.log("Caught expected error"); @@ -72,7 +72,7 @@ try { } } else { - let e$4 = $$Error.fromException(e$2); + let e$4 = Stdlib_Error.fromException(e$2); if (e$4 !== undefined) { throw Primitive_option.valFromOption(e$4); } diff --git a/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.mjs b/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.mjs index 63c1f22d6a..988d5795bb 100644 --- a/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.mjs +++ b/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Primitive_option from "rescript/lib/es6/Primitive_option.js"; -import * as Intl_NumberFormat_Grouping from "rescript/lib/es6/Intl_NumberFormat_Grouping.js"; +import * as Stdlib_Intl_NumberFormat_Grouping from "rescript/lib/es6/Stdlib_Intl_NumberFormat_Grouping.js"; console.log("---"); @@ -45,7 +45,7 @@ let options = sigFormatter.resolvedOptions(); console.log(options); -console.log(Intl_NumberFormat_Grouping.parseJsValue(options.useGrouping)); +console.log(Stdlib_Intl_NumberFormat_Grouping.parseJsValue(options.useGrouping)); export { currencyFormatter, diff --git a/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.res b/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.res index 8a126cec88..1d7faf679b 100644 --- a/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.res +++ b/tests/tests/src/core/intl/Core_Intl_NumberFormatTest.res @@ -40,4 +40,4 @@ let sigFormatter = Intl.NumberFormat.make( let options = sigFormatter->Intl.NumberFormat.resolvedOptions Console.log(options) -options.useGrouping->Intl_NumberFormat.Grouping.parseJsValue->Console.log +options.useGrouping->Intl.NumberFormat.Grouping.parseJsValue->Console.log diff --git a/tests/tests/src/custom_error_test.mjs b/tests/tests/src/custom_error_test.mjs index 8954226c64..ab89dd104f 100644 --- a/tests/tests/src/custom_error_test.mjs +++ b/tests/tests/src/custom_error_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Exn from "rescript/lib/es6/Exn.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; function test_js_error() { @@ -9,7 +9,7 @@ function test_js_error() { e = JSON.parse(" {\"x\" : }"); } catch (raw_err) { let err = Primitive_exceptions.internalToException(raw_err); - if (err.RE_EXN_ID === Exn.$$Error) { + if (err.RE_EXN_ID === Stdlib_Exn.$$Error) { console.log(err._1.stack); return; } @@ -23,7 +23,7 @@ function test_js_error2() { return JSON.parse(" {\"x\" : }"); } catch (raw_e) { let e = Primitive_exceptions.internalToException(raw_e); - if (e.RE_EXN_ID === Exn.$$Error) { + if (e.RE_EXN_ID === Stdlib_Exn.$$Error) { console.log(e._1.stack); throw e; } @@ -37,7 +37,7 @@ function example1() { v = JSON.parse(" {\"x\" }"); } catch (raw_err) { let err = Primitive_exceptions.internalToException(raw_err); - if (err.RE_EXN_ID === Exn.$$Error) { + if (err.RE_EXN_ID === Stdlib_Exn.$$Error) { console.log(err._1.stack); return; } @@ -51,7 +51,7 @@ function example2() { return JSON.parse(" {\"x\"}"); } catch (raw_exn) { let exn = Primitive_exceptions.internalToException(raw_exn); - if (exn.RE_EXN_ID === Exn.$$Error) { + if (exn.RE_EXN_ID === Stdlib_Exn.$$Error) { return; } throw exn; diff --git a/tests/tests/src/exception_raise_test.mjs b/tests/tests/src/exception_raise_test.mjs index 4f1f9dd08f..b33c0c2659 100644 --- a/tests/tests/src/exception_raise_test.mjs +++ b/tests/tests/src/exception_raise_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; -import * as Exn from "rescript/lib/es6/Exn.js"; import * as Belt_List from "rescript/lib/es6/Belt_List.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; let Local = /* @__PURE__ */Primitive_exceptions.create("Exception_raise_test.Local"); @@ -89,7 +89,7 @@ try { a0 = (function (){throw 2} ()); } catch (raw_x$3) { let x$3 = Primitive_exceptions.internalToException(raw_x$3); - if (x$3.RE_EXN_ID === A || x$3.RE_EXN_ID === Exn.$$Error) { + if (x$3.RE_EXN_ID === A || x$3.RE_EXN_ID === Stdlib_Exn.$$Error) { a0 = x$3._1; } else { throw { @@ -144,7 +144,7 @@ let suites = { hd: [ "File \"exception_raise_test.res\", line 123, characters 6-13", () => { - if (a1.RE_EXN_ID === Exn.$$Error) { + if (a1.RE_EXN_ID === Stdlib_Exn.$$Error) { return { TAG: "Eq", _0: a1._1, @@ -179,7 +179,7 @@ try { ((()=>{throw 2})()); } catch (raw_e$2) { let e = Primitive_exceptions.internalToException(raw_e$2); - eq("File \"exception_raise_test.res\", line 137, characters 10-17", Exn.asJsExn(e) !== undefined, true); + eq("File \"exception_raise_test.res\", line 137, characters 10-17", Stdlib_Exn.asJsExn(e) !== undefined, true); } try { @@ -189,7 +189,7 @@ try { }; } catch (raw_e$3) { let e$1 = Primitive_exceptions.internalToException(raw_e$3); - eq("File \"exception_raise_test.res\", line 141, characters 10-17", Exn.asJsExn(e$1) !== undefined, false); + eq("File \"exception_raise_test.res\", line 141, characters 10-17", Stdlib_Exn.asJsExn(e$1) !== undefined, false); } function fff0(x, g) { diff --git a/tests/tests/src/exception_value_test.mjs b/tests/tests/src/exception_value_test.mjs index 4b84d820d4..9a7f8c8b4d 100644 --- a/tests/tests/src/exception_value_test.mjs +++ b/tests/tests/src/exception_value_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Exn from "rescript/lib/es6/Exn.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; function f() { @@ -60,7 +60,7 @@ function test_js_error2() { return JSON.parse(" {\"x\" : }"); } catch (raw_e) { let e = Primitive_exceptions.internalToException(raw_e); - if (e.RE_EXN_ID === Exn.$$Error) { + if (e.RE_EXN_ID === Stdlib_Exn.$$Error) { console.log(e._1.stack); throw e; } diff --git a/tests/tests/src/js_exception_catch_test.mjs b/tests/tests/src/js_exception_catch_test.mjs index 040fd2c6ca..a77b7c47e7 100644 --- a/tests/tests/src/js_exception_catch_test.mjs +++ b/tests/tests/src/js_exception_catch_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; -import * as Exn from "rescript/lib/es6/Exn.js"; import * as Pervasives from "rescript/lib/es6/Pervasives.js"; +import * as Stdlib_Exn from "rescript/lib/es6/Stdlib_Exn.js"; import * as Primitive_exceptions from "rescript/lib/es6/Primitive_exceptions.js"; let suites = { @@ -56,7 +56,7 @@ try { exit = 1; } catch (raw_x) { let x = Primitive_exceptions.internalToException(raw_x); - if (x.RE_EXN_ID === Exn.$$Error) { + if (x.RE_EXN_ID === Stdlib_Exn.$$Error) { add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", () => ({ TAG: "Ok", _0: true @@ -107,7 +107,7 @@ function test(f) { } else { return "C"; } - } else if (e.RE_EXN_ID === Exn.$$Error) { + } else if (e.RE_EXN_ID === Stdlib_Exn.$$Error) { return "Js_error"; } else { return "Any"; @@ -169,7 +169,7 @@ eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(() => }; }), "C_any"); -eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(() => Exn.raiseError("x")), "Js_error"); +eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(() => Stdlib_Exn.raiseError("x")), "Js_error"); eq("File \"js_exception_catch_test.res\", line 54, characters 5-12", test(() => Pervasives.failwith("x")), "Any"); diff --git a/tests/tests/src/json_decorders.mjs b/tests/tests/src/json_decorders.mjs index 781dfca57d..f3d6b108d3 100644 --- a/tests/tests/src/json_decorders.mjs +++ b/tests/tests/src/json_decorders.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as $$Array from "rescript/lib/es6/Array.js"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; function decodeUser(json) { if (typeof json !== "object" || Array.isArray(json)) { @@ -46,7 +46,7 @@ function decodeGroup(json) { return { id: id, name: name, - users: $$Array.filterMap(users, decodeUser) + users: Stdlib_Array.filterMap(users, decodeUser) }; } diff --git a/tests/tests/src/module_missing_conversion.mjs b/tests/tests/src/module_missing_conversion.mjs index 7c833511f5..c73348c99a 100644 --- a/tests/tests/src/module_missing_conversion.mjs +++ b/tests/tests/src/module_missing_conversion.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as $$String from "rescript/lib/es6/String.js"; import * as Belt_Array from "rescript/lib/es6/Belt_Array.js"; +import * as Stdlib_String from "rescript/lib/es6/Stdlib_String.js"; function f(x) { return x; @@ -83,7 +83,7 @@ let XX = { f: f }; -let u = [$$String]; +let u = [Stdlib_String]; let hh = "x".length; diff --git a/tests/tests/src/module_parameter_test.mjs b/tests/tests/src/module_parameter_test.mjs index 18610c8278..1f9d899093 100644 --- a/tests/tests/src/module_parameter_test.mjs +++ b/tests/tests/src/module_parameter_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; -import * as $$String from "rescript/lib/es6/String.js"; +import * as Stdlib_String from "rescript/lib/es6/Stdlib_String.js"; function u(v) { return v; } -let s = $$String; +let s = Stdlib_String; let N = { s: s diff --git a/tests/tests/src/test_pervasive.mjs b/tests/tests/src/test_pervasive.mjs index 0b80ec595f..5892a7ca6d 100644 --- a/tests/tests/src/test_pervasive.mjs +++ b/tests/tests/src/test_pervasive.mjs @@ -110,9 +110,7 @@ let Pervasives$1 = { bool_of_string: Pervasives.bool_of_string, bool_of_string_opt: Pervasives.bool_of_string_opt, int_of_string_opt: Pervasives.int_of_string_opt, - $at: Pervasives.$at, - panic: Pervasives.panic, - assertEqual: Pervasives.assertEqual + $at: Pervasives.$at }; function a0(prim) { diff --git a/tests/tests/src/test_pervasives3.mjs b/tests/tests/src/test_pervasives3.mjs index 3b414a88c5..b124938e7d 100644 --- a/tests/tests/src/test_pervasives3.mjs +++ b/tests/tests/src/test_pervasives3.mjs @@ -23,8 +23,6 @@ let Pervasives$1 = { bool_of_string_opt: Pervasives.bool_of_string_opt, int_of_string_opt: Pervasives.int_of_string_opt, $at: Pervasives.$at, - panic: Pervasives.panic, - assertEqual: Pervasives.assertEqual, length: Belt_List.length, size: Belt_List.size, head: Belt_List.head, diff --git a/tests/tools_tests/package-lock.json b/tests/tools_tests/package-lock.json index 8118ee2f99..9d3242c476 100644 --- a/tests/tools_tests/package-lock.json +++ b/tests/tools_tests/package-lock.json @@ -14,8 +14,7 @@ } }, "../..": { - "name": "rescript", - "version": "12.0.0-alpha.8", + "version": "12.0.0-alpha.9", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "bin": {