diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 8f3a559fa..057873902 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -13,7 +13,7 @@ let makePathsForModule ~projectFilesAndPaths ~dependenciesFilesAndPaths = let getReScriptVersion () = (* TODO: Include patch stuff when needed *) - let defaultVersion = (10, 1) in + let defaultVersion = (11, 0) in try let value = Sys.getenv "RESCRIPT_VERSION" in let version = diff --git a/analysis/tests/package-lock.json b/analysis/tests/package-lock.json index 946ef95e9..d10af3afd 100644 --- a/analysis/tests/package-lock.json +++ b/analysis/tests/package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "dependencies": { - "rescript": "11.0.0-alpha.1" + "rescript": "11.0.1" }, "devDependencies": { - "@rescript/react": "^0.11.0-rc.3" + "@rescript/react": "0.12.0" } }, "node_modules/@rescript/react": { - "version": "0.11.0-rc.3", - "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.11.0-rc.3.tgz", - "integrity": "sha512-ieG8mgZ72yiBWidoIAbSr7ZQZHyzNjaILGNHro7XUXlr/Y2MyQfgB3fyqN2XXZ5SCQ8JXmq03ajIpOn6IanV6A==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0.tgz", + "integrity": "sha512-EBLsf5rD7sJOjgfLLGwuLw/hONszc3UtYnIVgv7OdTyUNR41/m4deVm62PI0agvr3kWakXz4KchKRSd+19/bRA==", "dev": true, "peerDependencies": { "react": ">=18.0.0", @@ -69,14 +69,17 @@ } }, "node_modules/rescript": { - "version": "11.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.0-alpha.1.tgz", - "integrity": "sha512-+01rdTX9FCOZrEJFVrk2XRgrIlGLf93EKsNwoW5iq0jQiKcYGCdHeSbJvVYF+cximgm+CmWhSkR42l+Il6t12A==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.1.tgz", + "integrity": "sha512-7T4PRp/d0+CBNnY6PYKffFqo9tGZlvnZpboF/n+8SKS+JZ6VvXJO7W538VPZXf3EYx1COGAWWvkF9e/HgSAqHg==", "hasInstallScript": true, "bin": { "bsc": "bsc", "bstracing": "lib/bstracing", "rescript": "rescript" + }, + "engines": { + "node": ">=10" } }, "node_modules/scheduler": { @@ -92,9 +95,9 @@ }, "dependencies": { "@rescript/react": { - "version": "0.11.0-rc.3", - "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.11.0-rc.3.tgz", - "integrity": "sha512-ieG8mgZ72yiBWidoIAbSr7ZQZHyzNjaILGNHro7XUXlr/Y2MyQfgB3fyqN2XXZ5SCQ8JXmq03ajIpOn6IanV6A==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0.tgz", + "integrity": "sha512-EBLsf5rD7sJOjgfLLGwuLw/hONszc3UtYnIVgv7OdTyUNR41/m4deVm62PI0agvr3kWakXz4KchKRSd+19/bRA==", "dev": true, "requires": {} }, @@ -137,9 +140,9 @@ } }, "rescript": { - "version": "11.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.0-alpha.1.tgz", - "integrity": "sha512-+01rdTX9FCOZrEJFVrk2XRgrIlGLf93EKsNwoW5iq0jQiKcYGCdHeSbJvVYF+cximgm+CmWhSkR42l+Il6t12A==" + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.1.tgz", + "integrity": "sha512-7T4PRp/d0+CBNnY6PYKffFqo9tGZlvnZpboF/n+8SKS+JZ6VvXJO7W538VPZXf3EYx1COGAWWvkF9e/HgSAqHg==" }, "scheduler": { "version": "0.23.0", diff --git a/analysis/tests/package.json b/analysis/tests/package.json index c3ef1f6b9..a45384296 100644 --- a/analysis/tests/package.json +++ b/analysis/tests/package.json @@ -5,9 +5,9 @@ }, "private": true, "devDependencies": { - "@rescript/react": "^0.11.0-rc.3" + "@rescript/react": "0.12.0" }, "dependencies": { - "rescript": "11.0.0-alpha.1" + "rescript": "11.0.1" } } diff --git a/analysis/tests/src/Auto.res b/analysis/tests/src/Auto.res index c33d1614b..52a0b7c4e 100644 --- a/analysis/tests/src/Auto.res +++ b/analysis/tests/src/Auto.res @@ -1,4 +1,4 @@ -open! Belt +open! ShadowedBelt let m = List.map -// ^hov \ No newline at end of file +// ^hov diff --git a/analysis/tests/src/Debug.res b/analysis/tests/src/Debug.res index 30365b3e9..6e54e40f4 100644 --- a/analysis/tests/src/Debug.res +++ b/analysis/tests/src/Debug.res @@ -1,7 +1,7 @@ // turn on by adding this comment // ^db+ -let _ = Belt.List.map -// ^def +let _ = ShadowedBelt.List.map +// ^def let _ = List.map // ^def diff --git a/analysis/tests/src/Definition.res b/analysis/tests/src/Definition.res index 4d18334ca..530f7cf7f 100644 --- a/analysis/tests/src/Definition.res +++ b/analysis/tests/src/Definition.res @@ -15,7 +15,7 @@ type typeInner = Inner.tInner let m1 = List.map // ^hov -open Belt +open ShadowedBelt let m2 = List.map // ^hov diff --git a/analysis/tests/src/ShadowedBelt.res b/analysis/tests/src/ShadowedBelt.res new file mode 100644 index 000000000..143c0e915 --- /dev/null +++ b/analysis/tests/src/ShadowedBelt.res @@ -0,0 +1,3 @@ +module List = { + let map = (l, fn) => List.map(fn, l) +} diff --git a/analysis/tests/src/expected/Auto.res.txt b/analysis/tests/src/expected/Auto.res.txt index eb9d540e2..78ec26d7f 100644 --- a/analysis/tests/src/expected/Auto.res.txt +++ b/analysis/tests/src/expected/Auto.res.txt @@ -1,3 +1,3 @@ Hover src/Auto.res 2:13 -{"contents": {"kind": "markdown", "value": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype Belt.List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22belt_List.mli%22%2C34%2C0%5D)\n\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}} +{"contents": {"kind": "markdown", "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```"}} diff --git a/analysis/tests/src/expected/Completion.res.txt b/analysis/tests/src/expected/Completion.res.txt index a959525bb..5321663b8 100644 --- a/analysis/tests/src/expected/Completion.res.txt +++ b/analysis/tests/src/expected/Completion.res.txt @@ -11,66 +11,66 @@ Path MyList.m "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n Equivalent to:\n\n ```res\n map(someList, f)->reverse\n ```\n\n ```res example\n list{3, 4, 5}->Belt.List.mapReverse(x => x * x) /* list{25, 16, 9} */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nEquivalent to:\n\n```res\nmap(someList, f)->reverse\n```\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) /* list{25, 16, 9} */\n```\n"} }, { "label": "makeBy", "kind": 12, "tags": [], "detail": "(int, int => 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\nReturn a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n```res example\nBelt.List.makeBy(5, i => i) // list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) // list{0, 1, 4, 9, 16}\n```\n"} + "documentation": {"kind": "markdown", "value": "\nReturn a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) // list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) // list{0, 1, 4, 9, 16}\n```\n"} }, { "label": "make", "kind": 12, "tags": [], "detail": "(int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n ```res example\n Belt.List.make(3, 1) // list{1, 1, 1}\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nReturns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) // list{1, 1, 1}\n```\n"} }, { "label": "mapReverse2U", "kind": 12, "tags": [], - "detail": "(t<'a>, t<'b>, (. 'a, 'b) => 'c) => t<'c>", + "detail": "(t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", "documentation": {"kind": "markdown", "value": " Uncurried version of [mapReverse2](#mapReverse2). "} }, { "label": "map", "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nReturns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n```\n"} }, { "label": "mapWithIndexU", "kind": 12, "tags": [], - "detail": "(t<'a>, (. int, 'a) => 'b) => t<'b>", + "detail": "(t<'a>, (int, 'a) => 'b) => t<'b>", "documentation": {"kind": "markdown", "value": " Uncurried version of [mapWithIndex](#mapWithIndex). "} }, { "label": "mapU", "kind": 12, "tags": [], - "detail": "(t<'a>, (. 'a) => 'b) => t<'b>", + "detail": "(t<'a>, 'a => 'b) => t<'b>", "documentation": {"kind": "markdown", "value": " Uncurried version of [map](#map). "} }, { "label": "makeByU", "kind": 12, "tags": [], - "detail": "(int, (. int) => 'a) => t<'a>", + "detail": "(int, int => 'a) => t<'a>", "documentation": {"kind": "markdown", "value": " Uncurried version of [makeBy](#makeBy) "} }, { "label": "mapReverse2", "kind": 12, "tags": [], "detail": "(t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "documentation": {"kind": "markdown", "value": "\n Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n ```res example\n\n Belt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) // list{4, 2}\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nEquivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\n\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) // list{4, 2}\n```\n"} }, { "label": "mapWithIndex", "kind": 12, "tags": [], "detail": "(t<'a>, (int, 'a) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n Applies `f` to each element of `someList`.\n Function `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n ```res example\n list{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) // list{1, 3, 5}\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) // list{1, 3, 5}\n```\n"} }, { "label": "mapReverseU", "kind": 12, "tags": [], - "detail": "(t<'a>, (. 'a) => 'b) => t<'b>", + "detail": "(t<'a>, 'a => 'b) => t<'b>", "documentation": {"kind": "markdown", "value": " Uncurried version of [mapReverse](#mapReverse). "} }] @@ -169,9 +169,9 @@ Path Array. }, { "label": "make_float", "kind": 12, - "tags": [], + "tags": [1], "detail": "int => array", - "documentation": {"kind": "markdown", "value": " @deprecated [Array.make_float] is an alias for {!Array.create_float}. "} + "documentation": {"kind": "markdown", "value": "Deprecated: Use Array.create_float instead.\n\n @deprecated [Array.make_float] is an alias for {!Array.create_float}. "} }, { "label": "fold_right", "kind": 12, @@ -253,9 +253,9 @@ Path Array. }, { "label": "create_matrix", "kind": 12, - "tags": [], + "tags": [1], "detail": "(int, int, 'a) => array>", - "documentation": {"kind": "markdown", "value": " @deprecated [Array.create_matrix] is an alias for {!Array.make_matrix}. "} + "documentation": {"kind": "markdown", "value": "Deprecated: Use Array.make_matrix instead.\n\n @deprecated [Array.create_matrix] is an alias for {!Array.make_matrix}. "} }, { "label": "create_float", "kind": 12, @@ -265,9 +265,9 @@ Path Array. }, { "label": "create", "kind": 12, - "tags": [], + "tags": [1], "detail": "(int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": " @deprecated [Array.create] is an alias for {!Array.make}. "} + "documentation": {"kind": "markdown", "value": "Deprecated: Use Array.make instead.\n\n @deprecated [Array.create] is an alias for {!Array.make}. "} }, { "label": "init", "kind": 12, @@ -335,9 +335,9 @@ Path Array.m }, { "label": "make_float", "kind": 12, - "tags": [], + "tags": [1], "detail": "int => array", - "documentation": {"kind": "markdown", "value": " @deprecated [Array.make_float] is an alias for {!Array.create_float}. "} + "documentation": {"kind": "markdown", "value": "Deprecated: Use Array.create_float instead.\n\n @deprecated [Array.make_float] is an alias for {!Array.create_float}. "} }, { "label": "map", "kind": 12, @@ -411,13 +411,13 @@ Path Js.Array2.m "kind": 12, "tags": [], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} }, { "label": "Js.Array2.map", "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} }] Complete src/Completion.res 29:13 @@ -434,7 +434,7 @@ Path Js.String2.toU "kind": 12, "tags": [], "detail": "t => t", - "documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n```res example\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```\n"} }] Complete src/Completion.res 34:8 @@ -451,14 +451,14 @@ Path Belt.Option.e "label": "Belt.Option.eqU", "kind": 12, "tags": [], - "detail": "(option<'a>, option<'b>, (. 'a, 'b) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n Uncurried version of `eq`\n"} + "detail": "(option<'a>, option<'b>, ('a, 'b) => bool) => bool", + "documentation": {"kind": "markdown", "value": "\nUncurried version of `eq`\n"} }, { "label": "Belt.Option.eq", "kind": 12, "tags": [], "detail": "(option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n Evaluates two optional values for equality with respect to a predicate\n function. If both `optValue1` and `optValue2` are `None`, returns `true`.\n If one of the arguments is `Some(value)` and the other is `None`, returns\n `false`.\n\n If arguments are `Some(value1)` and `Some(value2)`, returns the result of\n `predicate(value1, value2)`; the predicate function must return a bool.\n\n ```res example\n let clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\n open Belt.Option\n\n eq(Some(3), Some(15), clockEqual) /* true */\n\n eq(Some(3), None, clockEqual) /* false */\n\n eq(None, Some(3), clockEqual) /* false */\n\n eq(None, None, clockEqual) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nEvaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) /* true */\n\neq(Some(3), None, clockEqual) /* false */\n\neq(None, Some(3), clockEqual) /* false */\n\neq(None, None, clockEqual) /* true */\n```\n"} }] Complete src/Completion.res 44:7 @@ -503,12 +503,12 @@ Path Js.Dict.u "kind": 12, "tags": [], "detail": "(t<'a>, key) => 'a", - "documentation": {"kind": "markdown", "value": "\n`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n```res example\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```\n"} }, { "label": "unsafeDeleteKey", "kind": 12, "tags": [], - "detail": "(. t, string) => unit", + "detail": "(t, string) => unit", "documentation": {"kind": "markdown", "value": " Experimental internal function "} }] @@ -765,6 +765,7 @@ Path Objects.Rec.recordVal Complete src/Completion.res 120:7 posCursor:[120:7] posNoWhite:[120:6] Found expr:[119:11->123:1] +posCursor:[120:7] posNoWhite:[120:6] Found expr:[119:11->123:1] 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] @@ -918,13 +919,13 @@ Path Js.n "label": "nullable", "kind": 22, "tags": [], - "detail": "type nullable<+'a>", - "documentation": {"kind": "markdown", "value": "\n A value of this type can be undefined, null or 'a. This type is equivalent to Js.Null_undefined.t.\n"} + "detail": "type nullable<'a> = Value('a) | Null | Undefined", + "documentation": null }, { "label": "null", "kind": 22, "tags": [], - "detail": "type null<+'a>", + "detail": "type null<'a> = Value('a) | Null", "documentation": {"kind": "markdown", "value": "\n Nullable value of this type can be either null or 'a. This type is equivalent to Js.Null.t.\n"} }] @@ -1285,6 +1286,7 @@ Path SomeLocal Complete src/Completion.res 275:15 posCursor:[275:15] posNoWhite:[275:14] Found expr:[274:11->278:1] +posCursor:[275:15] posNoWhite:[275:14] Found expr:[274:11->278:1] posCursor:[275:15] posNoWhite:[275:14] Found expr:[275:5->277:3] posCursor:[275:15] posNoWhite:[275:14] Found expr:[275:13->275:15] Pexp_ident _w:[275:13->275:15] @@ -1597,14 +1599,8 @@ Resolved opens 3 pervasives Completion.res Completion.res ContextPath Value[withCallback](~a) ContextPath Value[withCallback] Path withCallback -Found type for function (~b: int) => int -[{ - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +Found type for function int +[] Complete src/Completion.res 329:21 posCursor:[329:21] posNoWhite:[329:20] Found expr:[329:3->329:21] @@ -1630,6 +1626,7 @@ posCursor:[336:26] posNoWhite:[336:25] Found expr:[333:3->346:23] JSX 333:6] onClick[334:4->334:11]=...[334:13->346:23]> _children:None posCursor:[336:26] posNoWhite:[336:25] Found expr:[334:13->346:23] posCursor:[336:26] posNoWhite:[336:25] Found expr:[334:13->338:6] +posCursor:[336:26] posNoWhite:[336:25] Found expr:[334:13->338:6] posCursor:[336:26] posNoWhite:[336:25] Found expr:[335:6->338:5] posCursor:[336:26] posNoWhite:[336:25] Found expr:[336:16->338:5] posCursor:[336:26] posNoWhite:[336:25] Found pattern:[336:20->338:5] @@ -1685,7 +1682,7 @@ Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder Package opens Pervasives.JsxModules.place holder Resolved opens 3 pervasives Completion.res Completion.res Path ReactDOM.domProps -Path Pervasives.JsxDOM.domProps +Path PervasivesU.JsxDOM.domProps {"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} Hover src/Completion.res 349:17 @@ -1733,6 +1730,7 @@ posCursor:[355:23] posNoWhite:[355:22] Found expr:[355:12->355:23] Complete src/Completion.res 362:8 posCursor:[362:8] posNoWhite:[362:7] Found expr:[360:8->365:3] +posCursor:[362:8] posNoWhite:[362:7] Found expr:[360:8->365:3] posCursor:[362:8] posNoWhite:[362:7] Found pattern:[362:7->364:5] posCursor:[362:8] posNoWhite:[362:7] Found pattern:[362:7->362:8] Ppat_construct T:[362:7->362:8] @@ -1782,6 +1780,7 @@ Path T Complete src/Completion.res 373:21 posCursor:[373:21] posNoWhite:[373:20] Found expr:[371:8->376:3] +posCursor:[373:21] posNoWhite:[373:20] Found expr:[371:8->376:3] posCursor:[373:21] posNoWhite:[373:20] Found pattern:[373:7->375:5] posCursor:[373:21] posNoWhite:[373:20] Found pattern:[373:7->373:21] Ppat_construct AndThatOther.T:[373:7->373:21] @@ -1884,6 +1883,7 @@ Path funRecord Complete src/Completion.res 389:12 posCursor:[389:12] posNoWhite:[389:11] Found expr:[387:8->392:1] +posCursor:[389:12] posNoWhite:[389:11] Found expr:[387:8->392:1] posCursor:[389:12] posNoWhite:[389:11] Found expr:[388:2->391:4] posCursor:[389:12] posNoWhite:[389:11] Found expr:[389:6->391:4] posCursor:[389:12] posNoWhite:[389:11] Found expr:[389:6->389:12] @@ -1900,13 +1900,13 @@ Path Js.Array2.ma "kind": 12, "tags": [], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} }, { "label": "Array2.map", "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} }] Complete src/Completion.res 397:14 @@ -1987,6 +1987,7 @@ Path r Complete src/Completion.res 409:21 posCursor:[409:21] posNoWhite:[409:20] Found expr:[408:14->415:1] +posCursor:[409:21] posNoWhite:[409:20] Found expr:[408:14->415:1] posCursor:[409:21] posNoWhite:[409:20] Found expr:[409:5->414:17] posCursor:[409:21] posNoWhite:[409:20] Found expr:[409:5->411:42] posCursor:[409:21] posNoWhite:[409:20] Found expr:[409:5->411:5] @@ -2013,6 +2014,7 @@ Path SomeLocalModule. Complete src/Completion.res 412:21 posCursor:[412:21] posNoWhite:[412:20] Found expr:[408:14->415:1] +posCursor:[412:21] posNoWhite:[412:20] Found expr:[408:14->415:1] posCursor:[412:21] posNoWhite:[412:20] Found expr:[411:2->414:17] posCursor:[412:21] posNoWhite:[412:20] Found expr:[412:5->414:17] Pexp_apply ...[412:5->414:8] (...[414:9->414:16]) @@ -2053,13 +2055,13 @@ Path Belt.Int.t "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }, { "label": "Belt.Int.toFloat", "kind": 12, "tags": [], "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `float`.\n\n ```res example\n Js.log(Belt.Int.toFloat(1) === 1.0) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toFloat(1) === 1.0) /* true */\n```\n"} }] Complete src/Completion.res 420:19 @@ -2077,13 +2079,13 @@ Path Belt.Float.t "kind": 12, "tags": [], "detail": "float => int", - "documentation": {"kind": "markdown", "value": "\nConverts a given `float` to an `int`.\n\n```res example\nJs.log(Belt.Float.toInt(1.0) === 1) /* true */\n```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Float.toInt(1.0) === 1) /* true */\n```\n"} }, { "label": "Belt.Float.toString", "kind": 12, "tags": [], "detail": "float => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Float.toString(1.0) === \"1.0\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Float.toString(1.0) === \"1.0\") /* true */\n```\n"} }] Complete src/Completion.res 425:8 @@ -2102,13 +2104,13 @@ Path Belt.Result.g "kind": 12, "tags": [], "detail": "t<'a, 'b> => 'a", - "documentation": {"kind": "markdown", "value": "\n `getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, raise an exception\n\n ```res example\n Belt.Result.getExn(Belt.Result.Ok(42)) == 42\n\n Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) /* raises exception */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\n`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, raise an exception\n\n## Examples\n\n```rescript\nBelt.Result.getExn(Belt.Result.Ok(42)) == 42\n\nBelt.Result.getExn(Belt.Result.Error(\"Invalid data\")) /* raises exception */\n```\n"} }, { "label": "Belt.Result.getWithDefault", "kind": 12, "tags": [], "detail": "(t<'a, 'b>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n `getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\n otherwise `default`\n\n ```res example\n Belt.Result.getWithDefault(Ok(42), 0) == 42\n\n Belt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n ```\n"} + "documentation": {"kind": "markdown", "value": "\n`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```\n"} }] Complete src/Completion.res 443:15 @@ -2186,7 +2188,7 @@ Path Belt.Int.toS "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }] Complete src/Completion.res 462:30 @@ -2198,13 +2200,13 @@ Resolved opens 3 pervasives Completion.res Completion.res ContextPath Type[withUncurried] Path withUncurried [{ - "label": "(. v) => {}", + "label": "v => {}", "kind": 12, "tags": [], "detail": "int => unit", "documentation": null, "sortText": "A", - "insertText": "(. ${1:v}) => {$0}", + "insertText": "${1:v} => {$0}", "insertTextFormat": 2 }] diff --git a/analysis/tests/src/expected/CompletionFunctionArguments.res.txt b/analysis/tests/src/expected/CompletionFunctionArguments.res.txt index 85010ef4f..c71b4540a 100644 --- a/analysis/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/analysis/tests/src/expected/CompletionFunctionArguments.res.txt @@ -370,6 +370,7 @@ Complete src/CompletionFunctionArguments.res 109:29 posCursor:[109:29] posNoWhite:[109:28] Found expr:[105:3->114:4] JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->113:5]> _children:114:2 posCursor:[109:29] posNoWhite:[109:28] Found expr:[106:35->113:5] +posCursor:[109:29] posNoWhite:[109:28] Found expr:[106:16->113:5] posCursor:[109:29] posNoWhite:[109:28] Found expr:[107:6->109:29] posCursor:[109:29] posNoWhite:[109:28] Found expr:[108:6->109:29] posCursor:[109:29] posNoWhite:[109:28] Found expr:[109:9->109:29] @@ -395,6 +396,7 @@ Complete src/CompletionFunctionArguments.res 111:27 posCursor:[111:27] posNoWhite:[111:26] Found expr:[105:3->114:4] JSX 105:6] onMouseDown[106:4->106:15]=...[106:35->113:5]> _children:114:2 posCursor:[111:27] posNoWhite:[111:26] Found expr:[106:35->113:5] +posCursor:[111:27] posNoWhite:[111:26] Found expr:[106:16->113:5] posCursor:[111:27] posNoWhite:[111:26] Found expr:[107:6->111:27] posCursor:[111:27] posNoWhite:[111:26] Found expr:[108:6->111:27] posCursor:[111:27] posNoWhite:[111:26] Found expr:[111:9->111:27] diff --git a/analysis/tests/src/expected/CompletionInferValues.res.txt b/analysis/tests/src/expected/CompletionInferValues.res.txt index d9e28dd9c..79789d9ff 100644 --- a/analysis/tests/src/expected/CompletionInferValues.res.txt +++ b/analysis/tests/src/expected/CompletionInferValues.res.txt @@ -16,13 +16,13 @@ Path Belt.Int.f "kind": 12, "tags": [], "detail": "string => option", - "documentation": {"kind": "markdown", "value": "\n Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n ```res example\n Js.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n```\n"} }, { "label": "Belt.Int.fromFloat", "kind": 12, "tags": [], "detail": "float => int", - "documentation": {"kind": "markdown", "value": "\n Converts a given `float` to an `int`.\n\n ```res example\n Js.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n```\n"} }] Complete src/CompletionInferValues.res 18:30 @@ -83,6 +83,7 @@ Complete src/CompletionInferValues.res 24:63 posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:3->24:64] Pexp_apply ...[24:3->24:21] (...[24:22->24:63]) posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:22->24:63] +posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:23->24:63] posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:36->24:63] posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:42->24:63] posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:52->24:63] @@ -115,6 +116,7 @@ Complete src/CompletionInferValues.res 27:90 posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:39->27:91] Pexp_apply ...[27:39->27:48] (...[27:49->27:90]) posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:49->27:90] +posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:50->27:90] posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:56->27:90] posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:69->27:90] posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:79->27:90] @@ -149,6 +151,7 @@ Complete src/CompletionInferValues.res 30:36 posCursor:[30:36] posNoWhite:[30:35] Found expr:[30:3->30:39] 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: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 @@ -176,6 +179,7 @@ Complete src/CompletionInferValues.res 41:50 posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:12->41:56] JSX 41:15] onMouseEnter[41:16->41:28]=...[41:36->41:52]> _children:41:54 posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:36->41:52] +posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:29->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 @@ -186,13 +190,13 @@ Path event ContextPath CArgument CJsxPropValue [div] onMouseEnter($0) ContextPath CJsxPropValue [div] onMouseEnter Path ReactDOM.domProps -Path Pervasives.JsxDOM.domProps +Path PervasivesU.JsxDOM.domProps CPPipe env:CompletionInferValues -CPPipe type path:JsxEventC.Mouse.t -CPPipe pathFromEnv:JsxEventC.Mouse found:false -Path JsxEventC.Mouse.pr +CPPipe type path:JsxEventU.Mouse.t +CPPipe pathFromEnv:JsxEventU.Mouse found:false +Path JsxEventU.Mouse.pr [{ - "label": "JsxEventC.Mouse.preventDefault", + "label": "JsxEventU.Mouse.preventDefault", "kind": 12, "tags": [], "detail": "t => unit", @@ -203,6 +207,7 @@ Complete src/CompletionInferValues.res 44:50 posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:12->44:56] JSX 44:15] onMouseEnter[44:16->44:28]=...[44:36->44:52]> _children:44:54 posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:36->44:52] +posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:29->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 @@ -214,11 +219,11 @@ ContextPath CArgument CJsxPropValue [Div] onMouseEnter($0) ContextPath CJsxPropValue [Div] onMouseEnter Path Div.make CPPipe env:CompletionInferValues envFromCompletionItem:CompletionInferValues.Div -CPPipe type path:Pervasives.JsxEvent.Mouse.t -CPPipe pathFromEnv:Pervasives.JsxEvent.Mouse found:false -Path Pervasives.JsxEvent.Mouse.pr +CPPipe type path:PervasivesU.JsxEvent.Mouse.t +CPPipe pathFromEnv:PervasivesU.JsxEvent.Mouse found:false +Path PervasivesU.JsxEvent.Mouse.pr [{ - "label": "Pervasives.JsxEvent.Mouse.preventDefault", + "label": "PervasivesU.JsxEvent.Mouse.preventDefault", "kind": 12, "tags": [], "detail": "t => unit", @@ -229,6 +234,7 @@ Complete src/CompletionInferValues.res 47:87 posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:12->47:93] JSX 47:15] onMouseEnter[47:16->47:28]=...[47:36->47:89]> _children:47:91 posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:36->47:89] +posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:29->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 <> @@ -240,26 +246,27 @@ Path btn ContextPath Value[JsxEvent, Mouse, button](Nolabel) ContextPath Value[JsxEvent, Mouse, button] Path JsxEvent.Mouse.button -CPPipe env:CompletionInferValues envFromCompletionItem:JsxEventC.Mouse +CPPipe env:CompletionInferValues envFromCompletionItem:JsxEventU.Mouse Path Belt.Int.t [{ "label": "Belt.Int.toString", "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }, { "label": "Belt.Int.toFloat", "kind": 12, "tags": [], "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `float`.\n\n ```res example\n Js.log(Belt.Int.toFloat(1) === 1.0) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toFloat(1) === 1.0) /* true */\n```\n"} }] Complete src/CompletionInferValues.res 50:108 posCursor:[50:108] posNoWhite:[50:107] Found expr:[50:12->50:114] JSX 50:15] onMouseEnter[50:16->50:28]=...[50:36->50:110]> _children:50:112 posCursor:[50:108] posNoWhite:[50:107] Found expr:[50:36->50:110] +posCursor:[50:108] posNoWhite:[50:107] Found expr:[50:29->50:110] posCursor:[50:108] posNoWhite:[50:107] Found expr:[50:41->50:108] posCursor:[50:108] posNoWhite:[50:107] Found expr:[50:100->50:108] Completable: Cpath Value[btn]->spl <> @@ -278,31 +285,32 @@ Path Js.String2.spl "kind": 12, "tags": [], "detail": "(t, t, ~limit: int) => array", - "documentation": {"kind": "markdown", "value": "\n `splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```\n"} }, { "label": "Js.String2.splitByRe", "kind": 12, "tags": [], "detail": "(t, Js_re.t) => array>", - "documentation": {"kind": "markdown", "value": "\n`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n```res example\nJs.String2.splitByRe(\"art; bed , cog ;dad\", %re(\"/\\s*[,;]\\s*/\")) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", %re(\"/\\s*[,;]\\s*TODO/\")) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```\n"} }, { "label": "Js.String2.split", "kind": 12, "tags": [], "detail": "(t, t) => array", - "documentation": {"kind": "markdown", "value": "\n`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n```res example\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```\n"} }, { "label": "Js.String2.splitByReAtMost", "kind": 12, "tags": [], "detail": "(t, Js_re.t, ~limit: int) => array>", - "documentation": {"kind": "markdown", "value": "\n`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n```res example\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*/\"), ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*/\"), ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*/\"), ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*TODO/\"), ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*TODO/\"), ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*TODO/\"), ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```\n"} }] Complete src/CompletionInferValues.res 53:130 posCursor:[53:130] posNoWhite:[53:129] Found expr:[53:12->53:136] JSX 53:15] onMouseEnter[53:16->53:28]=...[53:36->53:132]> _children:53:134 posCursor:[53:130] posNoWhite:[53:129] Found expr:[53:36->53:132] +posCursor:[53:130] posNoWhite:[53:129] Found expr:[53:29->53:132] posCursor:[53:130] posNoWhite:[53:129] Found expr:[53:41->53:130] posCursor:[53:130] posNoWhite:[53:129] Found expr:[53:123->53:130] Completable: Cpath Value[btn]->ma <> @@ -321,13 +329,13 @@ Path Js.Array2.ma "kind": 12, "tags": [], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} }, { "label": "Js.Array2.map", "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} }] Complete src/CompletionInferValues.res 56:52 @@ -453,13 +461,13 @@ Path Js.String2.slic "kind": 12, "tags": [], "detail": "(t, ~from: int) => t", - "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} }, { "label": "Js.String2.slice", "kind": 12, "tags": [], "detail": "(t, ~from: int, ~to_: int) => t", - "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} }] Complete src/CompletionInferValues.res 94:82 @@ -482,7 +490,7 @@ Path Belt.Int.toS "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }] Complete src/CompletionInferValues.res 98:109 @@ -508,7 +516,7 @@ Path Belt.Int.toS "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }] Complete src/CompletionInferValues.res 102:102 @@ -535,7 +543,7 @@ Path Belt.Int.toS "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }] Complete src/CompletionInferValues.res 106:88 @@ -558,13 +566,13 @@ Path Js.String2.slic "kind": 12, "tags": [], "detail": "(t, ~from: int) => t", - "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} }, { "label": "Js.String2.slice", "kind": 12, "tags": [], "detail": "(t, ~from: int, ~to_: int) => t", - "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} }] Complete src/CompletionInferValues.res 110:89 @@ -587,13 +595,13 @@ Path Js.String2.slic "kind": 12, "tags": [], "detail": "(t, ~from: int) => t", - "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} }, { "label": "Js.String2.slice", "kind": 12, "tags": [], "detail": "(t, ~from: int, ~to_: int) => t", - "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} }] Complete src/CompletionInferValues.res 114:80 @@ -616,13 +624,13 @@ Path Js.String2.slic "kind": 12, "tags": [], "detail": "(t, ~from: int) => t", - "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```\n"} }, { "label": "Js.String2.slice", "kind": 12, "tags": [], "detail": "(t, ~from: int, ~to_: int) => t", - "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n```res example\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} + "documentation": {"kind": "markdown", "value": "\n`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```\n"} }] Complete src/CompletionInferValues.res 118:67 @@ -672,13 +680,14 @@ Path Belt.Int.toSt "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }] Complete src/CompletionInferValues.res 130:26 posCursor:[130:26] posNoWhite:[130:25] Found expr:[130:3->130:37] Pexp_apply ...[130:3->130:23] (...[130:24->130:36]) posCursor:[130:26] posNoWhite:[130:25] Found expr:[130:24->130:36] +posCursor:[130:26] posNoWhite:[130:25] Found expr:[130:25->130:36] posCursor:[130:26] posNoWhite:[130:25] Found pattern:[130:25->130:27] posCursor:[130:26] posNoWhite:[130:25] Found pattern:[130:25->130:27] Completable: Cpattern CArgument CArgument Value[fnWithRecordCallback]($0)($0)->recordBody @@ -706,6 +715,7 @@ Complete src/CompletionInferValues.res 137:30 posCursor:[137:30] posNoWhite:[137:29] Found expr:[137:3->137:33] Pexp_apply ...[137:3->137:6] (~cb137:8->137:10=...[137:11->137:32]) posCursor:[137:30] posNoWhite:[137:29] Found expr:[137:11->137:32] +posCursor:[137:30] posNoWhite:[137:29] Found expr:[137:12->137:32] posCursor:[137:30] posNoWhite:[137:29] Found expr:[137:24->0:-1] posCursor:[137:30] posNoWhite:[137:29] Found expr:[137:24->0:-1] Completable: Cpath Value[root]-> @@ -741,6 +751,7 @@ Complete src/CompletionInferValues.res 146:30 posCursor:[146:30] posNoWhite:[146:29] Found expr:[146:3->146:33] Pexp_apply ...[146:3->146:6] (~cb146:8->146:10=...[146:11->146:32]) posCursor:[146:30] posNoWhite:[146:29] Found expr:[146:11->146:32] +posCursor:[146:30] posNoWhite:[146:29] Found expr:[146:12->146:32] posCursor:[146:30] posNoWhite:[146:29] Found expr:[146:24->0:-1] posCursor:[146:30] posNoWhite:[146:29] Found expr:[146:24->0:-1] Completable: Cpath Value[root]-> @@ -820,6 +831,7 @@ Complete src/CompletionInferValues.res 158:105 posCursor:[158:105] posNoWhite:[158:104] Found expr:[158:18->158:110] Pexp_apply ...[158:18->158:49] (~prepare158:51->158:58=...[158:59->158:72], ~render158:74->158:80=...[158:81->158:106], ...[158:107->158:109]) posCursor:[158:105] posNoWhite:[158:104] Found expr:[158:81->158:106] +posCursor:[158:105] posNoWhite:[158:104] Found expr:[158:82->158:106] posCursor:[158:105] posNoWhite:[158:104] Found expr:[158:97->158:105] Pexp_field [158:97->158:104] _:[158:105->158:105] Completable: Cpath Value[support]."" @@ -845,6 +857,7 @@ Complete src/CompletionInferValues.res 162:110 posCursor:[162:110] posNoWhite:[162:109] Found expr:[162:18->162:115] Pexp_apply ...[162:18->162:49] (~prepare162:51->162:58=...[162:59->162:72], ~render162:74->162:80=...[162:81->162:111], ...[162:112->162:114]) posCursor:[162:110] posNoWhite:[162:109] Found expr:[162:81->162:111] +posCursor:[162:110] posNoWhite:[162:109] Found expr:[162:82->162:111] posCursor:[162:110] posNoWhite:[162:109] Found expr:[162:104->0:-1] posCursor:[162:110] posNoWhite:[162:109] Found expr:[162:104->0:-1] Completable: Cpath Value[root]-> diff --git a/analysis/tests/src/expected/CompletionJsx.res.txt b/analysis/tests/src/expected/CompletionJsx.res.txt index 234b2b221..9410655bd 100644 --- a/analysis/tests/src/expected/CompletionJsx.res.txt +++ b/analysis/tests/src/expected/CompletionJsx.res.txt @@ -13,17 +13,18 @@ Path Js.String2.st "kind": 12, "tags": [], "detail": "(t, t) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWith(\"BuckleScript\", \"Buckle\") == true\nJs.String2.startsWith(\"BuckleScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```\n"} }, { "label": "Js.String2.startsWithFrom", "kind": 12, "tags": [], "detail": "(t, t, int) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nJs.String2.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```\n"} }] Complete src/CompletionJsx.res 13:21 posCursor:[13:21] posNoWhite:[13:20] Found expr:[8:13->33:3] +posCursor:[13:21] posNoWhite:[13:20] Found expr:[8:14->33:3] posCursor:[13:21] posNoWhite:[13:20] Found expr:[9:4->32:10] posCursor:[13:21] posNoWhite:[13:20] Found expr:[10:4->32:10] posCursor:[13:21] posNoWhite:[13:20] Found expr:[11:4->32:10] @@ -51,17 +52,18 @@ Path Js.String2.st "kind": 12, "tags": [], "detail": "(t, t) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWith(\"BuckleScript\", \"Buckle\") == true\nJs.String2.startsWith(\"BuckleScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```\n"} }, { "label": "Js.String2.startsWithFrom", "kind": 12, "tags": [], "detail": "(t, t, int) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nJs.String2.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```\n"} }] Complete src/CompletionJsx.res 18:24 posCursor:[18:24] posNoWhite:[18:23] Found expr:[8:13->33:3] +posCursor:[18:24] posNoWhite:[18:23] Found expr:[8:14->33:3] posCursor:[18:24] posNoWhite:[18:23] Found expr:[9:4->32:10] posCursor:[18:24] posNoWhite:[18:23] Found expr:[10:4->32:10] posCursor:[18:24] posNoWhite:[18:23] Found expr:[11:4->32:10] @@ -99,17 +101,18 @@ Path Js.String2.st "kind": 12, "tags": [], "detail": "(t, t) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWith(\"BuckleScript\", \"Buckle\") == true\nJs.String2.startsWith(\"BuckleScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```\n"} }, { "label": "Js.String2.startsWithFrom", "kind": 12, "tags": [], "detail": "(t, t, int) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nJs.String2.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```\n"} }] Complete src/CompletionJsx.res 20:27 posCursor:[20:27] posNoWhite:[20:26] Found expr:[8:13->33:3] +posCursor:[20:27] posNoWhite:[20:26] Found expr:[8:14->33:3] posCursor:[20:27] posNoWhite:[20:26] Found expr:[9:4->32:10] posCursor:[20:27] posNoWhite:[20:26] Found expr:[10:4->32:10] posCursor:[20:27] posNoWhite:[20:26] Found expr:[11:4->32:10] @@ -146,17 +149,18 @@ Path Js.String2.st "kind": 12, "tags": [], "detail": "(t, t) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWith(\"BuckleScript\", \"Buckle\") == true\nJs.String2.startsWith(\"BuckleScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```\n"} }, { "label": "Js.String2.startsWithFrom", "kind": 12, "tags": [], "detail": "(t, t, int) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nJs.String2.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```\n"} }] Complete src/CompletionJsx.res 22:44 posCursor:[22:44] posNoWhite:[22:43] Found expr:[8:13->33:3] +posCursor:[22:44] posNoWhite:[22:43] Found expr:[8:14->33:3] posCursor:[22:44] posNoWhite:[22:43] Found expr:[9:4->32:10] posCursor:[22:44] posNoWhite:[22:43] Found expr:[10:4->32:10] posCursor:[22:44] posNoWhite:[22:43] Found expr:[11:4->32:10] @@ -195,17 +199,18 @@ Path Js.String2.st "kind": 12, "tags": [], "detail": "(t, t) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWith(\"BuckleScript\", \"Buckle\") == true\nJs.String2.startsWith(\"BuckleScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```\n"} }, { "label": "Js.String2.startsWithFrom", "kind": 12, "tags": [], "detail": "(t, t, int) => bool", - "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n```res example\nJs.String2.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nJs.String2.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} + "documentation": {"kind": "markdown", "value": "\nES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```\n"} }] Complete src/CompletionJsx.res 24:19 posCursor:[24:19] posNoWhite:[24:18] Found expr:[8:13->33:3] +posCursor:[24:19] posNoWhite:[24:18] Found expr:[8:14->33:3] posCursor:[24:19] posNoWhite:[24:18] Found expr:[9:4->32:10] posCursor:[24:19] posNoWhite:[24:18] Found expr:[10:4->32:10] posCursor:[24:19] posNoWhite:[24:18] Found expr:[11:4->32:10] @@ -243,53 +248,54 @@ Path Belt.Int. "kind": 12, "tags": [], "detail": "string => option", - "documentation": {"kind": "markdown", "value": "\n Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n ```res example\n Js.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n```\n"} }, { "label": "Belt.Int.*", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 * 2 === 4) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nMultiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 * 2 === 4) /* true */\n```\n"} }, { "label": "Belt.Int./", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Division of two `int` values. Same as the division from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(4 / 2 === 2); /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nDivision of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(4 / 2 === 2); /* true */\n```\n"} }, { "label": "Belt.Int.toString", "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }, { "label": "Belt.Int.toFloat", "kind": 12, "tags": [], "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `float`.\n\n ```res example\n Js.log(Belt.Int.toFloat(1) === 1.0) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toFloat(1) === 1.0) /* true */\n```\n"} }, { "label": "Belt.Int.fromFloat", "kind": 12, "tags": [], "detail": "float => int", - "documentation": {"kind": "markdown", "value": "\n Converts a given `float` to an `int`.\n\n ```res example\n Js.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n```\n"} }, { "label": "Belt.Int.-", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 - 1 === 1) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nSubtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 - 1 === 1) /* true */\n```\n"} }, { "label": "Belt.Int.+", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Addition of two `int` values. Same as the addition from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 + 2 === 4) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nAddition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 + 2 === 4) /* true */\n```\n"} }] Complete src/CompletionJsx.res 26:14 posCursor:[26:14] posNoWhite:[26:13] Found expr:[8:13->33:3] +posCursor:[26:14] posNoWhite:[26:13] Found expr:[8:14->33:3] posCursor:[26:14] posNoWhite:[26:13] Found expr:[9:4->32:10] posCursor:[26:14] posNoWhite:[26:13] Found expr:[10:4->32:10] posCursor:[26:14] posNoWhite:[26:13] Found expr:[11:4->32:10] @@ -326,53 +332,54 @@ Path Belt.Int. "kind": 12, "tags": [], "detail": "string => option", - "documentation": {"kind": "markdown", "value": "\n Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n ```res example\n Js.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n```\n"} }, { "label": "Belt.Int.*", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 * 2 === 4) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nMultiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 * 2 === 4) /* true */\n```\n"} }, { "label": "Belt.Int./", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Division of two `int` values. Same as the division from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(4 / 2 === 2); /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nDivision of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(4 / 2 === 2); /* true */\n```\n"} }, { "label": "Belt.Int.toString", "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }, { "label": "Belt.Int.toFloat", "kind": 12, "tags": [], "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `float`.\n\n ```res example\n Js.log(Belt.Int.toFloat(1) === 1.0) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toFloat(1) === 1.0) /* true */\n```\n"} }, { "label": "Belt.Int.fromFloat", "kind": 12, "tags": [], "detail": "float => int", - "documentation": {"kind": "markdown", "value": "\n Converts a given `float` to an `int`.\n\n ```res example\n Js.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n```\n"} }, { "label": "Belt.Int.-", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 - 1 === 1) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nSubtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 - 1 === 1) /* true */\n```\n"} }, { "label": "Belt.Int.+", "kind": 12, "tags": [], "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n Addition of two `int` values. Same as the addition from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 + 2 === 4) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nAddition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 + 2 === 4) /* true */\n```\n"} }] Complete src/CompletionJsx.res 28:20 posCursor:[28:20] posNoWhite:[28:19] Found expr:[8:13->33:3] +posCursor:[28:20] posNoWhite:[28:19] Found expr:[8:14->33:3] posCursor:[28:20] posNoWhite:[28:19] Found expr:[9:4->32:10] posCursor:[28:20] posNoWhite:[28:19] Found expr:[10:4->32:10] posCursor:[28:20] posNoWhite:[28:19] Found expr:[11:4->32:10] @@ -415,6 +422,7 @@ Path Js.Array2.a Complete src/CompletionJsx.res 30:12 posCursor:[30:12] posNoWhite:[30:11] Found expr:[8:13->33:3] +posCursor:[30:12] posNoWhite:[30:11] Found expr:[8:14->33:3] posCursor:[30:12] posNoWhite:[30:11] Found expr:[9:4->32:10] posCursor:[30:12] posNoWhite:[30:11] Found expr:[10:4->32:10] posCursor:[30:12] posNoWhite:[30:11] Found expr:[11:4->32:10] @@ -499,7 +507,7 @@ Completable: Cjsx([h1], hidd, [hidd]) Package opens Pervasives.JsxModules.place holder Resolved opens 1 pervasives Path ReactDOM.domProps -Path Pervasives.JsxDOM.domProps +Path PervasivesU.JsxDOM.domProps [{ "label": "hidden", "kind": 4, diff --git a/analysis/tests/src/expected/CompletionJsxProps.res.txt b/analysis/tests/src/expected/CompletionJsxProps.res.txt index c994d33ae..f5aa6685f 100644 --- a/analysis/tests/src/expected/CompletionJsxProps.res.txt +++ b/analysis/tests/src/expected/CompletionJsxProps.res.txt @@ -166,7 +166,7 @@ Package opens Pervasives.JsxModules.place holder Resolved opens 1 pervasives ContextPath CJsxPropValue [div] muted Path ReactDOM.domProps -Path Pervasives.JsxDOM.domProps +Path PervasivesU.JsxDOM.domProps [{ "label": "true", "kind": 4, @@ -189,12 +189,12 @@ Package opens Pervasives.JsxModules.place holder Resolved opens 1 pervasives ContextPath CJsxPropValue [div] onMouseEnter Path ReactDOM.domProps -Path Pervasives.JsxDOM.domProps +Path PervasivesU.JsxDOM.domProps [{ "label": "event => {}", "kind": 12, "tags": [], - "detail": "JsxEventC.Mouse.t => unit", + "detail": "JsxEventU.Mouse.t => unit", "documentation": null, "sortText": "A", "insertText": "{${1:event} => {$0}}", diff --git a/analysis/tests/src/expected/CompletionPipeChain.res.txt b/analysis/tests/src/expected/CompletionPipeChain.res.txt index 52e23054c..91f6ca0e1 100644 --- a/analysis/tests/src/expected/CompletionPipeChain.res.txt +++ b/analysis/tests/src/expected/CompletionPipeChain.res.txt @@ -363,13 +363,13 @@ Path Belt.Int.t "kind": 12, "tags": [], "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```\n"} }, { "label": "Belt.Int.toFloat", "kind": 12, "tags": [], "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `float`.\n\n ```res example\n Js.log(Belt.Int.toFloat(1) === 1.0) /* true */\n ```\n"} + "documentation": {"kind": "markdown", "value": "\nConverts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toFloat(1) === 1.0) /* true */\n```\n"} }] Complete src/CompletionPipeChain.res 70:12 @@ -440,6 +440,7 @@ Complete src/CompletionPipeChain.res 82:30 posCursor:[82:30] posNoWhite:[82:29] Found expr:[76:15->93:1] Pexp_apply ...[76:15->76:46] (~prepare77:3->77:10=...[77:11->77:24], ~render78:3->78:9=...[78:10->91:3], ...[92:2->92:4]) posCursor:[82:30] posNoWhite:[82:29] Found expr:[78:10->91:3] +posCursor:[82:30] posNoWhite:[82:29] Found expr:[78:10->91:3] 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] @@ -467,6 +468,7 @@ Complete src/CompletionPipeChain.res 88:16 posCursor:[88:16] posNoWhite:[88:15] Found expr:[76:15->93:1] Pexp_apply ...[76:15->76:46] (~prepare77:3->77:10=...[77:11->77:24], ~render78:3->78:9=...[78:10->91:3], ...[92:2->92:4]) posCursor:[88:16] posNoWhite:[88:15] Found expr:[78:10->91:3] +posCursor:[88:16] posNoWhite:[88:15] Found expr:[78:10->91:3] posCursor:[88:16] posNoWhite:[88:15] Found expr:[79:4->90:14] posCursor:[88:16] posNoWhite:[88:15] Found expr:[84:4->90:14] posCursor:[88:16] posNoWhite:[88:15] Found expr:[85:4->90:14] @@ -568,6 +570,6 @@ Path Js.Re.la "kind": 12, "tags": [], "detail": "t => int", - "documentation": {"kind": "markdown", "value": "\n Returns the index where the next match will start its search. This property\n will be modified when the RegExp object is used, if the global (\"g\") flag is\n set.\n\n ```res example\n let re = %re(\"/ab*/g\")\n let str = \"abbcdefabh\"\n\n let break = ref(false)\n while !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) => Js.Nullable.iter(Js.Re.captures(result)[0], (. match_) => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n }\n ```\n\n See\n [`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\n on MDN.\n"} + "documentation": {"kind": "markdown", "value": "\nReturns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = %re(\"/ab*TODO/g\")\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) => Js.Nullable.iter(Js.Re.captures(result)[0], (. match_) => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN.\n"} }] diff --git a/analysis/tests/src/expected/Debug.res.txt b/analysis/tests/src/expected/Debug.res.txt index d15f92662..1575bb619 100644 --- a/analysis/tests/src/expected/Debug.res.txt +++ b/analysis/tests/src/expected/Debug.res.txt @@ -1,8 +1,8 @@ -Definition src/Debug.res 2:20 -{"uri": "belt_List.mli", "range": {"start": {"line": 245, "character": 4}, "end": {"line": 245, "character": 7}}} +Definition src/Debug.res 2:27 +{"uri": "ShadowedBelt.res", "range": {"start": {"line": 1, "character": 6}, "end": {"line": 1, "character": 9}}} Definition src/Debug.res 5:14 -{"uri": "list.mli", "range": {"start": {"line": 116, "character": 4}, "end": {"line": 116, "character": 7}}} +{"uri": "list.res", "range": {"start": {"line": 117, "character": 4}, "end": {"line": 117, "character": 7}}} Complete src/Debug.res 14:8 posCursor:[14:8] posNoWhite:[14:7] Found expr:[14:5->14:8] diff --git a/analysis/tests/src/expected/Definition.res.txt b/analysis/tests/src/expected/Definition.res.txt index 158b7d271..4d8ab2721 100644 --- a/analysis/tests/src/expected/Definition.res.txt +++ b/analysis/tests/src/expected/Definition.res.txt @@ -8,10 +8,10 @@ Hover src/Definition.res 14:14 {"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```\n\n [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an],\n and builds the list [[f a1; ...; f an]]\n with the results returned by [f]. Not tail-recursive. "}} Hover src/Definition.res 18:14 -{"contents": {"kind": "markdown", "value": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n---\n\n```\n \n```\n```rescript\ntype Belt.List.t<'a> = list<'a>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22belt_List.mli%22%2C34%2C0%5D)\n\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}} +{"contents": {"kind": "markdown", "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```"}} Hover src/Definition.res 23:3 -{"contents": {"kind": "markdown", "value": "```rescript\n(. int, int) => int\n```"}} +{"contents": {"kind": "markdown", "value": "```rescript\n(int, int) => int\n```"}} Definition src/Definition.res 26:3 {"uri": "Definition.res", "range": {"start": {"line": 21, "character": 4}, "end": {"line": 21, "character": 13}}} diff --git a/analysis/tests/src/expected/Destructuring.res.txt b/analysis/tests/src/expected/Destructuring.res.txt index 978a78816..c85f233a6 100644 --- a/analysis/tests/src/expected/Destructuring.res.txt +++ b/analysis/tests/src/expected/Destructuring.res.txt @@ -36,6 +36,7 @@ Path x Complete src/Destructuring.res 11:13 posCursor:[11:13] posNoWhite:[11:11] Found expr:[10:8->14:1] +posCursor:[11:13] posNoWhite:[11:11] Found expr:[10:9->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 @@ -53,6 +54,7 @@ Path x Complete src/Destructuring.res 17:10 posCursor:[17:10] posNoWhite:[17:9] Found expr:[16:9->20:1] +posCursor:[17:10] posNoWhite:[17:9] Found expr:[16:10->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 diff --git a/analysis/tests/src/expected/Div.res.txt b/analysis/tests/src/expected/Div.res.txt index 6f0086a44..b5af0d5f6 100644 --- a/analysis/tests/src/expected/Div.res.txt +++ b/analysis/tests/src/expected/Div.res.txt @@ -9,7 +9,7 @@ Completable: Cjsx([div], dangerous, [dangerous]) Package opens Pervasives.JsxModules.place holder Resolved opens 1 pervasives Path ReactDOM.domProps -Path Pervasives.JsxDOM.domProps +Path PervasivesU.JsxDOM.domProps [{ "label": "dangerouslySetInnerHTML", "kind": 4, diff --git a/analysis/tests/src/expected/Hover.res.txt b/analysis/tests/src/expected/Hover.res.txt index 773bd50f3..8139c1527 100644 --- a/analysis/tests/src/expected/Hover.res.txt +++ b/analysis/tests/src/expected/Hover.res.txt @@ -91,16 +91,16 @@ Resolved opens 1 pervasives {"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 -{"contents": {"kind": "markdown", "value": "```rescript\n(. unit, unit) => int\n```"}} +{"contents": {"kind": "markdown", "value": "```rescript\nunit => unit => int\n```"}} Hover src/Hover.res 131:4 -{"contents": {"kind": "markdown", "value": "```rescript\n(. unit) => (. unit) => int\n```"}} +{"contents": {"kind": "markdown", "value": "```rescript\n(unit, unit) => int\n```"}} Hover src/Hover.res 134:4 -{"contents": {"kind": "markdown", "value": "```rescript\n(. unit, unit) => int\n```"}} +{"contents": {"kind": "markdown", "value": "```rescript\n(unit, unit) => int\n```"}} Hover src/Hover.res 137:5 -{"contents": {"kind": "markdown", "value": "```rescript\n(. unit, unit) => int\n```"}} +{"contents": {"kind": "markdown", "value": "```rescript\nunit => unit => int\n```"}} Hover src/Hover.res 144:9 {"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n\ndoc comment 1"}} diff --git a/analysis/tests/src/expected/RecordCompletion.res.txt b/analysis/tests/src/expected/RecordCompletion.res.txt index f8ae52243..f42087ca5 100644 --- a/analysis/tests/src/expected/RecordCompletion.res.txt +++ b/analysis/tests/src/expected/RecordCompletion.res.txt @@ -14,13 +14,13 @@ Path Js.Array2.m "kind": 12, "tags": [], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} }, { "label": "Js.Array2.map", "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} }] Complete src/RecordCompletion.res 11:13 @@ -40,13 +40,13 @@ Path Js.Array2.m "kind": 12, "tags": [], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"} }, { "label": "Js.Array2.map", "kind": 12, "tags": [], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} + "documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"} }] Complete src/RecordCompletion.res 19:7 diff --git a/analysis/tests/src/expected/ShadowedBelt.res.txt b/analysis/tests/src/expected/ShadowedBelt.res.txt new file mode 100644 index 000000000..e69de29bb diff --git a/analysis/tests/src/expected/SignatureHelp.res.txt b/analysis/tests/src/expected/SignatureHelp.res.txt index 2dd482881..2a7811df6 100644 --- a/analysis/tests/src/expected/SignatureHelp.res.txt +++ b/analysis/tests/src/expected/SignatureHelp.res.txt @@ -10,12 +10,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: unlabelled<0> extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, @@ -34,12 +33,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: unlabelled<0> extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, @@ -58,12 +56,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: ~two extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, @@ -82,12 +79,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: ~two extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, @@ -106,12 +102,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: ~four extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, @@ -130,12 +125,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: ~four extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, @@ -154,11 +148,11 @@ ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<0> extracted params: -[(string, int, float] +[string, int, float] { "signatures": [{ "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] + "parameters": [{"label": [1, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] }], "activeSignature": 0, "activeParameter": 0 @@ -176,11 +170,11 @@ ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<0> extracted params: -[(string, int, float] +[string, int, float] { "signatures": [{ "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] + "parameters": [{"label": [1, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] }], "activeSignature": 0, "activeParameter": 0 @@ -198,11 +192,11 @@ ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<2> extracted params: -[(string, int, float] +[string, int, float] { "signatures": [{ "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] + "parameters": [{"label": [1, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] }], "activeSignature": 0, "activeParameter": 2 @@ -220,11 +214,11 @@ ContextPath Value[Completion, Lib, foo] Path Completion.Lib.foo argAtCursor: ~age extracted params: -[(~age: int, ~name: string] +[~age: int, ~name: string] { "signatures": [{ "label": "(~age: int, ~name: string) => string", - "parameters": [{"label": [0, 10], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [12, 25], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] + "parameters": [{"label": [1, 10], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [12, 25], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] }], "activeSignature": 0, "activeParameter": 0 @@ -265,11 +259,11 @@ ContextPath Value[otherFunc] Path otherFunc argAtCursor: unlabelled<1> extracted params: -[(string, int, float] +[string, int, float] { "signatures": [{ "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] + "parameters": [{"label": [1, 7], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": "```rescript\nstring\n```"}}] }], "activeSignature": 0, "activeParameter": 1 @@ -287,11 +281,11 @@ ContextPath Value[fn] Path fn argAtCursor: unlabelled<1> extracted params: -[(int, string, int] +[int, string, int] { "signatures": [{ "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}] + "parameters": [{"label": [1, 4], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}] }], "activeSignature": 0, "activeParameter": 1 @@ -309,11 +303,11 @@ ContextPath Value[fn] Path fn argAtCursor: unlabelled<1> extracted params: -[(int, string, int] +[int, string, int] { "signatures": [{ "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}] + "parameters": [{"label": [1, 4], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}] }], "activeSignature": 0, "activeParameter": 1 @@ -331,11 +325,11 @@ ContextPath Value[fn] Path fn argAtCursor: unlabelled<2> extracted params: -[(int, string, int] +[int, string, int] { "signatures": [{ "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}] + "parameters": [{"label": [1, 4], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}] }], "activeSignature": 0, "activeParameter": 2 @@ -381,12 +375,11 @@ ContextPath Value[someFunc] Path someFunc argAtCursor: unlabelled<0> extracted params: -[( - int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] +[int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { "signatures": [{ "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], + "parameters": [{"label": [4, 7], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": "```rescript\nunit => unit\n```"}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\nsomeVariant\n```\n```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": "```rescript\nint\n```"}}], "documentation": {"kind": "markdown", "value": " Does stuff. "} }], "activeSignature": 0, diff --git a/analysis/tests/src/expected/Xform.res.txt b/analysis/tests/src/expected/Xform.res.txt index 0af705bff..30154b591 100644 --- a/analysis/tests/src/expected/Xform.res.txt +++ b/analysis/tests/src/expected/Xform.res.txt @@ -101,6 +101,7 @@ newText: Xform src/Xform.res 48:21 posCursor:[48:21] posNoWhite:[48:19] Found expr:[48:15->48:25] +posCursor:[48:21] posNoWhite:[48:19] Found expr:[48:15->48:25] Completable: Cpath Value[name] Package opens Pervasives.JsxModules.place holder Resolved opens 1 pervasives diff --git a/tools/tests/src/expected/DocExtraction2.res.json b/tools/tests/src/expected/DocExtraction2.res.json index 745efd0e5..224daefdc 100644 --- a/tools/tests/src/expected/DocExtraction2.res.json +++ b/tools/tests/src/expected/DocExtraction2.res.json @@ -24,7 +24,7 @@ "id": "DocExtraction2.make", "kind": "value", "name": "make", - "signature": "let make: (. unit) => t", + "signature": "let make: unit => t", "docstrings": ["Makerz of stuffz."], "source": { "filepath": "src/DocExtraction2.resi", @@ -59,7 +59,7 @@ "id": "DocExtraction2.InnerModule.make", "kind": "value", "name": "make", - "signature": "let make: (. unit) => t", + "signature": "let make: unit => t", "docstrings": ["Maker of tea."], "source": { "filepath": "src/DocExtraction2.resi", diff --git a/tools/tests/src/expected/DocExtraction2.resi.json b/tools/tests/src/expected/DocExtraction2.resi.json index 745efd0e5..224daefdc 100644 --- a/tools/tests/src/expected/DocExtraction2.resi.json +++ b/tools/tests/src/expected/DocExtraction2.resi.json @@ -24,7 +24,7 @@ "id": "DocExtraction2.make", "kind": "value", "name": "make", - "signature": "let make: (. unit) => t", + "signature": "let make: unit => t", "docstrings": ["Makerz of stuffz."], "source": { "filepath": "src/DocExtraction2.resi", @@ -59,7 +59,7 @@ "id": "DocExtraction2.InnerModule.make", "kind": "value", "name": "make", - "signature": "let make: (. unit) => t", + "signature": "let make: unit => t", "docstrings": ["Maker of tea."], "source": { "filepath": "src/DocExtraction2.resi", diff --git a/tools/tests/src/expected/DocExtractionRes.res.json b/tools/tests/src/expected/DocExtractionRes.res.json index a07ada95f..240355504 100644 --- a/tools/tests/src/expected/DocExtractionRes.res.json +++ b/tools/tests/src/expected/DocExtractionRes.res.json @@ -39,7 +39,7 @@ "id": "DocExtractionRes.make", "kind": "value", "name": "make", - "signature": "let make: (. string) => t", + "signature": "let make: string => t", "docstrings": ["Create stuff.\n\n```rescript example\nlet stuff = make(\"My name\")\n```"], "source": { "filepath": "src/DocExtractionRes.res", @@ -51,7 +51,7 @@ "id": "DocExtractionRes.asOffline", "kind": "value", "name": "asOffline", - "signature": "let asOffline: (. t) => t", + "signature": "let asOffline: t => t", "docstrings": ["Stuff goes offline."], "source": { "filepath": "src/DocExtractionRes.res", @@ -130,7 +130,7 @@ "id": "DocExtractionRes.SomeInnerModule.callback", "kind": "type", "name": "callback", - "signature": "type callback = (. t, ~status: status) => unit", + "signature": "type callback = (t, ~status: status) => unit", "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", @@ -166,7 +166,7 @@ "id": "DocExtractionRes.AnotherModule.callback", "kind": "type", "name": "callback", - "signature": "type callback = (. SomeInnerModule.status) => unit", + "signature": "type callback = SomeInnerModule.status => unit", "docstrings": ["Testing what this looks like."], "source": { "filepath": "src/DocExtractionRes.res", @@ -178,7 +178,7 @@ "id": "DocExtractionRes.AnotherModule.isGoodStatus", "kind": "value", "name": "isGoodStatus", - "signature": "let isGoodStatus: (. SomeInnerModule.status) => bool", + "signature": "let isGoodStatus: SomeInnerModule.status => bool", "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", @@ -226,7 +226,7 @@ "id": "DocExtractionRes.AnotherModule.domRoot", "kind": "type", "name": "domRoot", - "signature": "type domRoot = (. unit) => ReactDOM.Client.Root.t", + "signature": "type domRoot = unit => ReactDOM.Client.Root.t", "docstrings": ["Callback to get the DOM root..."], "source": { "filepath": "src/DocExtractionRes.res", @@ -262,7 +262,7 @@ "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.make", "kind": "value", "name": "make", - "signature": "let make: (. unit) => t", + "signature": "let make: unit => t", "docstrings": ["The maker of stuff!"], "source": { "filepath": "src/DocExtractionRes.res",